remove freeze protection mixin in favor of minecraft tag
This commit is contained in:
parent
c79f686e41
commit
44bf3cca43
@ -1,6 +1,5 @@
|
|||||||
package ru.dbotthepony.mc.otm.mixin;
|
package ru.dbotthepony.mc.otm.mixin;
|
||||||
|
|
||||||
import net.minecraft.world.entity.EquipmentSlot;
|
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraftforge.event.ForgeEventFactory;
|
import net.minecraftforge.event.ForgeEventFactory;
|
||||||
@ -9,7 +8,6 @@ import org.spongepowered.asm.mixin.Shadow;
|
|||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|
||||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability;
|
import ru.dbotthepony.mc.otm.capability.MatteryCapability;
|
||||||
import ru.dbotthepony.mc.otm.config.ServerConfig;
|
import ru.dbotthepony.mc.otm.config.ServerConfig;
|
||||||
import ru.dbotthepony.mc.otm.core.util.ExperienceUtilsKt;
|
import ru.dbotthepony.mc.otm.core.util.ExperienceUtilsKt;
|
||||||
@ -18,24 +16,6 @@ import ru.dbotthepony.mc.otm.registry.MItems;
|
|||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
@Mixin(LivingEntity.class)
|
@Mixin(LivingEntity.class)
|
||||||
public class MixinLivingEntity {
|
public class MixinLivingEntity {
|
||||||
@Inject(
|
|
||||||
method = "canFreeze()Z",
|
|
||||||
at = @At("HEAD"),
|
|
||||||
cancellable = true)
|
|
||||||
public void canFreeze(CallbackInfoReturnable<Boolean> hook) {
|
|
||||||
if (((Object) this) instanceof LivingEntity entity) {
|
|
||||||
boolean flag =
|
|
||||||
entity.getItemBySlot(EquipmentSlot.HEAD).is(MItems.INSTANCE.getTRITANIUM_HELMET()) &&
|
|
||||||
entity.getItemBySlot(EquipmentSlot.CHEST).is(MItems.INSTANCE.getTRITANIUM_CHESTPLATE()) &&
|
|
||||||
entity.getItemBySlot(EquipmentSlot.LEGS).is(MItems.INSTANCE.getTRITANIUM_PANTS()) &&
|
|
||||||
entity.getItemBySlot(EquipmentSlot.FEET).is(MItems.INSTANCE.getTRITANIUM_BOOTS())
|
|
||||||
;
|
|
||||||
|
|
||||||
if (flag)
|
|
||||||
hook.setReturnValue(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Shadow
|
@Shadow
|
||||||
protected Player lastHurtByPlayer;
|
protected Player lastHurtByPlayer;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user