summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-10-23 14:00:35 +1100
committermd_5 <git@md-5.net>2016-10-23 14:00:35 +1100
commit2e39de698d0998d4d5a2283686d192614505b7fa (patch)
tree54d3a4f6d0b060247cabc2953f1e63a14a5fc850
parentd86d282f63938a2c5705b898090d04e15d92890c (diff)
downloadcraftbukkit-2e39de698d0998d4d5a2283686d192614505b7fa.tar
craftbukkit-2e39de698d0998d4d5a2283686d192614505b7fa.tar.gz
craftbukkit-2e39de698d0998d4d5a2283686d192614505b7fa.tar.lz
craftbukkit-2e39de698d0998d4d5a2283686d192614505b7fa.tar.xz
craftbukkit-2e39de698d0998d4d5a2283686d192614505b7fa.zip
SPIGOT-1903, MC-98153: Portal Location Sync Issues
-rw-r--r--nms-patches/EntityPlayer.patch18
-rw-r--r--nms-patches/PlayerConnection.patch9
-rw-r--r--nms-patches/PlayerList.patch2
3 files changed, 21 insertions, 8 deletions
diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch
index d9f1f242..d5fa2376 100644
--- a/nms-patches/EntityPlayer.patch
+++ b/nms-patches/EntityPlayer.patch
@@ -189,17 +189,17 @@
+ }
+ }
+ }
-+
-+ IChatBaseComponent chatmessage = this.getCombatTracker().getDeathMessage();
-+
-+ String deathmessage = chatmessage.toPlainText();
-+ org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage, keepInventory);
- if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) {
- if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) {
- this.server.getPlayerList().a((EntityHuman) this, this.getCombatTracker().getDeathMessage());
- } else if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OWN_TEAM) {
- this.server.getPlayerList().b((EntityHuman) this, this.getCombatTracker().getDeathMessage());
++ IChatBaseComponent chatmessage = this.getCombatTracker().getDeathMessage();
++
++ String deathmessage = chatmessage.toPlainText();
++ org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage, keepInventory);
++
+ String deathMessage = event.getDeathMessage();
+
+ if (deathMessage != null && deathMessage.length() > 0 && flag) { // TODO: allow plugins to override?
@@ -512,7 +512,7 @@
}
public void a(EnumHand enumhand) {
-@@ -955,11 +1161,139 @@
+@@ -955,11 +1161,145 @@
}
public void M() {
@@ -615,6 +615,12 @@
+ return super.toString() + "(" + this.getName() + " at " + this.locX + "," + this.locY + "," + this.locZ + ")";
+ }
+
++ // SPIGOT-1903, MC-98153
++ public void forceSetPositionRotation(double x, double y, double z, float yaw, float pitch) {
++ this.setPositionRotation(x, y, z, yaw, pitch);
++ this.playerConnection.d();
++ }
++
+ public void reset() {
+ float exp = 0;
+ boolean keepInventory = this.world.getGameRules().getBoolean("keepInventory");
diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch
index 8a7ef1f0..dcf3649c 100644
--- a/nms-patches/PlayerConnection.patch
+++ b/nms-patches/PlayerConnection.patch
@@ -103,7 +103,7 @@
public void E_() {
this.d();
-@@ -110,15 +182,21 @@
+@@ -110,21 +182,27 @@
}
this.minecraftServer.methodProfiler.b();
@@ -125,6 +125,13 @@
this.disconnect("You have been idle for too long!");
}
+ }
+
+- private void d() {
++ public void d() { // PAIL: syncPosition, private->public
+ this.l = this.player.locX;
+ this.m = this.player.locY;
+ this.n = this.player.locZ;
@@ -138,19 +216,40 @@
}
diff --git a/nms-patches/PlayerList.patch b/nms-patches/PlayerList.patch
index a1c98d9f..207bdf0c 100644
--- a/nms-patches/PlayerList.patch
+++ b/nms-patches/PlayerList.patch
@@ -442,7 +442,7 @@
+ location.setWorld(server.getWorldServer(i).getWorld());
}
+ WorldServer worldserver = ((CraftWorld) location.getWorld()).getHandle();
-+ entityplayer1.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
++ entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
+ // CraftBukkit end
worldserver.getChunkProviderServer().getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4);