diff options
author | md_5 <git@md-5.net> | 2017-03-20 15:41:15 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-03-20 15:41:15 +1100 |
commit | 257d6cd04f7d669a4000b81ca78624f6501787c1 (patch) | |
tree | 1d4a8c594d2b98af83424b5ae6e61602c82bed79 /nms-patches/World.patch | |
parent | b80055abfba170378fb945b743b945db718b3fbd (diff) | |
download | craftbukkit-257d6cd04f7d669a4000b81ca78624f6501787c1.tar craftbukkit-257d6cd04f7d669a4000b81ca78624f6501787c1.tar.gz craftbukkit-257d6cd04f7d669a4000b81ca78624f6501787c1.tar.lz craftbukkit-257d6cd04f7d669a4000b81ca78624f6501787c1.tar.xz craftbukkit-257d6cd04f7d669a4000b81ca78624f6501787c1.zip |
Process entity portalling towards the end of a tick.
Cross world teleportation works by taking a copy of an entity and moving it to a new world. After this happens the original entity is marked as dead so as to be removed from the original world, however it still undergoes one further tick in the main world, but with some information from the new world. It is not so easy to break out of this tick cycle if needed, so instead we move the portalling process towards the end of an existing tick. This ensures that the entity will not be spuriously ticked.
Diffstat (limited to 'nms-patches/World.patch')
-rw-r--r-- | nms-patches/World.patch | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/nms-patches/World.patch b/nms-patches/World.patch index 07afc4b6..29f65c51 100644 --- a/nms-patches/World.patch +++ b/nms-patches/World.patch @@ -460,7 +460,15 @@ entity.M = entity.locX; entity.N = entity.locY; entity.O = entity.locZ; -@@ -1547,11 +1799,18 @@ +@@ -1255,6 +1507,7 @@ + entity.aw(); + } else { + entity.A_(); ++ entity.postTick(); // CraftBukkit + } + } + +@@ -1547,11 +1800,18 @@ } } @@ -479,7 +487,7 @@ TileEntity tileentity = null; if (this.M) { -@@ -1586,6 +1845,14 @@ +@@ -1586,6 +1846,14 @@ public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { if (!this.E(blockposition)) { if (tileentity != null && !tileentity.y()) { @@ -494,7 +502,7 @@ if (this.M) { tileentity.setPosition(blockposition); Iterator iterator = this.b.iterator(); -@@ -1745,6 +2012,14 @@ +@@ -1745,6 +2013,14 @@ } this.o = MathHelper.a(this.o, 0.0F, 1.0F); @@ -509,7 +517,7 @@ } } } -@@ -1876,7 +2151,10 @@ +@@ -1876,7 +2152,10 @@ } public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) { @@ -521,7 +529,7 @@ return false; } else { int i = 0; -@@ -2043,7 +2321,7 @@ +@@ -2043,7 +2322,7 @@ while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -530,7 +538,7 @@ arraylist.add(entity); } } -@@ -2058,7 +2336,7 @@ +@@ -2058,7 +2337,7 @@ while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -539,7 +547,7 @@ arraylist.add(entity); } } -@@ -2107,7 +2385,7 @@ +@@ -2107,7 +2386,7 @@ } } @@ -548,7 +556,7 @@ } @Nullable -@@ -2128,8 +2406,17 @@ +@@ -2128,8 +2407,17 @@ while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -568,7 +576,7 @@ ++i; } } -@@ -2138,12 +2425,18 @@ +@@ -2138,12 +2426,18 @@ } public void a(Collection<Entity> collection) { @@ -588,7 +596,7 @@ this.b(entity); } -@@ -2157,7 +2450,13 @@ +@@ -2157,7 +2451,13 @@ IBlockData iblockdata = this.getType(blockposition); AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().c(this, blockposition); @@ -603,7 +611,7 @@ } public int K() { -@@ -2267,6 +2566,11 @@ +@@ -2267,6 +2567,11 @@ for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman1 = (EntityHuman) this.players.get(i); @@ -615,7 +623,7 @@ if (predicate.apply(entityhuman1)) { double d5 = entityhuman1.d(d0, d1, d2); -@@ -2435,6 +2739,16 @@ +@@ -2435,6 +2740,16 @@ public void everyoneSleeping() {} @@ -632,7 +640,7 @@ public float h(float f) { return (this.p + (this.q - this.p) * f) * this.j(f); } -@@ -2652,7 +2966,7 @@ +@@ -2652,7 +2967,7 @@ int l = j * 16 + 8 - blockposition.getZ(); boolean flag = true; |