From 97da39889c3b670f4ee394778bc8e7edac53ed07 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 28 Aug 2020 12:27:08 +1000 Subject: [PATCH] SPIGOT-6114: PlayerRespawnEvent player's location changed before event called --- nms-patches/PlayerList.patch | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/nms-patches/PlayerList.patch b/nms-patches/PlayerList.patch index 1bc6499a5b..ce640bed1a 100644 --- a/nms-patches/PlayerList.patch +++ b/nms-patches/PlayerList.patch @@ -428,7 +428,7 @@ entityplayer1.playerConnection = entityplayer.playerConnection; entityplayer1.copyFrom(entityplayer, flag); -@@ -444,52 +622,114 @@ +@@ -444,52 +622,113 @@ entityplayer1.addScoreboardTag(s); } @@ -473,7 +473,6 @@ + } - f1 = (float) MathHelper.g(MathHelper.d(vec3d1.z, vec3d1.x) * 57.2957763671875D - 90.0D); -+ entityplayer1.setPositionRotation(vec3d.x, vec3d.y, vec3d.z, f1, 0.0F); + entityplayer1.setRespawnPosition(worldserver1.getDimensionKey(), blockposition, f, flag1, false); + flag2 = !flag && flag3; + isBedSpawn = true; @@ -568,7 +567,7 @@ return entityplayer1; } -@@ -502,7 +742,18 @@ +@@ -502,7 +741,18 @@ public void tick() { if (++this.w > 600) { @@ -588,7 +587,7 @@ this.w = 0; } -@@ -515,6 +766,25 @@ +@@ -515,6 +765,25 @@ } @@ -614,7 +613,7 @@ public void a(Packet packet, ResourceKey resourcekey) { for (int i = 0; i < this.players.size(); ++i) { EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); -@@ -615,6 +885,7 @@ +@@ -615,6 +884,7 @@ entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0)); } @@ -622,7 +621,7 @@ this.server.getCommandDispatcher().a(entityplayer); } -@@ -647,6 +918,12 @@ +@@ -647,6 +917,12 @@ for (int i = 0; i < this.players.size(); ++i) { EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); @@ -635,7 +634,7 @@ if (entityplayer != entityhuman && entityplayer.world.getDimensionKey() == resourcekey) { double d4 = d0 - entityplayer.locX(); double d5 = d1 - entityplayer.locY(); -@@ -686,23 +963,34 @@ +@@ -686,23 +962,34 @@ public void reloadWhitelist() {} public void a(EntityPlayer entityplayer, WorldServer worldserver) { @@ -675,7 +674,7 @@ } public int getPlayerCount() { -@@ -755,31 +1043,54 @@ +@@ -755,31 +1042,54 @@ entityplayer.playerInteractManager.a(this.u, EnumGamemode.NOT_SET); } @@ -738,7 +737,7 @@ if (file2.exists() && file2.isFile()) { file2.renameTo(file1); -@@ -787,7 +1098,7 @@ +@@ -787,7 +1097,7 @@ } serverstatisticmanager = new ServerStatisticManager(this.server, file1); @@ -747,7 +746,7 @@ } return serverstatisticmanager; -@@ -795,14 +1106,14 @@ +@@ -795,14 +1105,14 @@ public AdvancementDataPlayer f(EntityPlayer entityplayer) { UUID uuid = entityplayer.getUniqueID(); @@ -764,7 +763,7 @@ } advancementdataplayer.a(entityplayer); -@@ -838,13 +1149,20 @@ +@@ -838,13 +1148,20 @@ } public void reload() {