添加冷汗联动
This commit is contained in:
parent
34e07ce860
commit
2ab2a48f3c
4 changed files with 29 additions and 0 deletions
|
@ -143,6 +143,9 @@ dependencies {
|
|||
// implementation "curse.maven:cupboard-326652:6078150"
|
||||
// implementation "curse.maven:connectivity-470193:6229173"
|
||||
|
||||
// 冷汗
|
||||
implementation "curse.maven:cold-sweat-506194:6176789"
|
||||
|
||||
// 测试用mod
|
||||
implementation "curse.maven:better-combat-by-daedelus-639842:6532547"
|
||||
implementation "curse.maven:playeranimator-658587:6024462"
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.atsuishio.superbwarfare.client.renderer.molang.MolangVariable;
|
|||
import com.atsuishio.superbwarfare.client.sound.ModSoundInstances;
|
||||
import com.atsuishio.superbwarfare.compat.CompatHolder;
|
||||
import com.atsuishio.superbwarfare.compat.clothconfig.ClothConfigHelper;
|
||||
import com.atsuishio.superbwarfare.compat.coldsweat.ColdSweatCompatHandler;
|
||||
import com.atsuishio.superbwarfare.component.ModDataComponents;
|
||||
import com.atsuishio.superbwarfare.config.ClientConfig;
|
||||
import com.atsuishio.superbwarfare.config.CommonConfig;
|
||||
|
@ -80,6 +81,9 @@ public class Mod {
|
|||
if (FMLEnvironment.dist == Dist.CLIENT) {
|
||||
CompatHolder.hasMod(CompatHolder.CLOTH_CONFIG, ClothConfigHelper::registerScreen);
|
||||
}
|
||||
if (ColdSweatCompatHandler.hasMod()) {
|
||||
NeoForge.EVENT_BUS.addListener(ColdSweatCompatHandler::onPlayerInVehicle);
|
||||
}
|
||||
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ public class CompatHolder {
|
|||
public static final String DMV = "dreamaticvoyage";
|
||||
public static final String VRC = "virtuarealcraft";
|
||||
public static final String CLOTH_CONFIG = "cloth_config";
|
||||
public static final String COLD_SWEAT = "cold_sweat";
|
||||
|
||||
// @ObjectHolder(registryName = "minecraft:mob_effect", value = DMV + ":bleeding")
|
||||
// public static final MobEffect DMV_BLEEDING = null;
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.atsuishio.superbwarfare.compat.coldsweat;
|
||||
|
||||
import com.atsuishio.superbwarfare.compat.CompatHolder;
|
||||
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
|
||||
import com.momosoftworks.coldsweat.api.util.Temperature;
|
||||
import net.neoforged.fml.ModList;
|
||||
import net.neoforged.neoforge.event.tick.PlayerTickEvent;
|
||||
|
||||
public class ColdSweatCompatHandler {
|
||||
|
||||
public static void onPlayerInVehicle(PlayerTickEvent.Pre event) {
|
||||
var player = event.getEntity();
|
||||
if (player.getVehicle() instanceof ArmedVehicleEntity vehicle && vehicle.hidePassenger(player)) {
|
||||
Temperature.set(player, Temperature.Trait.WORLD, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasMod() {
|
||||
return ModList.get().isLoaded(CompatHolder.COLD_SWEAT);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue