diff options
Diffstat (limited to 'Spigot-Server-Patches/0080-Set-health-before-death-event.patch')
-rw-r--r-- | Spigot-Server-Patches/0080-Set-health-before-death-event.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0080-Set-health-before-death-event.patch b/Spigot-Server-Patches/0080-Set-health-before-death-event.patch new file mode 100644 index 0000000000..295892b195 --- /dev/null +++ b/Spigot-Server-Patches/0080-Set-health-before-death-event.patch @@ -0,0 +1,49 @@ +From 376c4082cf93f2688de0d051a121f20b5c8ba326 Mon Sep 17 00:00:00 2001 +From: Jedediah Smith <[email protected]> +Date: Sun, 19 Jul 2015 16:51:38 -0400 +Subject: [PATCH] Set health before death event + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index b5ff26c71..6907d4680 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -215,4 +215,9 @@ public class PaperConfig { + private static void loadPermsBeforePlugins() { + loadPermsBeforePlugins = getBoolean("settings.load-permissions-yml-before-plugins", true); + } ++ ++ public static boolean setHealthBeforeDeathEvent = false; ++ private static void healthDeath() { ++ setHealthBeforeDeathEvent = getBoolean("settings.set-health-before-death-event", false); ++ } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +index 348a8c758..c0103cb39 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +@@ -102,11 +102,20 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + + (this instanceof CraftPlayer ? ", player: " + this.getName() + ')' : ')')); + } + ++ // Paper start ++ if (com.destroystokyo.paper.PaperConfig.setHealthBeforeDeathEvent) { ++ this.getHandle().setHealth((float) health); ++ } ++ + if (health == 0) { + getHandle().die(DamageSource.GENERIC); + } + +- getHandle().setHealth((float) health); ++ // Paper start - wrap, see above ++ if (!com.destroystokyo.paper.PaperConfig.setHealthBeforeDeathEvent) { ++ getHandle().setHealth((float) health); ++ } ++ // Paper end + } + + public double getMaxHealth() { +-- +2.12.2 + |