2017-03-25 03:18:58 +00:00
|
|
|
From f39ff351a0d3263158ec312e3cb0a3e0e54283ff 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
|
2017-03-25 03:18:58 +00:00
|
|
|
index 62e6830aa..e524a464f 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
|
2017-03-25 03:18:58 +00:00
|
|
|
@@ -137,4 +137,10 @@ public class PaperWorldConfig {
|
2016-02-29 23:09:49 +00: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
|
2017-03-25 03:18:58 +00:00
|
|
|
index 313100aed..7feed2995 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
|
2017-03-25 03:18:58 +00:00
|
|
|
@@ -442,9 +442,15 @@ public abstract class Entity implements ICommandListener {
|
2016-06-18 05:25:37 +00:00
|
|
|
this.fallDistance *= 0.5F;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start - Configurable nether ceiling damage
|
|
|
|
+ // Extracted to own function
|
|
|
|
+ /*
|
|
|
|
if (this.locY < -64.0D) {
|
|
|
|
this.Y();
|
|
|
|
}
|
|
|
|
+ */
|
|
|
|
+ this.checkAndDoHeightDamage();
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
if (!this.world.isClientSide) {
|
|
|
|
this.setFlag(0, this.fireTicks > 0);
|
2017-03-25 03:18:58 +00:00
|
|
|
@@ -454,6 +460,18 @@ public abstract class Entity implements ICommandListener {
|
2016-06-18 05:25:37 +00:00
|
|
|
this.world.methodProfiler.b();
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
|
2016-06-18 05:25:37 +00:00
|
|
|
+ // Paper start - Configurable top of nether void damage
|
2016-02-29 23:09:49 +00: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 05:25:37 +00:00
|
|
|
+ protected void checkAndDoHeightDamage() {
|
|
|
|
+ if (this.locY < -64.0D || paperNetherCheck()) {
|
|
|
|
+ this.kill();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
protected void H() {
|
|
|
|
if (this.portalCooldown > 0) {
|
|
|
|
--this.portalCooldown;
|
2017-03-25 03:18:58 +00:00
|
|
|
@@ -510,6 +528,7 @@ public abstract class Entity implements ICommandListener {
|
2016-06-18 05:25:37 +00:00
|
|
|
this.fireTicks = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ protected final void kill() { this.Y(); } // Paper - OBFHELPER
|
|
|
|
protected void Y() {
|
|
|
|
this.die();
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
2017-03-25 03:18:58 +00:00
|
|
|
index fd3337d3f..ca1faa41d 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
|
2017-03-15 14:32:50 +00:00
|
|
|
@@ -204,9 +204,15 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT
|
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
|
|
|
|
+ /*
|
|
|
|
if (this.locY < -64.0D) {
|
2016-02-29 23:09:49 +00:00
|
|
|
this.Y();
|
|
|
|
}
|
2016-06-18 05:25:37 +00:00
|
|
|
+ */
|
|
|
|
+ this.checkAndDoHeightDamage();
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
int i;
|
2016-02-29 23:09:49 +00:00
|
|
|
|
|
|
|
--
|
2017-03-15 14:32:50 +00:00
|
|
|
2.12.0.windows.1
|
2016-02-29 23:09:49 +00:00
|
|
|
|