Skip to content

Commit

Permalink
Update PortalTeleportCheck.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ChromaTK authored May 5, 2024
1 parent 9c6d9ff commit b81be4f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ private boolean portalEnterCheck(Player player, Portal portal) {
return recentVelocity.getY() > 0.01;
} else if (portal.mFacing == BlockFace.UP) {
// Floor portals must be entered going downwards or level to the ground, not upwards
return recentVelocity.getY() < 0.01;
// Additionally, prevent player from teleporting if sneaking, to prevent being looped between two floor portals
return recentVelocity.getY() < 0.01 && !player.isSneaking();
} else {
// Wall portals must be entered by going in their direction
// To test this, check if the player would hit the portal if they kept going in the current direction
Expand Down

0 comments on commit b81be4f

Please sign in to comment.