TheBrokenRail
5167a1319d
All checks were successful
RelicCraft/pipeline/head This commit looks good
Use DataTracker
20 lines
816 B
Java
20 lines
816 B
Java
package com.thebrokenrail.reliccraft.mixin;
|
|
|
|
import com.thebrokenrail.reliccraft.block.TeleportationRestrictorBlock;
|
|
import net.minecraft.entity.LivingEntity;
|
|
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;
|
|
|
|
@SuppressWarnings("unused")
|
|
@Mixin(LivingEntity.class)
|
|
public abstract class MixinLivingEntity {
|
|
@Inject(at = @At("HEAD"), method = "teleport", cancellable = true)
|
|
public void teleport(double x, double y, double z, boolean particleEffects, CallbackInfoReturnable<Boolean> info) {
|
|
if (((TeleportationRestrictorBlock.TeleportingEntity) this).cannotTeleport()) {
|
|
info.setReturnValue(false);
|
|
}
|
|
}
|
|
}
|