2021-08-04 15:38:03 +02:00
|
|
|
package com.minelittlepony.unicopia.mixin;
|
|
|
|
|
|
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
|
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
2022-09-11 15:42:26 +02:00
|
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
|
|
import org.spongepowered.asm.mixin.injection.Inject;
|
|
|
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|
|
|
|
2022-09-11 16:58:42 +02:00
|
|
|
import com.minelittlepony.unicopia.entity.duck.LavaAffine;
|
|
|
|
import com.minelittlepony.unicopia.entity.duck.EntityDuck;
|
2022-09-11 15:42:26 +02:00
|
|
|
|
2021-08-04 15:38:03 +02:00
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.Entity.RemovalReason;
|
|
|
|
|
|
|
|
@Mixin(Entity.class)
|
2022-09-11 16:58:42 +02:00
|
|
|
abstract class MixinEntity implements EntityDuck {
|
2022-09-11 15:42:26 +02:00
|
|
|
@Override
|
2021-08-04 15:38:03 +02:00
|
|
|
@Accessor
|
2022-09-11 15:42:26 +02:00
|
|
|
public abstract void setRemovalReason(RemovalReason reason);
|
|
|
|
|
|
|
|
@Inject(method = "isFireImmune", at = @At("HEAD"), cancellable = true)
|
|
|
|
private void onIsFireImmune(CallbackInfoReturnable<Boolean> info) {
|
|
|
|
if (this instanceof LavaAffine e && e.isLavaAffine()) {
|
|
|
|
info.setReturnValue(true);
|
|
|
|
}
|
|
|
|
}
|
2021-08-04 15:38:03 +02:00
|
|
|
}
|