geforkt von Mirrors/Paper
Account for dimension type in portal void damage check (#9602)
Dieser Commit ist enthalten in:
Ursprung
b5f844b362
Commit
224e38a0f6
@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
return holder.is(PoiTypes.NETHER_PORTAL);
|
return holder.is(PoiTypes.NETHER_PORTAL);
|
||||||
}, blockposition, i, PoiManager.Occupancy.ANY).filter((villageplacerecord) -> {
|
}, blockposition, i, PoiManager.Occupancy.ANY).filter((villageplacerecord) -> {
|
||||||
- return worldborder.isWithinBounds(villageplacerecord.getPos());
|
- return worldborder.isWithinBounds(villageplacerecord.getPos());
|
||||||
+ return worldborder.isWithinBounds(villageplacerecord.getPos()) && !this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v); // Paper - don't teleport into void damage
|
+ return worldborder.isWithinBounds(villageplacerecord.getPos()) && !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v)); // Paper - don't teleport into void damage
|
||||||
}).sorted(Comparator.comparingDouble((PoiRecord villageplacerecord) -> { // CraftBukkit - decompile error
|
}).sorted(Comparator.comparingDouble((PoiRecord villageplacerecord) -> { // CraftBukkit - decompile error
|
||||||
return villageplacerecord.getPos().distSqr(blockposition);
|
return villageplacerecord.getPos().distSqr(blockposition);
|
||||||
}).thenComparingInt((villageplacerecord) -> {
|
}).thenComparingInt((villageplacerecord) -> {
|
||||||
@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
WorldBorder worldborder = this.level.getWorldBorder();
|
WorldBorder worldborder = this.level.getWorldBorder();
|
||||||
int i = Math.min(this.level.getMaxBuildHeight(), this.level.getMinBuildHeight() + this.level.getLogicalHeight()) - 1;
|
int i = Math.min(this.level.getMaxBuildHeight(), this.level.getMinBuildHeight() + this.level.getLogicalHeight()) - 1;
|
||||||
+ // Paper start - if ceiling void damage is enabled, make sure the max height doesn't exceed the void damage height
|
+ // Paper start - if ceiling void damage is enabled, make sure the max height doesn't exceed the void damage height
|
||||||
+ if (this.level.paperConfig().environment.netherCeilingVoidDamageHeight.enabled()) {
|
+ if (this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.enabled()) {
|
||||||
+ i = Math.min(i, this.level.paperConfig().environment.netherCeilingVoidDamageHeight.intValue() - 1);
|
+ i = Math.min(i, this.level.paperConfig().environment.netherCeilingVoidDamageHeight.intValue() - 1);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
@ -1007,7 +1007,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- Optional<PoiRecord> optional = villageplace.getInSquare((holder) -> {
|
- Optional<PoiRecord> optional = villageplace.getInSquare((holder) -> {
|
||||||
- return holder.is(PoiTypes.NETHER_PORTAL);
|
- return holder.is(PoiTypes.NETHER_PORTAL);
|
||||||
- }, blockposition, i, PoiManager.Occupancy.ANY).filter((villageplacerecord) -> {
|
- }, blockposition, i, PoiManager.Occupancy.ANY).filter((villageplacerecord) -> {
|
||||||
- return worldborder.isWithinBounds(villageplacerecord.getPos()) && !this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v); // Paper - don't teleport into void damage
|
- return worldborder.isWithinBounds(villageplacerecord.getPos()) && !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v)); // Paper - don't teleport into void damage
|
||||||
- }).sorted(Comparator.comparingDouble((PoiRecord villageplacerecord) -> { // CraftBukkit - decompile error
|
- }).sorted(Comparator.comparingDouble((PoiRecord villageplacerecord) -> { // CraftBukkit - decompile error
|
||||||
- return villageplacerecord.getPos().distSqr(blockposition);
|
- return villageplacerecord.getPos().distSqr(blockposition);
|
||||||
- }).thenComparingInt((villageplacerecord) -> {
|
- }).thenComparingInt((villageplacerecord) -> {
|
||||||
@ -1028,7 +1028,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // why would we generate the chunk?
|
+ // why would we generate the chunk?
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ if (!worldborder.isWithinBounds(pos) || this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> pos.getY() >= v)) { // Paper - don't teleport into void damage
|
+ if (!worldborder.isWithinBounds(pos) || (this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> pos.getY() >= v))) { // Paper - don't teleport into void damage
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ return lowest.getBlockState(pos).hasProperty(BlockStateProperties.HORIZONTAL_AXIS);
|
+ return lowest.getBlockState(pos).hasProperty(BlockStateProperties.HORIZONTAL_AXIS);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren