diff --git a/Spigot-Server-Patches/0453-Optimize-Collision-to-not-load-chunks.patch b/Spigot-Server-Patches/0453-Optimize-Collision-to-not-load-chunks.patch index 4534b02c48..14816aecb7 100644 --- a/Spigot-Server-Patches/0453-Optimize-Collision-to-not-load-chunks.patch +++ b/Spigot-Server-Patches/0453-Optimize-Collision-to-not-load-chunks.patch @@ -14,7 +14,7 @@ movement will load only the chunk the player enters anyways and avoids loading massive amounts of surrounding chunks due to large AABB lookups. diff --git a/src/main/java/net/minecraft/server/ICollisionAccess.java b/src/main/java/net/minecraft/server/ICollisionAccess.java -index f851ed11df14fd9aa8017f44d82fb6cfc3bde345..bdebbaf0b93ae7186b0afb3b2c04fdcf11148121 100644 +index f851ed11df14fd9aa8017f44d82fb6cfc3bde345..ab88a4f6526f3bae324b53d47581faf384a65ede 100644 --- a/src/main/java/net/minecraft/server/ICollisionAccess.java +++ b/src/main/java/net/minecraft/server/ICollisionAccess.java @@ -83,19 +83,29 @@ public interface ICollisionAccess extends IBlockAccess { @@ -40,10 +40,10 @@ index f851ed11df14fd9aa8017f44d82fb6cfc3bde345..bdebbaf0b93ae7186b0afb3b2c04fdcf + // Paper start - ensure we don't load chunks + //int k2 = k1 >> 4; + //int l2 = i2 >> 4; -+ boolean far = entity != null && MCUtil.distance(entity.locX(), entity.locY(), entity.locZ(), x, y, z) > 1; ++ boolean far = entity != null && MCUtil.distance(entity.locX(), entity.locY(), entity.locZ(), x, y, z) > 8; + blockposition_mutableblockposition.setValues(x, y, z); // Paper - moved up + -+ IBlockData iblockdata = ICollisionAccess.this.getTypeIfLoaded(blockposition_mutableblockposition); ++ IBlockData iblockdata = !far ? ICollisionAccess.this.getType(blockposition_mutableblockposition) : ICollisionAccess.this.getTypeIfLoaded(blockposition_mutableblockposition); + if (iblockdata == null) { + if (!(entity instanceof EntityPlayer) || entity.world.paperConfig.preventMovingIntoUnloadedChunks) { + VoxelShape voxelshape3 = VoxelShapes.of(far ? entity.getBoundingBox() : new AxisAlignedBB(new BlockPosition(x, y, z))); diff --git a/Spigot-Server-Patches/0513-Remove-some-Streams-usage-in-Entity-Collision.patch b/Spigot-Server-Patches/0513-Remove-some-Streams-usage-in-Entity-Collision.patch index 1747a3ab6a..0f18f491fc 100644 --- a/Spigot-Server-Patches/0513-Remove-some-Streams-usage-in-Entity-Collision.patch +++ b/Spigot-Server-Patches/0513-Remove-some-Streams-usage-in-Entity-Collision.patch @@ -21,7 +21,7 @@ index e865a5694f78fb9273a0625ab2c30b87d0711a90..5648ba73c533f622c35c808decdb305f default Stream b(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Set set) { return IEntityAccess.super.b(entity, axisalignedbb, set); diff --git a/src/main/java/net/minecraft/server/ICollisionAccess.java b/src/main/java/net/minecraft/server/ICollisionAccess.java -index be4e311eadbd5a3b4d17ec6eb691d3ff0af711ae..434d8fd019b63e7352c435fe72cdfc32e338e8c5 100644 +index 7d9a742224e1694c3d7f1c8dd218598adf6f2767..4fb02328862018e1df12824db5b450333d482b1c 100644 --- a/src/main/java/net/minecraft/server/ICollisionAccess.java +++ b/src/main/java/net/minecraft/server/ICollisionAccess.java @@ -43,18 +43,39 @@ public interface ICollisionAccess extends IBlockAccess { @@ -95,7 +95,7 @@ index be4e311eadbd5a3b4d17ec6eb691d3ff0af711ae..434d8fd019b63e7352c435fe72cdfc32 } @@ -98,9 +119,8 @@ public interface ICollisionAccess extends IBlockAccess { - IBlockData iblockdata = ICollisionAccess.this.getTypeIfLoaded(blockposition_mutableblockposition); + IBlockData iblockdata = !far ? ICollisionAccess.this.getType(blockposition_mutableblockposition) : ICollisionAccess.this.getTypeIfLoaded(blockposition_mutableblockposition); if (iblockdata == null) { if (!(entity instanceof EntityPlayer) || entity.world.paperConfig.preventMovingIntoUnloadedChunks) { - VoxelShape voxelshape3 = VoxelShapes.of(far ? entity.getBoundingBox() : new AxisAlignedBB(new BlockPosition(x, y, z)));