Fix stuck in portals

This commit is contained in:
William Blake Galbreath
2025-01-10 12:39:08 -08:00
committed by granny
parent de8dffe5f2
commit fafdf0f8a7
5 changed files with 26 additions and 65 deletions

View File

@@ -40,6 +40,14 @@
Entity entity = damageSource.getEntity();
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
!(entity instanceof Player player && !this.canHarmPlayer(player))
@@ -1446,6 +_,7 @@
serverLevel.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
this.unsetRemoved();
// CraftBukkit end
+ this.portalPos = io.papermc.paper.util.MCUtil.toBlockPosition(exit); // Purpur - Fix stuck in portals
this.setServerLevel(level);
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
@@ -2014,6 +_,26 @@
this.lastSentExp = -1; // CraftBukkit - Added to reset
}