Add a TELEPORT ticket when changing dimensions

This should fix any remaining issues around collision issues on
chunk edges when changing dimensions sending to Y 256
This commit is contained in:
Aikar 2020-05-10 23:58:04 -04:00
parent 8e9459eadc
commit 1ea9ada0da
No known key found for this signature in database
GPG key ID: 401ADFC9891FAAFE

View file

@ -62,14 +62,14 @@ index f851ed11df14fd9aa8017f44d82fb6cfc3bde345..8b0670b8db0bb739fb54fee368a53ead
if ((j2 != 1 || iblockdata.f()) && (j2 != 2 || iblockdata.getBlock() == Blocks.MOVING_PISTON)) {
VoxelShape voxelshape2 = iblockdata.b((IBlockAccess) ICollisionAccess.this, blockposition_mutableblockposition, voxelshapecollision);
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 909d86e14c7860cd6d8a6f38ef4aedb183acae3f..fddd92677db06aa9fc41437f34719d9ae6e44c93 100644
index 909d86e14c7860cd6d8a6f38ef4aedb183acae3f..b2c2d56e2be893dac5eb13d6648c5df65eb3ea4e 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -677,6 +677,7 @@ public abstract class PlayerList {
entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
// CraftBukkit end
+ location.getChunk(); // Paper - force load chunk to be sure getCubes works
+ worldserver.getChunkProvider().addTicket(TicketType.POST_TELEPORT, new ChunkCoordIntPair(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper
while (avoidSuffocation && !worldserver.getCubes(entityplayer1) && entityplayer1.locY() < 256.0D) {
entityplayer1.setPosition(entityplayer1.locX(), entityplayer1.locY() + 1.0D, entityplayer1.locZ());
}