geforkt von Mirrors/Paper
48 Zeilen
2.5 KiB
Diff
48 Zeilen
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 6dec1bb96d695f28aae6517e4d78249169d2351a..1b090f2e38a8857ef74403e1f3db8c2ba7127297 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -180,4 +180,19 @@ public class PaperWorldConfig {
|
|
if (fallingBlockHeightNerf != 0) log("Falling Block Height Limit set to Y: " + fallingBlockHeightNerf);
|
|
if (entityTNTHeightNerf != 0) log("TNT Entity Height Limit set to Y: " + entityTNTHeightNerf);
|
|
}
|
|
+
|
|
+ public int netherVoidTopDamageHeight;
|
|
+ public boolean doNetherTopVoidDamage() { return netherVoidTopDamageHeight > 0; }
|
|
+ private void netherVoidTopDamageHeight() {
|
|
+ netherVoidTopDamageHeight = getInt("nether-ceiling-void-damage-height", 0);
|
|
+ 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);
|
|
+ }
|
|
+ }
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 4e835004679b3f5ae0fc7103566b613a6766aefe..6cd4fecf8b6e49027cf8a523fb373db9a2708ed4 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -644,7 +644,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
|
}
|
|
|
|
public void checkOutOfWorld() {
|
|
- if (this.getY() < (double) (this.level.getMinBuildHeight() - 64)) {
|
|
+ // Paper start - Configurable nether ceiling damage
|
|
+ if (this.getY() < (double) (this.level.getMinBuildHeight() - 64) || (this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
|
|
+ && level.paperConfig.doNetherTopVoidDamage()
|
|
+ && this.getY() >= this.level.paperConfig.netherVoidTopDamageHeight)) {
|
|
+ // Paper end
|
|
this.outOfWorld();
|
|
}
|
|
|