From 8029851b4e9bc52efe8927699163e8abb00437d9 Mon Sep 17 00:00:00 2001 From: mezz Date: Thu, 20 Jul 2017 21:54:46 -0700 Subject: [PATCH] Prevent player from dying infinitely due to zero max health (MC-119183) --- .../entity/SharedMonsterAttributes.java.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 patches/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch diff --git a/patches/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch b/patches/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch new file mode 100644 index 0000000000..8ee4d336e8 --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/SharedMonsterAttributes.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/SharedMonsterAttributes.java ++++ ../src-work/minecraft/net/minecraft/entity/SharedMonsterAttributes.java +@@ -16,7 +16,7 @@ + public class SharedMonsterAttributes + { + private static final Logger field_151476_f = LogManager.getLogger(); +- public static final IAttribute field_111267_a = (new RangedAttribute((IAttribute)null, "generic.maxHealth", 20.0D, 0.0D, 1024.0D)).func_111117_a("Max Health").func_111112_a(true); ++ public static final IAttribute field_111267_a = (new RangedAttribute((IAttribute)null, "generic.maxHealth", 20.0D, Float.MIN_VALUE, 1024.0D)).func_111117_a("Max Health").func_111112_a(true); // Forge: set smallest max-health value to fix MC-119183. This gets rounded to float so we use the smallest positive float value. + public static final IAttribute field_111265_b = (new RangedAttribute((IAttribute)null, "generic.followRange", 32.0D, 0.0D, 2048.0D)).func_111117_a("Follow Range"); + public static final IAttribute field_111266_c = (new RangedAttribute((IAttribute)null, "generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).func_111117_a("Knockback Resistance"); + public static final IAttribute field_111263_d = (new RangedAttribute((IAttribute)null, "generic.movementSpeed", 0.699999988079071D, 0.0D, 1024.0D)).func_111117_a("Movement Speed").func_111112_a(true);