diff options
Diffstat (limited to 'nms-patches/World.patch')
-rw-r--r-- | nms-patches/World.patch | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/nms-patches/World.patch b/nms-patches/World.patch index a123bfb6..377a4ccc 100644 --- a/nms-patches/World.patch +++ b/nms-patches/World.patch @@ -448,29 +448,37 @@ } } } -@@ -1241,6 +1490,13 @@ - } - - public void entityJoinedWorld(Entity entity, boolean flag) { +@@ -1244,15 +1493,13 @@ + int i; + int j; + +- if (!(entity instanceof EntityHuman)) { +- i = MathHelper.floor(entity.locX); +- j = MathHelper.floor(entity.locZ); +- boolean flag1 = true; +- +- if (flag && !this.isAreaLoaded(i - 32, 0, j - 32, i + 32, 0, j + 32, true)) { +- return; +- } + // CraftBukkit start - check if chunks are loaded as done in previous versions ++ // TODO: Go back to Vanilla behaviour when comfortable + Chunk startingChunk = this.getChunkIfLoaded(MathHelper.floor(entity.locX) >> 4, MathHelper.floor(entity.locZ) >> 4); + if (flag && !(startingChunk != null && startingChunk.areNeighborsLoaded(2))) { + return; -+ } + } + // CraftBukkit end -+ + entity.M = entity.locX; entity.N = entity.locY; - entity.O = entity.locZ; -@@ -1252,6 +1508,7 @@ - entity.leaveVehicle(); +@@ -1265,6 +1512,7 @@ + entity.aC(); } else { entity.B_(); + entity.postTick(); // CraftBukkit } } -@@ -1543,11 +1800,18 @@ +@@ -1556,11 +1804,18 @@ } } @@ -489,7 +497,7 @@ TileEntity tileentity = null; if (this.O) { -@@ -1582,6 +1846,14 @@ +@@ -1595,6 +1850,14 @@ public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { if (!this.E(blockposition)) { if (tileentity != null && !tileentity.y()) { @@ -504,7 +512,7 @@ if (this.O) { tileentity.setPosition(blockposition); Iterator iterator = this.b.iterator(); -@@ -1741,6 +2013,14 @@ +@@ -1754,6 +2017,14 @@ } this.o = MathHelper.a(this.o, 0.0F, 1.0F); @@ -519,7 +527,7 @@ } } } -@@ -1878,7 +2158,10 @@ +@@ -1891,7 +2162,10 @@ } public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) { @@ -531,7 +539,7 @@ return false; } else { int i = 0; -@@ -2045,7 +2328,7 @@ +@@ -2058,7 +2332,7 @@ while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -540,7 +548,7 @@ arraylist.add(entity); } } -@@ -2060,7 +2343,7 @@ +@@ -2073,7 +2347,7 @@ while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -549,7 +557,7 @@ arraylist.add(entity); } } -@@ -2109,7 +2392,7 @@ +@@ -2122,7 +2396,7 @@ } } @@ -558,7 +566,7 @@ } @Nullable -@@ -2130,8 +2413,17 @@ +@@ -2143,8 +2417,17 @@ while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -577,7 +585,7 @@ ++i; } } -@@ -2140,12 +2432,18 @@ +@@ -2153,12 +2436,18 @@ } public void a(Collection<Entity> collection) { @@ -597,7 +605,7 @@ this.b(entity); } -@@ -2159,7 +2457,13 @@ +@@ -2172,7 +2461,13 @@ IBlockData iblockdata = this.getType(blockposition); AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().d(this, blockposition); @@ -612,7 +620,7 @@ } public int getSeaLevel() { -@@ -2269,6 +2573,11 @@ +@@ -2282,6 +2577,11 @@ for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman1 = (EntityHuman) this.players.get(i); @@ -624,7 +632,7 @@ if (predicate.apply(entityhuman1)) { double d5 = entityhuman1.d(d0, d1, d2); -@@ -2437,6 +2746,16 @@ +@@ -2450,6 +2750,16 @@ public void everyoneSleeping() {} @@ -641,7 +649,7 @@ public float h(float f) { return (this.p + (this.q - this.p) * f) * this.j(f); } -@@ -2654,7 +2973,7 @@ +@@ -2667,7 +2977,7 @@ int l = j * 16 + 8 - blockposition.getZ(); boolean flag = true; |