mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 05:11:27 +01:00
Fix collisions during world generation (#6129)
This commit is contained in:
parent
5fe7fbd769
commit
2c55fce23e
@ -76,11 +76,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ boolean far = this.source != null && net.minecraft.server.MCUtil.distanceSq(this.source.getX(), y, this.source.getZ(), x, y, z) > 14;
|
+ boolean far = this.source != null && net.minecraft.server.MCUtil.distanceSq(this.source.getX(), y, this.source.getZ(), x, y, z) > 14;
|
||||||
+ this.pos.set(x, y, z);
|
+ this.pos.set(x, y, z);
|
||||||
+
|
+
|
||||||
+ boolean isRegionLimited = this.collisionGetter instanceof net.minecraft.server.level.WorldGenRegion;
|
+ BlockState blockState;
|
||||||
+ BlockState blockState = isRegionLimited ? Blocks.VOID_AIR.defaultBlockState() : ((!far && this.source instanceof net.minecraft.server.level.ServerPlayer) || (this.source != null && this.source.collisionLoadChunks)
|
+ if (this.collisionGetter instanceof net.minecraft.server.level.WorldGenRegion) {
|
||||||
+ ? this.collisionGetter.getBlockState(this.pos)
|
+ BlockGetter blockGetter = this.getChunk(x, z);
|
||||||
+ : this.collisionGetter.getTypeIfLoaded(this.pos)
|
+ if (blockGetter == null) {
|
||||||
+ );
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ blockState = blockGetter.getBlockState(this.pos);
|
||||||
|
+ } else if ((!far && this.source instanceof net.minecraft.server.level.ServerPlayer) || (this.source != null && this.source.collisionLoadChunks)) {
|
||||||
|
+ blockState = this.collisionGetter.getBlockState(this.pos);
|
||||||
|
+ } else {
|
||||||
|
+ blockState = this.collisionGetter.getTypeIfLoaded(this.pos);
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ if (blockState == null) {
|
+ if (blockState == null) {
|
||||||
+ if (!(this.source instanceof net.minecraft.server.level.ServerPlayer) || this.source.level.paperConfig.preventMovingIntoUnloadedChunks) {
|
+ if (!(this.source instanceof net.minecraft.server.level.ServerPlayer) || this.source.level.paperConfig.preventMovingIntoUnloadedChunks) {
|
||||||
|
Loading…
Reference in New Issue
Block a user