Tweak MFFSFieldTeleporter and OmniWrench modules.

This commit is contained in:
Andrew2448 2013-04-25 20:20:44 -04:00
parent b725e8f279
commit fb8af398ac
4 changed files with 21 additions and 4 deletions

View file

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

View file

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

View file

@ -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<IModularItem> validItems) {
super(validItems);
addBaseProperty(FIELD_TELEPORTER_ENERGY_CONSUMPTION, 10000, "J");
addInstallCost(ModCompatability.getMFFSItem("MFFSitemFieldTeleporter", 1));
}
@Override

View file

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