summaryrefslogtreecommitdiffstats
path: root/nms-patches/PlayerList.patch
diff options
context:
space:
mode:
authorThinkofname <thinkofdeath@spigotmc.org>2016-04-02 01:12:03 +0100
committerThinkofname <thinkofdeath@spigotmc.org>2016-04-02 01:12:03 +0100
commitf01861f80bc8d903f72210e7d79c90c35473aa74 (patch)
treef9fb4ca2bed51072ec2f7088de9d22608cc3b845 /nms-patches/PlayerList.patch
parent048849ce51d2cb4bf59b9ec7a8c2b870e83da599 (diff)
downloadcraftbukkit-f01861f80bc8d903f72210e7d79c90c35473aa74.tar
craftbukkit-f01861f80bc8d903f72210e7d79c90c35473aa74.tar.gz
craftbukkit-f01861f80bc8d903f72210e7d79c90c35473aa74.tar.lz
craftbukkit-f01861f80bc8d903f72210e7d79c90c35473aa74.tar.xz
craftbukkit-f01861f80bc8d903f72210e7d79c90c35473aa74.zip
SPIGOT-2115: Fix entities being added to the world multiple times when teleported
Diffstat (limited to 'nms-patches/PlayerList.patch')
-rw-r--r--nms-patches/PlayerList.patch30
1 files changed, 16 insertions, 14 deletions
diff --git a/nms-patches/PlayerList.patch b/nms-patches/PlayerList.patch
index b872d95c..cc18dd76 100644
--- a/nms-patches/PlayerList.patch
+++ b/nms-patches/PlayerList.patch
@@ -588,12 +588,12 @@
+ double d1 = enter.getZ();
+ double d2 = 8.0D;
+ /*
-+ double d0 = entity.locX;
-+ double d1 = entity.locZ;
-+ double d2 = 8.0D;
-+ float f = entity.yaw;
-+
-+ worldserver.methodProfiler.a("moving");
+ double d0 = entity.locX;
+ double d1 = entity.locZ;
+ double d2 = 8.0D;
+ float f = entity.yaw;
+
+ worldserver.methodProfiler.a("moving");
+ */
+ if (worldserver1.dimension == -1) {
+ d0 = MathHelper.a(d0 / d2, worldserver1.getWorldBorder().b()+ 16.0D, worldserver1.getWorldBorder().d() - 16.0D);
@@ -663,12 +663,12 @@
+ int i = worldserver.dimension;
+
+ /*
- double d0 = entity.locX;
- double d1 = entity.locZ;
- double d2 = 8.0D;
- float f = entity.yaw;
-
- worldserver.methodProfiler.a("moving");
++ double d0 = entity.locX;
++ double d1 = entity.locZ;
++ double d2 = 8.0D;
++ float f = entity.yaw;
++
++ worldserver.methodProfiler.a("moving");
+ */
+ entity.setPositionRotation(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch());
+ if (entity.isAlive()) {
@@ -687,7 +687,7 @@
blockposition = worldserver1.getSpawn();
} else {
blockposition = worldserver1.getDimensionSpawn();
-@@ -526,15 +903,26 @@
+@@ -526,16 +903,27 @@
worldserver.entityJoinedWorld(entity, false);
}
}
@@ -703,6 +703,7 @@
if (entity.isAlive()) {
- entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch);
- worldserver1.getTravelAgent().a(entity, f);
+- worldserver1.addEntity(entity);
+ // entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch);
+ // worldserver1.getTravelAgent().a(entity, f);
+ if (portal) {
@@ -713,9 +714,10 @@
+ entity.getBukkitEntity().setVelocity(velocity);
+ }
+ }
- worldserver1.addEntity(entity);
++ // worldserver1.addEntity(entity);
worldserver1.entityJoinedWorld(entity, false);
}
+
@@ -543,6 +931,7 @@
}