From be8ac7acc3ca286aac62c836db03d69b57f7b8fe Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 4 Jul 2024 16:20:03 +0200 Subject: [PATCH] Fix respawn error due to null location Closes #11017 --- .../server/1007-Optimize-Collision-to-not-load-chunks.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/1007-Optimize-Collision-to-not-load-chunks.patch b/patches/server/1007-Optimize-Collision-to-not-load-chunks.patch index 31fddd9a4b..9db6ef0fed 100644 --- a/patches/server/1007-Optimize-Collision-to-not-load-chunks.patch +++ b/patches/server/1007-Optimize-Collision-to-not-load-chunks.patch @@ -14,14 +14,14 @@ movement will load only the chunk the player enters anyways and avoids loading massive amounts of surrounding chunks due to large AABB lookups. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0d0b07c9199be9ca0d5ac3feb1d44f149ba69283..14fb62dedabf2d858bea1877c2e28d1a7b6f5be4 100644 +index 0d0b07c9199be9ca0d5ac3feb1d44f149ba69283..1aa8b914e79c0d48094cc22df60ee9750ec3ccd6 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -865,6 +865,7 @@ public abstract class PlayerList { Vec3 vec3d = dimensiontransition.pos(); entityplayer1.forceSetPositionRotation(vec3d.x, vec3d.y, vec3d.z, dimensiontransition.yRot(), dimensiontransition.xRot()); -+ worldserver.getChunkSource().addRegionTicket(net.minecraft.server.level.TicketType.POST_TELEPORT, new net.minecraft.world.level.ChunkPos(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper ++ worldserver.getChunkSource().addRegionTicket(net.minecraft.server.level.TicketType.POST_TELEPORT, new net.minecraft.world.level.ChunkPos(net.minecraft.util.Mth.floor(vec3d.x()) >> 4, net.minecraft.util.Mth.floor(vec3d.z()) >> 4), 1, entityplayer.getId()); // Paper // CraftBukkit end if (dimensiontransition.missingRespawnBlock()) { entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F));