aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0039-Configurable-top-of-nether-void-damage.patch
diff options
context:
space:
mode:
authorRiley Park <[email protected]>2024-05-15 17:06:59 -0700
committerGitHub <[email protected]>2024-05-15 17:06:59 -0700
commitf17519338bc589c045e0b32bfc37e048b23544d5 (patch)
treee50182ec698b4a9de8f366f485ee089b1901bbd9 /patches/server/0039-Configurable-top-of-nether-void-damage.patch
parent3fc93581bb876e8149b2ca423375a98f5ca12d27 (diff)
downloadPaper-f17519338bc589c045e0b32bfc37e048b23544d5.tar.gz
Paper-f17519338bc589c045e0b32bfc37e048b23544d5.zip
Expose server build information (#10729)
* Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic <[email protected]> Co-authored-by: masmc05 <[email protected]>
Diffstat (limited to 'patches/server/0039-Configurable-top-of-nether-void-damage.patch')
-rw-r--r--patches/server/0039-Configurable-top-of-nether-void-damage.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/patches/server/0039-Configurable-top-of-nether-void-damage.patch b/patches/server/0039-Configurable-top-of-nether-void-damage.patch
new file mode 100644
index 0000000000..78fb2dce6b
--- /dev/null
+++ b/patches/server/0039-Configurable-top-of-nether-void-damage.patch
@@ -0,0 +1,49 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zach Brown <[email protected]>
+Date: Tue, 1 Mar 2016 23:58:50 -0600
+Subject: [PATCH] Configurable top of nether void damage
+
+Co-authored-by: Jake Potrebic <[email protected]>
+
+diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
+index 35ec3d6557a02a29df15c7302c1007f335c3db65..795ac5f58469f10ce35fff55bbc4fa5f395eea2a 100644
+--- a/src/main/java/net/minecraft/world/entity/Entity.java
++++ b/src/main/java/net/minecraft/world/entity/Entity.java
+@@ -696,7 +696,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ }
+
+ public void checkBelowWorld() {
+- if (this.getY() < (double) (this.level().getMinBuildHeight() - 64)) {
++ // Paper start - Configurable nether ceiling damage
++ if (this.getY() < (double) (this.level.getMinBuildHeight() - 64) || (this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
++ && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
++ && (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
++ // Paper end - Configurable nether ceiling damage
+ this.onBelowWorld();
+ }
+
+diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
+index 6987e3e7590a6ddf93622ba5d280db6f4e98310d..f4c8eee7bc574d402a7897a202734047e37c7a67 100644
+--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
++++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
+@@ -55,7 +55,7 @@ public class PortalForcer {
+ Optional<PoiRecord> optional = villageplace.getInSquare((holder) -> {
+ 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.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v)); // Paper - Configurable nether ceiling damage
+ }).sorted(Comparator.comparingDouble((PoiRecord villageplacerecord) -> { // CraftBukkit - decompile error
+ return villageplacerecord.getPos().distSqr(blockposition);
+ }).thenComparingInt((villageplacerecord) -> {
+@@ -90,6 +90,11 @@ public class PortalForcer {
+ BlockPos blockposition2 = null;
+ WorldBorder worldborder = this.level.getWorldBorder();
+ int i = Math.min(this.level.getMaxBuildHeight(), this.level.getMinBuildHeight() + this.level.getLogicalHeight()) - 1;
++ // Paper start - Configurable nether ceiling damage; make sure the max height doesn't exceed the void damage height
++ 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 - Configurable nether ceiling damage
+ BlockPos.MutableBlockPos blockposition_mutableblockposition = blockposition.mutable();
+ Iterator iterator = BlockPos.spiralAround(blockposition, createRadius, Direction.EAST, Direction.SOUTH).iterator(); // CraftBukkit
+