From 48d7a1ee5dc9919a36c7b0bad7cfe50364d35267 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 8 Mar 2017 17:52:28 +0100 Subject: [PATCH] Fix rubber plates in modular armor boots --- build.properties | 2 +- .../common/items/armor/components/ArmorPlating.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index 9ea7e57b..282f4ef0 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.28 +gt.version=5.09.29pre 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/components/ArmorPlating.java b/src/main/java/gregtech/common/items/armor/components/ArmorPlating.java index 9f87678e..2e02ac7b 100644 --- a/src/main/java/gregtech/common/items/armor/components/ArmorPlating.java +++ b/src/main/java/gregtech/common/items/armor/components/ArmorPlating.java @@ -78,7 +78,7 @@ public class ArmorPlating extends ArmorComponent{ @Override public void calculateArmor(ArmorData aArmorData) { - calDef(StatType.FALLDEFENCE, aArmorData); + calDefAdd(StatType.FALLDEFENCE, aArmorData); calDef(StatType.PHYSICALDEFENCE, aArmorData); calDef(StatType.PROJECTILEDEFENCE, aArmorData); calDef(StatType.FIREDEFENCE, aArmorData); @@ -99,5 +99,14 @@ public class ArmorPlating extends ArmorComponent{ float tComponentDef = mStat.get(aType); aArmorData.mStat.put(aType, tArmorDef + ((1.0f -tArmorDef) * tComponentDef)); } + + public void calDefAdd(StatType aType, ArmorData aArmorData){ + float tArmorDef = 0.0f; + if(aArmorData.mStat.containsKey(aType)){ + tArmorDef = aArmorData.mStat.get(aType); + aArmorData.mStat.remove(aType);} + float tComponentDef = mStat.get(aType); + aArmorData.mStat.put(aType, tArmorDef + tComponentDef); + } }