Skip to content

Commit

Permalink
✅ 兼容Minecraft 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
1024-byteeeee committed Jun 14, 2024
1 parent a42e1cf commit 9e5b8a1
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;

import net.minecraft.block.NetherPortalBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.block.NetherPortalBlock;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -38,10 +38,20 @@ public abstract class NetherPortalBlockMixin {
method = "onEntityCollision",
at = @At(
value = "INVOKE",
//#if MC>=12100
//$$ target = "Lnet/minecraft/entity/Entity;canUsePortals(Z)Z"
//#else
target = "Lnet/minecraft/entity/Entity;canUsePortals()Z"
//#endif
)
)
private boolean onEntityCollision(Entity entity, Operation<Boolean> original) {
private boolean onEntityCollision(
Entity entity,
//#if MC>=12100
//$$ boolean canUsePortals,
//#endif
Operation<Boolean> original
) {
if (AmsServerSettings.playerNoNetherPortalTeleport && entity instanceof PlayerEntity) {
return false;
} else {
Expand Down

0 comments on commit 9e5b8a1

Please sign in to comment.