mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Remove some Streams usage in Entity Collision
While there is more down the collision system, remove some of the wrapping Spliterator stuff as even this wrapper stream has shown up in profiling. With other collision optimizations, we might also even avoid inner streams too.
This commit is contained in:
@@ -40,12 +40,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // 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) > 8;
|
||||
+ boolean far = entity != null && MCUtil.distance(entity.locX(), entity.locY(), entity.locZ(), x, y, z) > 1;
|
||||
+ blockposition_mutableblockposition.setValues(x, y, z); // Paper - moved up
|
||||
+
|
||||
+ IBlockData iblockdata = ICollisionAccess.this.getTypeIfLoaded(blockposition_mutableblockposition);
|
||||
+ if (iblockdata == null) {
|
||||
+ if (!(entity instanceof EntityPlayer) || entity.world.paperConfig.preventMovingIntoUnloadedChunks) {
|
||||
+ VoxelShape voxelshape3 = VoxelShapes.a(new AxisAlignedBB(new BlockPosition(x, y, z)));
|
||||
+ VoxelShape voxelshape3 = VoxelShapes.of(far ? entity.getBoundingBox() : new AxisAlignedBB(new BlockPosition(x, y, z)));
|
||||
+ consumer.accept(voxelshape3);
|
||||
+ return true;
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user