diff --git a/src/minecraft/net/machinemuse/powersuits/common/ModCompatability.java b/src/minecraft/net/machinemuse/powersuits/common/ModCompatability.java index 7632a93..140bb63 100644 --- a/src/minecraft/net/machinemuse/powersuits/common/ModCompatability.java +++ b/src/minecraft/net/machinemuse/powersuits/common/ModCompatability.java @@ -12,6 +12,7 @@ import net.machinemuse.powersuits.powermodule.misc.ThaumGogglesModule; import net.machinemuse.powersuits.powermodule.tool.GrafterModule; import net.machinemuse.powersuits.powermodule.tool.MFFSFieldTeleporterModule; import net.machinemuse.powersuits.powermodule.tool.MultimeterModule; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; @@ -202,4 +203,15 @@ public class ModCompatability { MuseLogger.logError("Failed to get Forestry item " + name); return null; } + + public static ItemStack getMFFSItem(String name, int quantity) { + try { + Object obj = Class.forName("mods.mffs.common.ModularForceFieldSystem").getField("MFFSitemFieldTeleporter").get(null); + ItemStack stack = new ItemStack((Item) obj, quantity); + return stack; + } catch (Exception e) { + } + MuseLogger.logError("Failed to get MFFS item " + name); + return null; + } } diff --git a/src/minecraft/net/machinemuse/powersuits/item/ItemPowerGauntlet.java b/src/minecraft/net/machinemuse/powersuits/item/ItemPowerGauntlet.java index 37c0411..b278b7a 100644 --- a/src/minecraft/net/machinemuse/powersuits/item/ItemPowerGauntlet.java +++ b/src/minecraft/net/machinemuse/powersuits/item/ItemPowerGauntlet.java @@ -315,7 +315,6 @@ public class ItemPowerGauntlet extends ItemElectricTool player.swingItem(); } - // Grafter Module @Override public float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z) { @@ -337,7 +336,7 @@ public class ItemPowerGauntlet extends ItemElectricTool return true; } else if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - player.sendChatToPlayer("[MFFS2] Could not teleport through forcefield. 10,000J is required to teleport."); + player.sendChatToPlayer("[Field Security] Could not teleport through forcefield. 10,000J is required to teleport."); } } return false; diff --git a/src/minecraft/net/machinemuse/powersuits/powermodule/tool/MFFSFieldTeleporterModule.java b/src/minecraft/net/machinemuse/powersuits/powermodule/tool/MFFSFieldTeleporterModule.java index d62db55..7e3f419 100644 --- a/src/minecraft/net/machinemuse/powersuits/powermodule/tool/MFFSFieldTeleporterModule.java +++ b/src/minecraft/net/machinemuse/powersuits/powermodule/tool/MFFSFieldTeleporterModule.java @@ -1,6 +1,7 @@ package net.machinemuse.powersuits.powermodule.tool; import net.machinemuse.api.IModularItem; +import net.machinemuse.powersuits.common.ModCompatability; import net.machinemuse.powersuits.powermodule.PowerModuleBase; import net.machinemuse.utils.MuseCommonStrings; @@ -17,6 +18,7 @@ public class MFFSFieldTeleporterModule extends PowerModuleBase { public MFFSFieldTeleporterModule(List validItems) { super(validItems); addBaseProperty(FIELD_TELEPORTER_ENERGY_CONSUMPTION, 10000, "J"); + addInstallCost(ModCompatability.getMFFSItem("MFFSitemFieldTeleporter", 1)); } @Override diff --git a/src/minecraft/net/machinemuse/powersuits/powermodule/tool/OmniWrenchModule.java b/src/minecraft/net/machinemuse/powersuits/powermodule/tool/OmniWrenchModule.java index 88ed924..0b3a0b8 100644 --- a/src/minecraft/net/machinemuse/powersuits/powermodule/tool/OmniWrenchModule.java +++ b/src/minecraft/net/machinemuse/powersuits/powermodule/tool/OmniWrenchModule.java @@ -7,6 +7,7 @@ import cpw.mods.fml.relauncher.Side; import ic2.api.energy.tile.IEnergySink; import ic2.api.energy.tile.IEnergySource; import ic2.api.tile.IWrenchable; +import mods.mffs.api.IMFFS_Wrench; import net.machinemuse.api.IModularItem; import net.machinemuse.api.moduletrigger.IRightClickModule; import net.machinemuse.powersuits.item.ItemComponent; @@ -30,12 +31,10 @@ import java.util.List; */ public class OmniWrenchModule extends PowerModuleBase implements IRightClickModule { public static final String MODULE_OMNI_WRENCH = "Prototype OmniWrench"; - public static final String OMNI_WRENCH_ENERGY_CONSUMPTION = "OmniWrench Energy Consumption"; public static final int[] SIDE_OPPOSITE = {1, 0, 3, 2, 5, 4}; public OmniWrenchModule(List validItems) { super(validItems); - addBaseProperty(OMNI_WRENCH_ENERGY_CONSUMPTION, 100); addInstallCost(MuseItemUtils.copyAndResize(ItemComponent.controlCircuit, 1)); addInstallCost(MuseItemUtils.copyAndResize(ItemComponent.servoMotor, 2)); } @@ -100,6 +99,11 @@ public class OmniWrenchModule extends PowerModuleBase implements IRightClickModu if (player.isSneaking()) { side = OmniWrenchModule.SIDE_OPPOSITE[side]; } + + if (((tile instanceof IMFFS_Wrench)) && (!((IMFFS_Wrench)tile).wrenchCanManipulate(player, side))) { + return false; + } + if ((side == wrenchTile.getFacing()) && (wrenchTile.wrenchCanRemove(player))) { ItemStack dropBlock = wrenchTile.getWrenchDrop(player);