From f20fac307555df87ba84cb05a674c1c984f7958c Mon Sep 17 00:00:00 2001 From: MachineMuse Date: Fri, 28 Aug 2015 04:04:00 -0600 Subject: [PATCH] add IC2 hazmat capability. closes #501 --- .../powersuits/common/ModCompatability.java | 11 ++--------- .../machinemuse/powersuits/item/ItemPowerArmor.scala | 11 +++++++++-- .../powersuits/powermodule/armor/HazmatModule.java | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/scala/net/machinemuse/powersuits/common/ModCompatability.java b/src/main/scala/net/machinemuse/powersuits/common/ModCompatability.java index 3e5ed2a..0381e97 100644 --- a/src/main/scala/net/machinemuse/powersuits/common/ModCompatability.java +++ b/src/main/scala/net/machinemuse/powersuits/common/ModCompatability.java @@ -9,7 +9,6 @@ import net.machinemuse.powersuits.powermodule.armor.HazmatModule; import net.machinemuse.powersuits.powermodule.misc.AirtightSealModule; import net.machinemuse.powersuits.powermodule.misc.ThaumGogglesModule; import net.machinemuse.powersuits.powermodule.tool.GrafterModule; -import net.machinemuse.powersuits.powermodule.tool.MFFSFieldTeleporterModule; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.config.Configuration; @@ -152,7 +151,7 @@ public class ModCompatability { //IPowerModule module = new MultimeterModule(Collections.singletonList((IModularItem) MPSItems.powerTool())); // Atomic Science - if (isAtomicScienceLoaded()) { + if (isIndustrialCraftLoaded()) { ModuleManager.addModule(new HazmatModule(Arrays.asList(MPSItems.powerArmorHead(), MPSItems.powerArmorTorso(), MPSItems.powerArmorLegs(), MPSItems.powerArmorFeet()))); } @@ -166,14 +165,8 @@ public class ModCompatability { ModuleManager.addModule(new GrafterModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); ModuleManager.addModule(new ApiaristArmorModule(Arrays.asList(MPSItems.powerArmorHead(), MPSItems.powerArmorTorso(), MPSItems.powerArmorLegs(), MPSItems.powerArmorFeet()))); } - - try { - ModuleManager.addModule(new MFFSFieldTeleporterModule(Collections.singletonList((IModularItem) MPSItems.powerTool()))); - } catch (Throwable e) { - MuseLogger.logError("Failed to get MFFS item!"); - } } - +// // // public static ItemStack getForestryItem(String name, int quantity) { // try { diff --git a/src/main/scala/net/machinemuse/powersuits/item/ItemPowerArmor.scala b/src/main/scala/net/machinemuse/powersuits/item/ItemPowerArmor.scala index 6223b88..ba7cfe1 100644 --- a/src/main/scala/net/machinemuse/powersuits/item/ItemPowerArmor.scala +++ b/src/main/scala/net/machinemuse/powersuits/item/ItemPowerArmor.scala @@ -4,7 +4,8 @@ import cpw.mods.fml.relauncher.{Side, SideOnly} import net.machinemuse.api.{IModularItem, ArmorTraits, ModuleManager} import net.machinemuse.numina.geometry.Colour import net.machinemuse.powersuits.client.render.item.ArmorModel -import net.machinemuse.powersuits.common.Config +import net.machinemuse.powersuits.common.{ModCompatability, Config} +import net.machinemuse.powersuits.powermodule.armor.HazmatModule import net.machinemuse.powersuits.powermodule.misc.{InvisibilityModule, TintModule, TransparentArmorModule} import net.machinemuse.utils._ import net.minecraft.client.model.ModelBiped @@ -33,10 +34,15 @@ abstract class ItemPowerArmor(renderIndex: Int, armorType: Int) * calculations. */ override def getProperties(player: EntityLivingBase, armor: ItemStack, source: DamageSource, damage: Double, slot: Int): ISpecialArmor.ArmorProperties = { - val priority: Int = 1 + val priority: Int = 0 if (source.isFireDamage && !(source == MuseHeatUtils.overheatDamage)) { return new ISpecialArmor.ArmorProperties(priority, 0.25, (25 * damage).toInt) } + if(ModuleManager.itemHasModule(armor, HazmatModule.MODULE_HAZMAT)) { + if(source.damageType.equals("electricity") || source.damageType.equals("radiation")) { + return new ISpecialArmor.ArmorProperties(priority, 0.25, (25 * damage).toInt) + } + } val armorDouble = player match { case player: EntityPlayer => getArmorDouble(player, armor) case _ => 2.0 @@ -47,6 +53,7 @@ abstract class ItemPowerArmor(renderIndex: Int, armorType: Int) absorbMax = 0 absorbRatio = 0 } + return new ISpecialArmor.ArmorProperties(priority, absorbRatio, absorbMax) } diff --git a/src/main/scala/net/machinemuse/powersuits/powermodule/armor/HazmatModule.java b/src/main/scala/net/machinemuse/powersuits/powermodule/armor/HazmatModule.java index 220ee09..32429d3 100644 --- a/src/main/scala/net/machinemuse/powersuits/powermodule/armor/HazmatModule.java +++ b/src/main/scala/net/machinemuse/powersuits/powermodule/armor/HazmatModule.java @@ -34,7 +34,7 @@ public class HazmatModule extends PowerModuleBase { @Override public String getDescription() { - return "Protect yourself from that pesky radiation poisoning. *Must be on every piece*"; + return "Protect yourself from electricity and radiation poisoning. *Must be on every piece for 100% protection*"; } @Override