testserver/Spigot-Server-Patches/0111-Re-track-players-that-...

37 lines
1.5 KiB
Diff

From 5a1ada2f1061cb0b8cc21617685f1962b8cb1882 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 31 Jul 2016 16:33:03 -0500
Subject: [PATCH] Re-track players that dismount from other players
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 12fa705b0..5d6acca27 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -991,6 +991,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (entity1 != entity && this.playerConnection != null) {
this.playerConnection.a(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
}
+ // Paper start - "Fixes" an issue in which the vehicle player would not be notified that the passenger dismounted
+ if (entity instanceof EntityPlayer) {
+ // TODO verify this solution
+ WorldServer worldServer = (WorldServer) entity.getWorld();
+ worldServer.getChunkProvider().playerChunkMap.removeEntity(this);
+ worldServer.getChunkProvider().playerChunkMap.addEntity(this);
+ }
+ // Paper end
}
@@ -1007,7 +1015,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (!this.isSpectator()) {
super.b(blockposition);
}
-
}
public void a(double d0, boolean flag) {
--
2.24.1