2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-02-29 23:09:49 +00:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
|
|
Date: Tue, 1 Mar 2016 23:58:50 -0600
|
|
|
|
Subject: [PATCH] Configurable top of nether void damage
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-11-12 01:48:12 +00:00
|
|
|
index d16ae924bcbe31c964f7fb448757c748e5c4418c..4bba6977a0287837b8927718c040ac61463f0469 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-11-12 01:48:12 +00:00
|
|
|
@@ -134,4 +134,19 @@ public class PaperWorldConfig {
|
2018-07-15 01:53:17 +00:00
|
|
|
if (fallingBlockHeightNerf != 0) log("Falling Block Height Limit set to Y: " + fallingBlockHeightNerf);
|
|
|
|
if (entityTNTHeightNerf != 0) log("TNT Entity Height Limit set to Y: " + entityTNTHeightNerf);
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
+
|
2019-04-05 04:52:02 +00:00
|
|
|
+ public int netherVoidTopDamageHeight;
|
2019-04-05 05:27:37 +00:00
|
|
|
+ public boolean doNetherTopVoidDamage() { return netherVoidTopDamageHeight > 0; }
|
2019-04-05 04:52:02 +00:00
|
|
|
+ private void netherVoidTopDamageHeight() {
|
2019-04-05 05:27:37 +00:00
|
|
|
+ netherVoidTopDamageHeight = getInt("nether-ceiling-void-damage-height", 0);
|
2019-04-05 04:52:02 +00:00
|
|
|
+ log("Top of the nether void damage height: " + netherVoidTopDamageHeight);
|
|
|
|
+
|
|
|
|
+ if (PaperConfig.version < 18) {
|
|
|
|
+ boolean legacy = getBoolean("nether-ceiling-void-damage", false);
|
|
|
|
+ if (legacy) {
|
|
|
|
+ netherVoidTopDamageHeight = 128;
|
|
|
|
+ set("nether-ceiling-void-damage-height", netherVoidTopDamageHeight);
|
|
|
|
+ }
|
|
|
|
+ }
|
2016-02-29 23:09:49 +00:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2021-02-16 17:08:29 +00:00
|
|
|
index c6b91de58c0190aca0455aacc04994f8ea5d81b7..d3e7a49a4161d68733cfba8d9ffd1cd9821ab2e3 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2020-09-19 11:29:53 +00:00
|
|
|
@@ -415,9 +415,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2016-06-18 05:25:37 +00:00
|
|
|
this.fallDistance *= 0.5F;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start - Configurable nether ceiling damage
|
2019-12-11 00:56:03 +00:00
|
|
|
+
|
2016-06-18 05:25:37 +00:00
|
|
|
+ // Extracted to own function
|
|
|
|
+ /*
|
2019-12-11 00:56:03 +00:00
|
|
|
if (this.locY() < -64.0D) {
|
2020-11-03 02:22:15 +00:00
|
|
|
this.an();
|
2016-06-18 05:25:37 +00:00
|
|
|
}
|
|
|
|
+ */
|
2019-04-05 04:52:02 +00:00
|
|
|
+ this.performVoidDamage();
|
2016-06-18 05:25:37 +00:00
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
if (!this.world.isClientSide) {
|
|
|
|
this.setFlag(0, this.fireTicks > 0);
|
2020-11-03 02:22:15 +00:00
|
|
|
@@ -510,6 +517,17 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-08-25 02:22:08 +00:00
|
|
|
this.setFireTicks(0);
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
|
2018-07-15 01:53:17 +00:00
|
|
|
+ // Paper start
|
2019-04-05 04:52:02 +00:00
|
|
|
+ protected void performVoidDamage() {
|
2020-06-25 09:27:25 +00:00
|
|
|
+ if (this.locY() < -64.0D || (this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
|
2019-04-05 05:27:37 +00:00
|
|
|
+ && world.paperConfig.doNetherTopVoidDamage()
|
2020-06-25 09:27:25 +00:00
|
|
|
+ && this.locY() >= world.paperConfig.netherVoidTopDamageHeight)) {
|
2019-04-05 04:52:02 +00:00
|
|
|
+ this.doVoidDamage();
|
2016-06-18 05:25:37 +00:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2020-11-03 02:22:15 +00:00
|
|
|
+
|
|
|
|
+ protected final void doVoidDamage() { this.an(); } // Paper - OBFHELPER
|
|
|
|
protected void an() {
|
2016-06-18 05:25:37 +00:00
|
|
|
this.die();
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
2020-11-03 02:22:15 +00:00
|
|
|
index dcd381069c2fd4d037ae0bcf710b9ff6ee30bb8f..35b5d41084b47de6a1185e23970ebe21875668d6 100644
|
2016-06-18 05:25:37 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
2020-08-25 02:22:08 +00:00
|
|
|
@@ -292,9 +292,15 @@ public abstract class EntityMinecartAbstract extends Entity {
|
2016-06-18 05:25:37 +00:00
|
|
|
this.setDamage(this.getDamage() - 1.0F);
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
|
2016-06-18 05:25:37 +00:00
|
|
|
+ // Paper start - Configurable nether ceiling damage
|
|
|
|
+ // Extracted to own function
|
|
|
|
+ /*
|
2019-12-11 00:56:03 +00:00
|
|
|
if (this.locY() < -64.0D) {
|
2020-11-03 02:22:15 +00:00
|
|
|
this.an();
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
2016-06-18 05:25:37 +00:00
|
|
|
+ */
|
2019-04-05 04:52:02 +00:00
|
|
|
+ this.performVoidDamage();
|
2016-06-18 05:25:37 +00:00
|
|
|
+ // Paper end
|
|
|
|
|
2019-04-24 02:34:11 +00:00
|
|
|
// this.doPortalTick(); // CraftBukkit - handled in postTick
|
|
|
|
if (this.world.isClientSide) {
|