mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-09 09:01:36 +01:00
Don't use our modified chunk checks for collision in world gen
Fixes issues with errors in logs on generating chunks
This commit is contained in:
parent
5eea746c78
commit
bd2a5095d3
@ -30,20 +30,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
int j2 = cursorposition.e();
|
||||
|
||||
if (j2 != 3) {
|
||||
- int k2 = k1 >> 4;
|
||||
- int l2 = i2 >> 4;
|
||||
+ // Paper start - ensure we don't load chunks
|
||||
int k2 = k1 >> 4;
|
||||
int l2 = i2 >> 4;
|
||||
- IBlockAccess iblockaccess = ICollisionAccess.this.c(k2, l2);
|
||||
-
|
||||
- if (iblockaccess != null) {
|
||||
- blockposition_mutableblockposition.d(k1, l1, i2);
|
||||
- IBlockData iblockdata = iblockaccess.getType(blockposition_mutableblockposition);
|
||||
+ // 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;
|
||||
+ blockposition_mutableblockposition.setValues(x, y, z); // Paper - moved up
|
||||
+ blockposition_mutableblockposition.setValues(x, y, z);
|
||||
+
|
||||
+ IBlockData iblockdata = !far ? ICollisionAccess.this.getType(blockposition_mutableblockposition) : ICollisionAccess.this.getTypeIfLoaded(blockposition_mutableblockposition);
|
||||
+ boolean isRegionLimited = ICollisionAccess.this instanceof RegionLimitedWorldAccess;
|
||||
+ IBlockData iblockdata = !isRegionLimited ? ICollisionAccess.this.getTypeIfLoaded(blockposition_mutableblockposition) : null;
|
||||
+ if ((isRegionLimited || !far) && iblockdata == null) {
|
||||
+ IBlockAccess c = ICollisionAccess.this.c(k2, l2);
|
||||
+ if (c != null) {
|
||||
+ iblockdata = c.getType(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)));
|
||||
|
@ -95,7 +95,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public interface ICollisionAccess extends IBlockAccess {
|
||||
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)));
|
||||
|
Loading…
Reference in New Issue
Block a user