Remove health modifier
This commit is contained in:
parent
da321363d4
commit
041601b649
3 changed files with 45 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ import net.minecraft.world.entity.EntityType;
|
|||
import net.minecraft.world.entity.MobCategory;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
|
@ -27,6 +28,7 @@ import org.slf4j.Logger;
|
|||
import xyz.illuc.neuralgiacore.entities.OfflinePlayerEntity;
|
||||
import xyz.illuc.neuralgiacore.entities.OfflinePlayerRenderer;
|
||||
import xyz.illuc.neuralgiacore.peripherals.BearingPeripheral;
|
||||
//import xyz.illuc.neuralgiacore.peripherals.GunPeripheral;
|
||||
import xyz.illuc.neuralgiacore.registers.RegisterItems;
|
||||
import xyz.illuc.neuralgiacore.registers.RegisterMedicalFluids;
|
||||
|
||||
|
|
@ -74,12 +76,15 @@ public class NeuralgiaCoreMod {
|
|||
event.enqueueWork(this::registerPeripherals);
|
||||
}
|
||||
|
||||
//TODO move peripheral stuff in a different file
|
||||
private void registerPeripherals() {
|
||||
registerBearingPeripheral("mechanical_bearing");
|
||||
|
||||
registerBearingPeripheral("clockwork_bearing");
|
||||
|
||||
registerBearingPeripheral("windmill_bearing");
|
||||
|
||||
registerGunPeripheral("machine_gun");
|
||||
}
|
||||
|
||||
private void registerBearingPeripheral(String blockEntityName) {
|
||||
|
|
@ -109,6 +114,30 @@ public class NeuralgiaCoreMod {
|
|||
}
|
||||
}
|
||||
|
||||
private void registerGunPeripheral(String blockEntityName) {
|
||||
BlockEntityType<?> type = ForgeRegistries.BLOCK_ENTITY_TYPES.getValue(
|
||||
new ResourceLocation("crusty_chunks", blockEntityName)
|
||||
);
|
||||
|
||||
if (type != null) {
|
||||
ForgeComputerCraftAPI.registerPeripheralProvider((level, pos, direction) -> {
|
||||
var blockEntity = level.getBlockEntity(pos);
|
||||
if (blockEntity != null && blockEntity.getType() == type) {
|
||||
try {
|
||||
//TODO gun peripheral
|
||||
} catch (ClassCastException e) {
|
||||
LOGGER.error("Failed to create peripheral at {}", pos);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
LOGGER.debug("Registered peripheral for {}", blockEntityName);
|
||||
} else {
|
||||
LOGGER.warn("Could not find block entity type: crusty_chunks:{}", blockEntityName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package xyz.illuc.neuralgiacore.mixin.Tfc;
|
||||
|
||||
import net.dries007.tfc.common.capabilities.food.TFCFoodData;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(TFCFoodData.class)
|
||||
public class MixinDisableHealthModifier {
|
||||
@Inject(method = "getHealthModifier", at = @At("HEAD"), cancellable = true, remap = false)
|
||||
private void disableHealthModifier(CallbackInfoReturnable<Float> cir) {
|
||||
cir.setReturnValue(1f);
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
"PrototypePain.MixinSepsis",
|
||||
"PrototypePain.MixinSickness",
|
||||
"PrototypePain.MixinSicknessOverlay",
|
||||
"Tfc.MixinDisableHealthModifier",
|
||||
"Tfc.MixinFoodData",
|
||||
"Tfc.MixinHealthBar",
|
||||
"Tfc.MixinOptimizeClimateUpdate",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue