diff --git a/patches/server/Configurable-top-of-nether-void-damage.patch b/patches/server/Configurable-top-of-nether-void-damage.patch index 44b1546ed1..879cabf3e5 100644 --- a/patches/server/Configurable-top-of-nether-void-damage.patch +++ b/patches/server/Configurable-top-of-nether-void-damage.patch @@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return holder.is(PoiTypes.NETHER_PORTAL); }, blockposition, i, PoiManager.Occupancy.ANY).filter((villageplacerecord) -> { - 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 return villageplacerecord.getPos().distSqr(blockposition); }).thenComparingInt((villageplacerecord) -> { @@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 WorldBorder worldborder = this.level.getWorldBorder(); 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 -+ 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); + } + // Paper end diff --git a/patches/server/Optimise-general-POI-access.patch b/patches/server/Optimise-general-POI-access.patch index eae8a86808..4b433d66f3 100644 --- a/patches/server/Optimise-general-POI-access.patch +++ b/patches/server/Optimise-general-POI-access.patch @@ -1007,7 +1007,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - Optional optional = villageplace.getInSquare((holder) -> { - return holder.is(PoiTypes.NETHER_PORTAL); - }, 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 - return villageplacerecord.getPos().distSqr(blockposition); - }).thenComparingInt((villageplacerecord) -> { @@ -1028,7 +1028,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // why would we generate the chunk? + 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 lowest.getBlockState(pos).hasProperty(BlockStateProperties.HORIZONTAL_AXIS);