diff --git a/src/main/java/me/andante/noclip/mixin/EndGatewayBlockEntityMixin.java b/src/main/java/me/andante/noclip/mixin/EndGatewayBlockEntityMixin.java deleted file mode 100644 index cf812db..0000000 --- a/src/main/java/me/andante/noclip/mixin/EndGatewayBlockEntityMixin.java +++ /dev/null @@ -1,22 +0,0 @@ -package me.andante.noclip.mixin; - -import me.andante.noclip.impl.ClippingEntity; -import net.minecraft.block.entity.EndGatewayBlockEntity; -import net.minecraft.entity.Entity; -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(EndGatewayBlockEntity.class) -public class EndGatewayBlockEntityMixin { - /** - * Prevents end gateway teleportation when an entity is clipping. - */ - @Inject(method = "canTeleport", at = @At("RETURN"), cancellable = true) - private static void onCanTeleport(Entity entity, CallbackInfoReturnable cir) { - if (cir.getReturnValueZ()) { - if (entity instanceof ClippingEntity clippingPlayer && clippingPlayer.isClipping()) cir.setReturnValue(false); - } - } -} diff --git a/src/main/java/me/andante/noclip/mixin/EntityPredicatesMixin.java b/src/main/java/me/andante/noclip/mixin/EntityPredicatesMixin.java index eb05793..5f8c33d 100644 --- a/src/main/java/me/andante/noclip/mixin/EntityPredicatesMixin.java +++ b/src/main/java/me/andante/noclip/mixin/EntityPredicatesMixin.java @@ -23,6 +23,13 @@ private static void onValidLivingEntity(Entity entity, CallbackInfoReturnable cir) { + if (cir.getReturnValueZ()) { + if (entity instanceof ClippingEntity clippingEntity && clippingEntity.isClipping()) cir.setReturnValue(false); + } + } + /** * Removes collision entirely from clipping players. */ diff --git a/src/main/resources/noclip.mixins.json b/src/main/resources/noclip.mixins.json index 182f43b..80cd0c8 100644 --- a/src/main/resources/noclip.mixins.json +++ b/src/main/resources/noclip.mixins.json @@ -5,7 +5,6 @@ "package": "me.andante.noclip.mixin", "mixins": [ "AreaEffectCloudEntityMixin", - "EndGatewayBlockEntityMixin", "EntityMixin", "EntityPredicatesMixin", "ExplosionMixin",