2019-01-15 22:12:19 +01:00
|
|
|
From 6df42e32054107780e490a3e22433d369da2de84 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-01-15 22:12:19 +01:00
|
|
|
index 1ed58f4bba..39d565db1f 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
|
2018-07-24 02:24:44 +02:00
|
|
|
@@ -124,4 +124,10 @@ 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
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean netherVoidTopDamage;
|
|
|
|
+ private void netherVoidTopDamage() {
|
|
|
|
+ netherVoidTopDamage = getBoolean( "nether-ceiling-void-damage", false );
|
|
|
|
+ log("Top of the nether void damage: " + netherVoidTopDamage);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2019-01-15 22:12:19 +01:00
|
|
|
index 22f757756c..d3551ca681 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-01-01 04:15:55 +01:00
|
|
|
@@ -461,9 +461,15 @@ 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
|
|
|
|
+ // Extracted to own function
|
|
|
|
+ /*
|
|
|
|
if (this.locY < -64.0D) {
|
2018-07-15 03:53:17 +02:00
|
|
|
this.aa();
|
2016-06-18 07:25:37 +02:00
|
|
|
}
|
|
|
|
+ */
|
|
|
|
+ this.checkAndDoHeightDamage();
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
if (!this.world.isClientSide) {
|
|
|
|
this.setFlag(0, this.fireTicks > 0);
|
2019-01-01 04:15:55 +01:00
|
|
|
@@ -473,6 +479,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2018-12-17 06:18:06 +01:00
|
|
|
this.world.methodProfiler.exit();
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
|
|
|
|
2018-07-15 03:53:17 +02:00
|
|
|
+ // Paper start
|
2016-06-18 07:25:37 +02:00
|
|
|
+ protected void checkAndDoHeightDamage() {
|
2018-07-15 03:53:17 +02:00
|
|
|
+ if (this.locY < -64.0D || (this.world.paperConfig.netherVoidTopDamage && this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this.locY >= 128.0D)) {
|
2016-06-18 07:25:37 +02:00
|
|
|
+ this.kill();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 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-01-15 22:12:19 +01:00
|
|
|
@@ -540,6 +554,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2016-06-18 07:25:37 +02:00
|
|
|
this.fireTicks = 0;
|
|
|
|
}
|
|
|
|
|
2018-07-15 03:53:17 +02:00
|
|
|
+ protected final void kill() { this.aa(); } // Paper - OBFHELPER
|
|
|
|
protected void aa() {
|
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-01-15 22:12:19 +01:00
|
|
|
index 9000d2d7b2..a8a64d054c 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-01-01 04:15:55 +01:00
|
|
|
@@ -193,9 +193,15 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT
|
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
|
|
|
|
+ /*
|
|
|
|
if (this.locY < -64.0D) {
|
2018-07-15 03:53:17 +02:00
|
|
|
this.aa();
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
2016-06-18 07:25:37 +02:00
|
|
|
+ */
|
|
|
|
+ this.checkAndDoHeightDamage();
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
int i;
|
2016-03-01 00:09:49 +01:00
|
|
|
|
|
|
|
--
|
2019-01-01 04:15:55 +01:00
|
|
|
2.20.1
|
2016-03-01 00:09:49 +01:00
|
|
|
|