2019-12-11 01:56:03 +01:00
|
|
|
From b72bf1ab0143c458b17f8fe333df6f52c7d1c8af Mon Sep 17 00:00:00 2001
|
2016-03-01 00:09:49 +01: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
|
2019-12-11 01:56:03 +01:00
|
|
|
index d59b82b7b..f7a0a33e4 100644
|
2016-03-01 00:09:49 +01:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2019-10-27 00:55:58 +02:00
|
|
|
@@ -129,4 +129,19 @@ public class PaperWorldConfig {
|
2018-07-15 03:53:17 +02: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-03-01 00:09:49 +01:00
|
|
|
}
|
|
|
|
+
|
2019-04-05 06:52:02 +02:00
|
|
|
+ public int netherVoidTopDamageHeight;
|
2019-04-05 07:27:37 +02:00
|
|
|
+ public boolean doNetherTopVoidDamage() { return netherVoidTopDamageHeight > 0; }
|
2019-04-05 06:52:02 +02:00
|
|
|
+ private void netherVoidTopDamageHeight() {
|
2019-04-05 07:27:37 +02:00
|
|
|
+ netherVoidTopDamageHeight = getInt("nether-ceiling-void-damage-height", 0);
|
2019-04-05 06:52:02 +02: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-03-01 00:09:49 +01:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2019-12-11 01:56:03 +01:00
|
|
|
index 29e6b88d2..2aea9ba50 100644
|
2016-03-01 00:09:49 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2019-12-11 01:56:03 +01:00
|
|
|
@@ -407,9 +407,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2016-06-18 07:25:37 +02:00
|
|
|
this.fallDistance *= 0.5F;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start - Configurable nether ceiling damage
|
2019-12-11 01:56:03 +01:00
|
|
|
+
|
2016-06-18 07:25:37 +02:00
|
|
|
+ // Extracted to own function
|
|
|
|
+ /*
|
2019-12-11 01:56:03 +01:00
|
|
|
if (this.locY() < -64.0D) {
|
2019-06-25 03:47:58 +02:00
|
|
|
this.af();
|
2016-06-18 07:25:37 +02:00
|
|
|
}
|
|
|
|
+ */
|
2019-04-05 06:52:02 +02:00
|
|
|
+ this.performVoidDamage();
|
2016-06-18 07:25:37 +02:00
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
if (!this.world.isClientSide) {
|
|
|
|
this.setFlag(0, this.fireTicks > 0);
|
2019-12-11 01:56:03 +01:00
|
|
|
@@ -419,6 +426,17 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2019-04-24 04:34:11 +02:00
|
|
|
this.world.getMethodProfiler().exit();
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
|
|
|
|
2018-07-15 03:53:17 +02:00
|
|
|
+ // Paper start
|
2019-04-05 06:52:02 +02:00
|
|
|
+ protected void performVoidDamage() {
|
2019-04-05 07:27:37 +02:00
|
|
|
+ if (this.locY < -64.0D || (this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
|
|
|
|
+ && world.paperConfig.doNetherTopVoidDamage()
|
|
|
|
+ && this.locY >= world.paperConfig.netherVoidTopDamageHeight)) {
|
|
|
|
+
|
2019-04-05 06:52:02 +02:00
|
|
|
+ this.doVoidDamage();
|
2016-06-18 07:25:37 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
2018-07-15 03:53:17 +02:00
|
|
|
protected void E() {
|
2016-06-18 07:25:37 +02:00
|
|
|
if (this.portalCooldown > 0) {
|
|
|
|
--this.portalCooldown;
|
2019-12-11 01:56:03 +01:00
|
|
|
@@ -494,6 +512,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2016-06-18 07:25:37 +02:00
|
|
|
this.fireTicks = 0;
|
|
|
|
}
|
|
|
|
|
2019-06-25 03:47:58 +02:00
|
|
|
+ protected final void doVoidDamage() { this.af(); } // Paper - OBFHELPER
|
|
|
|
protected void af() {
|
2016-06-18 07:25:37 +02:00
|
|
|
this.die();
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
2019-12-11 01:56:03 +01:00
|
|
|
index e7fc442c8..1b64ad824 100644
|
2016-06-18 07:25:37 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
2019-12-11 01:56:03 +01:00
|
|
|
@@ -210,9 +210,15 @@ public abstract class EntityMinecartAbstract extends Entity {
|
2016-06-18 07:25:37 +02:00
|
|
|
this.setDamage(this.getDamage() - 1.0F);
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
|
|
|
|
2016-06-18 07:25:37 +02:00
|
|
|
+ // Paper start - Configurable nether ceiling damage
|
|
|
|
+ // Extracted to own function
|
|
|
|
+ /*
|
2019-12-11 01:56:03 +01:00
|
|
|
if (this.locY() < -64.0D) {
|
2019-06-25 03:47:58 +02:00
|
|
|
this.af();
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
2016-06-18 07:25:37 +02:00
|
|
|
+ */
|
2019-04-05 06:52:02 +02:00
|
|
|
+ this.performVoidDamage();
|
2016-06-18 07:25:37 +02:00
|
|
|
+ // Paper end
|
|
|
|
|
2019-04-24 04:34:11 +02:00
|
|
|
// this.doPortalTick(); // CraftBukkit - handled in postTick
|
|
|
|
if (this.world.isClientSide) {
|
2016-03-01 00:09:49 +01:00
|
|
|
--
|
2019-12-11 01:56:03 +01:00
|
|
|
2.24.0
|
2016-03-01 00:09:49 +01:00
|
|
|
|