2018-07-24 02:31:33 +02:00
|
|
|
From 449eb3fe46c8082e18636765fd22ab8a9be1b4ca 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
|
2018-07-04 09:55:24 +02:00
|
|
|
index d3484489b..bf7af475c 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-01-11 06:31:19 +01:00
|
|
|
@@ -129,4 +129,10 @@ public class PaperWorldConfig {
|
2016-03-01 00:09:49 +01:00
|
|
|
waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5);
|
|
|
|
log("Water over lava flow speed: " + waterOverLavaFlowSpeed);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ 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
|
2018-07-24 02:31:33 +02:00
|
|
|
index 011cf59c0..296bdfba5 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
|
2018-07-04 09:55:24 +02:00
|
|
|
@@ -450,9 +450,15 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper
|
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) {
|
2017-05-14 20:05:01 +02:00
|
|
|
this.ac();
|
2016-06-18 07:25:37 +02:00
|
|
|
}
|
|
|
|
+ */
|
|
|
|
+ this.checkAndDoHeightDamage();
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
if (!this.world.isClientSide) {
|
|
|
|
this.setFlag(0, this.fireTicks > 0);
|
2018-07-04 09:55:24 +02:00
|
|
|
@@ -462,6 +468,18 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper
|
2016-06-18 07:25:37 +02:00
|
|
|
this.world.methodProfiler.b();
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
|
|
|
|
2016-06-18 07:25:37 +02:00
|
|
|
+ // Paper start - Configurable top of nether void damage
|
2016-03-01 00:09:49 +01:00
|
|
|
+ private boolean paperNetherCheck() {
|
|
|
|
+ return 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
|
|
|
+ protected void checkAndDoHeightDamage() {
|
|
|
|
+ if (this.locY < -64.0D || paperNetherCheck()) {
|
|
|
|
+ this.kill();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
2017-05-14 20:05:01 +02:00
|
|
|
protected void I() {
|
2016-06-18 07:25:37 +02:00
|
|
|
if (this.portalCooldown > 0) {
|
|
|
|
--this.portalCooldown;
|
2018-07-04 09:55:24 +02:00
|
|
|
@@ -518,6 +536,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper
|
2016-06-18 07:25:37 +02:00
|
|
|
this.fireTicks = 0;
|
|
|
|
}
|
|
|
|
|
2017-05-14 20:05:01 +02:00
|
|
|
+ protected final void kill() { this.ac(); } // Paper - OBFHELPER
|
|
|
|
protected void ac() {
|
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
|
2018-07-04 09:55:24 +02:00
|
|
|
index a9412d4e0..1f4025486 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
|
2017-03-15 15:32:50 +01:00
|
|
|
@@ -204,9 +204,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) {
|
2017-05-14 20:05:01 +02:00
|
|
|
this.ac();
|
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
|
|
|
|
|
|
|
--
|
2018-07-04 09:55:24 +02:00
|
|
|
2.18.0
|
2016-03-01 00:09:49 +01:00
|
|
|
|