From 40304ed2f583e6d6a99a0115056d2135b510602d Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 31 May 2017 18:09:30 +0200 Subject: [PATCH] Catch login armor crash --- build.properties | 2 +- .../java/gregtech/common/items/armor/ModularArmor_Item.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.properties b/build.properties index ba078cec..f4dcfcfa 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.7.10 forge.version=10.13.4.1566-1.7.10 -gt.version=5.09.29 +gt.version=5.09.30pre1 ae2.version=rv2-beta-33 applecore.version=1.7.10-1.2.1+107.59407 diff --git a/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java b/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java index d2e51e67..ef961b94 100644 --- a/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java +++ b/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java @@ -89,6 +89,7 @@ public class ModularArmor_Item extends ItemArmor implements ISpecialArmor, IGogg data = fillArmorData((EntityPlayer) player, armor); } if (player != null && armor != null && source != null) { + try{ double tmp = 0.0d; if (source.isMagicDamage()) { tmp = data.mStat.get(StatType.MAGICDEFENCE); @@ -127,6 +128,9 @@ public class ModularArmor_Item extends ItemArmor implements ISpecialArmor, IGogg tmp = 1.0f - ((1.0f - tmp) / 2.0f); } return new ISpecialArmor.ArmorProperties(0, data.getBaseAbsorptionRatio() * tmp, 1000); + }catch(Exception e){System.err.println(e); + return new ISpecialArmor.ArmorProperties(0, 0, 0); + } } else { return new ISpecialArmor.ArmorProperties(0, 0, 0);