Prevent player from dying infinitely due to zero max health (MC-119183)

This commit is contained in:
mezz 2017-07-20 21:54:46 -07:00
parent a6b9fbfa9f
commit 32dc726df1

View file

@ -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);