From 71a9bfc4f9be156ffc6430eda483c325a8d0f3b1 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 16 Mar 2015 15:47:18 +0000 Subject: [PATCH] Make the @Optional removals stricter. Require IC2, BC or CoFHCore to be loaded in order to use their respective APIs. Remove all the individual mod deps to prevent us depending on mods that depend on us. --- src/main/java/mekanism/common/Mekanism.java | 4 ++-- .../common/base/IAdvancedBoundingBlock.java | 2 +- .../mekanism/common/base/IEnergyWrapper.java | 2 +- .../common/integration/MekanismHooks.java | 14 ++------------ .../common/item/ItemBlockEnergyCube.java | 18 +++++++++--------- .../mekanism/common/item/ItemBlockMachine.java | 18 +++++++++--------- .../mekanism/common/item/ItemConfigurator.java | 6 +++--- .../mekanism/common/item/ItemEnergized.java | 18 +++++++++--------- .../mekanism/common/item/ItemFreeRunners.java | 18 +++++++++--------- .../multipart/PartLogisticalTransporter.java | 1 - .../common/multipart/PartUniversalCable.java | 12 ++++++------ .../tile/TileEntityAdvancedBoundingBlock.java | 12 ++++++------ .../common/tile/TileEntityBasicBlock.java | 12 ++++++------ .../common/tile/TileEntityElectricBlock.java | 10 +++++----- .../common/tile/TileEntityInductionPort.java | 12 ++++++------ .../java/mekanism/common/util/ChargeUtils.java | 2 +- .../mekanism/common/util/MekanismUtils.java | 12 +----------- .../common/item/ItemBlockGenerator.java | 18 +++++++++--------- 18 files changed, 85 insertions(+), 106 deletions(-) diff --git a/src/main/java/mekanism/common/Mekanism.java b/src/main/java/mekanism/common/Mekanism.java index 820702729..a683dc115 100644 --- a/src/main/java/mekanism/common/Mekanism.java +++ b/src/main/java/mekanism/common/Mekanism.java @@ -135,8 +135,8 @@ import cpw.mods.fml.common.registry.GameRegistry; * */ @Mod(modid = "Mekanism", name = "Mekanism", version = "8.0.0", guiFactory = "mekanism.client.gui.ConfigGuiFactory", - dependencies = "after:ForgeMultipart;after:BuildCraftAPI|power;after:BuildCraftAPI|tools;after:BuildCraftAPI|transport;after:IC2API;after:CoFHAPI|energy;after:ComputerCraft;after:Galacticraft API;" + - "after:MineFactoryReloaded;after:MetallurgyCore;after:EnderIO;after:ExtraUtilities;after:Railcraft;after:Forestry;after:RedstoneArsenal") + dependencies = "after:ForgeMultipart;after:BuildCraft;after:BuildCraftAPI;after:IC2;after:CoFHCore;" + + "after:ComputerCraft;after:Galacticraft API;after:MetallurgyCore") public class Mekanism { /** Mekanism Packet Pipeline */ diff --git a/src/main/java/mekanism/common/base/IAdvancedBoundingBlock.java b/src/main/java/mekanism/common/base/IAdvancedBoundingBlock.java index 73d363022..91ab43f44 100644 --- a/src/main/java/mekanism/common/base/IAdvancedBoundingBlock.java +++ b/src/main/java/mekanism/common/base/IAdvancedBoundingBlock.java @@ -14,7 +14,7 @@ import dan200.computercraft.api.peripheral.IPeripheral; @InterfaceList({ @Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), - @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHAPI|energy"), + @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHCore"), @Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") }) public interface IAdvancedBoundingBlock extends IBoundingBlock, ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IStrictEnergyStorage, IEnergyHandler, IPeripheral, IFilterAccess diff --git a/src/main/java/mekanism/common/base/IEnergyWrapper.java b/src/main/java/mekanism/common/base/IEnergyWrapper.java index 9bbde03fa..aae2cb34a 100644 --- a/src/main/java/mekanism/common/base/IEnergyWrapper.java +++ b/src/main/java/mekanism/common/base/IEnergyWrapper.java @@ -19,7 +19,7 @@ import cpw.mods.fml.common.Optional.InterfaceList; @Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), @Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2"), @Interface(iface = "ic2.api.tile.IEnergyStorage", modid = "IC2"), - @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHAPI|energy"), + @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHCore"), }) public interface IEnergyWrapper extends IStrictEnergyStorage, IEnergyHandler, IEnergySink, IEnergySource, IEnergyStorage, IStrictEnergyAcceptor, ICableOutputter, IInventory { diff --git a/src/main/java/mekanism/common/integration/MekanismHooks.java b/src/main/java/mekanism/common/integration/MekanismHooks.java index 7978be652..ed8d451af 100644 --- a/src/main/java/mekanism/common/integration/MekanismHooks.java +++ b/src/main/java/mekanism/common/integration/MekanismHooks.java @@ -16,7 +16,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModAPIManager; import cpw.mods.fml.common.Optional.Method; import cpw.mods.fml.common.event.FMLInterModComms; @@ -37,10 +36,8 @@ public final class MekanismHooks private Class BuildCraftEnergy; public boolean IC2Loaded = false; - public boolean IC2APILoaded = false; public boolean RailcraftLoaded = false; - public boolean BuildCraftPowerLoaded = false; - public boolean RedstoneFluxLoaded = false; + public boolean CoFHCoreLoaded = false; public boolean TELoaded = false; public boolean CCLoaded = false; @@ -49,9 +46,7 @@ public final class MekanismHooks public void hook() { - if(ModAPIManager.INSTANCE.hasAPI("IC2API")) IC2APILoaded = true; - if(ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|power")) BuildCraftPowerLoaded = true; - if(ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy")) RedstoneFluxLoaded = true; + if(Loader.isModLoaded("CoFHCore")) CoFHCoreLoaded = true; if(Loader.isModLoaded("IC2")) IC2Loaded = true; if(Loader.isModLoaded("Railcraft")) RailcraftLoaded = true; if(Loader.isModLoaded("ThermalExpansion")) TELoaded = true; @@ -70,11 +65,6 @@ public final class MekanismHooks Mekanism.logger.info("Hooked into IC2 successfully."); } - if(BuildCraftPowerLoaded) - { - Mekanism.logger.info("Hooked into BuildCraft successfully."); - } - if(CCLoaded) { loadCCPeripheralProviders(); diff --git a/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java b/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java index 760cb1441..54b4b3368 100644 --- a/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java +++ b/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java @@ -41,8 +41,8 @@ import ic2.api.item.IElectricItemManager; import ic2.api.item.ISpecialElectricItem; @InterfaceList({ - @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), - @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") + @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2") }) public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IEnergyCube, ISpecialElectricItem, ISustainedInventory, IEnergyContainerItem { @@ -136,28 +136,28 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public boolean canProvideEnergy(ItemStack itemStack) { return true; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getMaxCharge(ItemStack itemStack) { return 0; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public int getTier(ItemStack itemStack) { return 4; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getTransferLimit(ItemStack itemStack) { return 0; @@ -310,21 +310,21 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this); } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getChargedItem(ItemStack itemStack) { return this; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getEmptyItem(ItemStack itemStack) { return this; diff --git a/src/main/java/mekanism/common/item/ItemBlockMachine.java b/src/main/java/mekanism/common/item/ItemBlockMachine.java index bd36679f0..4ecff07cc 100644 --- a/src/main/java/mekanism/common/item/ItemBlockMachine.java +++ b/src/main/java/mekanism/common/item/ItemBlockMachine.java @@ -109,8 +109,8 @@ import ic2.api.item.ISpecialElectricItem; * */ @InterfaceList({ - @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), - @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") + @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2") }) public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpecialElectricItem, IFactory, ISustainedInventory, ISustainedTank, IElectricChest, IEnergyContainerItem, IFluidContainerItem { @@ -335,28 +335,28 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public boolean canProvideEnergy(ItemStack itemStack) { return false; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getMaxCharge(ItemStack itemStack) { return 0; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public int getTier(ItemStack itemStack) { return 4; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getTransferLimit(ItemStack itemStack) { return 0; @@ -927,21 +927,21 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this); } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getChargedItem(ItemStack itemStack) { return this; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getEmptyItem(ItemStack itemStack) { return this; diff --git a/src/main/java/mekanism/common/item/ItemConfigurator.java b/src/main/java/mekanism/common/item/ItemConfigurator.java index 4633b8c19..440f0400c 100644 --- a/src/main/java/mekanism/common/item/ItemConfigurator.java +++ b/src/main/java/mekanism/common/item/ItemConfigurator.java @@ -34,7 +34,7 @@ import cofh.api.item.IToolHammer; import cpw.mods.fml.common.Optional.Interface; import cpw.mods.fml.common.Optional.Method; -@Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraftAPI|tools") +@Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft") public class ItemConfigurator extends ItemEnergized implements IMekWrench, IToolWrench, IToolHammer { public final int ENERGY_PER_CONFIGURE = 400; @@ -244,14 +244,14 @@ public class ItemConfigurator extends ItemEnergized implements IMekWrench, ITool } @Override - @Method(modid = "BuildCraftAPI|tools") + @Method(modid = "BuildCraft") public boolean canWrench(EntityPlayer player, int x, int y, int z) { return canUseWrench(player, x, y, z); } @Override - @Method(modid = "BuildCraftAPI|tools") + @Method(modid = "BuildCraft") public void wrenchUsed(EntityPlayer player, int x, int y, int z) {} @Override diff --git a/src/main/java/mekanism/common/item/ItemEnergized.java b/src/main/java/mekanism/common/item/ItemEnergized.java index 1e9dae733..0a28b4720 100644 --- a/src/main/java/mekanism/common/item/ItemEnergized.java +++ b/src/main/java/mekanism/common/item/ItemEnergized.java @@ -23,8 +23,8 @@ import ic2.api.item.IElectricItemManager; import ic2.api.item.ISpecialElectricItem; @InterfaceList({ - @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), - @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") + @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2") }) public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpecialElectricItem, IEnergyContainerItem { @@ -66,42 +66,42 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public boolean canProvideEnergy(ItemStack itemStack) { return canSend(itemStack); } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getChargedItem(ItemStack itemStack) { return this; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getEmptyItem(ItemStack itemStack) { return this; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getMaxCharge(ItemStack itemStack) { return 0; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public int getTier(ItemStack itemStack) { return 4; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getTransferLimit(ItemStack itemStack) { return 0; @@ -215,7 +215,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this); diff --git a/src/main/java/mekanism/common/item/ItemFreeRunners.java b/src/main/java/mekanism/common/item/ItemFreeRunners.java index cb05f58ad..743946ad1 100644 --- a/src/main/java/mekanism/common/item/ItemFreeRunners.java +++ b/src/main/java/mekanism/common/item/ItemFreeRunners.java @@ -36,8 +36,8 @@ import ic2.api.item.IElectricItemManager; import ic2.api.item.ISpecialElectricItem; @InterfaceList({ - @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), - @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") + @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2") }) public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpecialElectricItem, IEnergyContainerItem { @@ -103,42 +103,42 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public boolean canProvideEnergy(ItemStack itemStack) { return canSend(itemStack); } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getChargedItem(ItemStack itemStack) { return this; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getEmptyItem(ItemStack itemStack) { return this; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getMaxCharge(ItemStack itemStack) { return 0; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public int getTier(ItemStack itemStack) { return 4; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getTransferLimit(ItemStack itemStack) { return 0; @@ -252,7 +252,7 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this); diff --git a/src/main/java/mekanism/common/multipart/PartLogisticalTransporter.java b/src/main/java/mekanism/common/multipart/PartLogisticalTransporter.java index f5e9ede32..21b643e29 100644 --- a/src/main/java/mekanism/common/multipart/PartLogisticalTransporter.java +++ b/src/main/java/mekanism/common/multipart/PartLogisticalTransporter.java @@ -43,7 +43,6 @@ import cpw.mods.fml.common.Optional.Interface; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -@Interface(iface = "buildcraft.api.transport.IPipeTile", modid = "BuildCraftAPI|transport") public class PartLogisticalTransporter extends PartTransmitter implements ILogisticalTransporter { public static TransmitterIcons transporterIcons = new TransmitterIcons(3, 4); diff --git a/src/main/java/mekanism/common/multipart/PartUniversalCable.java b/src/main/java/mekanism/common/multipart/PartUniversalCable.java index d1fa1f90e..ffe85d1fc 100644 --- a/src/main/java/mekanism/common/multipart/PartUniversalCable.java +++ b/src/main/java/mekanism/common/multipart/PartUniversalCable.java @@ -33,7 +33,7 @@ import cofh.api.energy.IEnergyProvider; import ic2.api.energy.tile.IEnergySource; @InterfaceList({ - @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHAPI|energy"), + @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHCore"), }) public class PartUniversalCable extends PartTransmitter implements IStrictEnergyAcceptor, IEnergyHandler { @@ -279,7 +279,7 @@ public class PartUniversalCable extends PartTransmitter implement } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { if(canReceiveEnergy(from)) @@ -291,28 +291,28 @@ public class PartUniversalCable extends PartTransmitter implement } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { return 0; } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public boolean canConnectEnergy(ForgeDirection from) { return canConnect(from); } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int getEnergyStored(ForgeDirection from) { return 0; } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int getMaxEnergyStored(ForgeDirection from) { return (int)Math.round(getTransmitterNetwork().getEnergyNeeded()*general.TO_TE); diff --git a/src/main/java/mekanism/common/tile/TileEntityAdvancedBoundingBlock.java b/src/main/java/mekanism/common/tile/TileEntityAdvancedBoundingBlock.java index 782a7e4f1..3d919b096 100644 --- a/src/main/java/mekanism/common/tile/TileEntityAdvancedBoundingBlock.java +++ b/src/main/java/mekanism/common/tile/TileEntityAdvancedBoundingBlock.java @@ -23,7 +23,7 @@ import dan200.computercraft.api.peripheral.IPeripheral; @InterfaceList({ @Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), - @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHAPI|energy"), + @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHCore"), @Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") }) public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock implements ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IEnergyHandler, IPeripheral, IFilterAccess @@ -201,7 +201,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { if(getInv() == null) @@ -213,7 +213,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { if(getInv() == null) @@ -225,7 +225,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public boolean canConnectEnergy(ForgeDirection from) { if(getInv() == null) @@ -237,7 +237,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int getEnergyStored(ForgeDirection from) { if(getInv() == null) @@ -249,7 +249,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int getMaxEnergyStored(ForgeDirection from) { if(getInv() == null) diff --git a/src/main/java/mekanism/common/tile/TileEntityBasicBlock.java b/src/main/java/mekanism/common/tile/TileEntityBasicBlock.java index e17bd25d2..a9ef2aff5 100644 --- a/src/main/java/mekanism/common/tile/TileEntityBasicBlock.java +++ b/src/main/java/mekanism/common/tile/TileEntityBasicBlock.java @@ -27,7 +27,7 @@ import net.minecraft.tileentity.TileEntity; import cpw.mods.fml.common.Optional.Interface; import cpw.mods.fml.common.Optional.Method; -@Interface(iface = "ic2.api.tile.IWrenchable", modid = "IC2API") +@Interface(iface = "ic2.api.tile.IWrenchable", modid = "IC2") public abstract class TileEntityBasicBlock extends TileEntity implements IWrenchable, ITileNetwork, IChunkLoadHandler { /** The direction this block is facing. */ @@ -183,14 +183,14 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { return true; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public short getFacing() { return (short)facing; @@ -223,21 +223,21 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public boolean wrenchCanRemove(EntityPlayer entityPlayer) { return true; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public float getWrenchDropRate() { return 1.0F; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { return getBlockType().getPickBlock(null, worldObj, xCoord, yCoord, zCoord, entityPlayer); diff --git a/src/main/java/mekanism/common/tile/TileEntityElectricBlock.java b/src/main/java/mekanism/common/tile/TileEntityElectricBlock.java index c034be3e8..9201df98d 100644 --- a/src/main/java/mekanism/common/tile/TileEntityElectricBlock.java +++ b/src/main/java/mekanism/common/tile/TileEntityElectricBlock.java @@ -207,7 +207,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { if(getConsumingSides().contains(from)) @@ -226,7 +226,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { if(getOutputtingSides().contains(from)) @@ -245,21 +245,21 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public boolean canConnectEnergy(ForgeDirection from) { return getConsumingSides().contains(from) || getOutputtingSides().contains(from); } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int getEnergyStored(ForgeDirection from) { return (int)Math.round(getEnergy()* general.TO_TE); } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int getMaxEnergyStored(ForgeDirection from) { return (int)Math.round(getMaxEnergy()* general.TO_TE); diff --git a/src/main/java/mekanism/common/tile/TileEntityInductionPort.java b/src/main/java/mekanism/common/tile/TileEntityInductionPort.java index cf8c74bd2..cd4826c9d 100644 --- a/src/main/java/mekanism/common/tile/TileEntityInductionPort.java +++ b/src/main/java/mekanism/common/tile/TileEntityInductionPort.java @@ -36,7 +36,7 @@ import cpw.mods.fml.common.Optional.Method; @Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), @Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2"), @Interface(iface = "ic2.api.tile.IEnergyStorage", modid = "IC2"), - @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHAPI|energy"), + @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHCore"), }) public class TileEntityInductionPort extends TileEntityInductionCasing implements IEnergyWrapper, IConfigurable { @@ -225,7 +225,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { if(getConsumingSides().contains(from)) @@ -244,7 +244,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { if(getOutputtingSides().contains(from)) @@ -264,21 +264,21 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public boolean canConnectEnergy(ForgeDirection from) { return structure != null; } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int getEnergyStored(ForgeDirection from) { return (int)Math.round(getEnergy()* general.TO_TE); } @Override - @Method(modid = "CoFHAPI|energy") + @Method(modid = "CoFHCore") public int getMaxEnergyStored(ForgeDirection from) { return (int)Math.round(getMaxEnergy()* general.TO_TE); diff --git a/src/main/java/mekanism/common/util/ChargeUtils.java b/src/main/java/mekanism/common/util/ChargeUtils.java index 0485a49f0..e0daf4a1b 100644 --- a/src/main/java/mekanism/common/util/ChargeUtils.java +++ b/src/main/java/mekanism/common/util/ChargeUtils.java @@ -78,7 +78,7 @@ public final class ChargeUtils { storer.setEnergy(storer.getEnergy() - EnergizedItemManager.charge(inv.getStackInSlot(slotID), storer.getEnergy())); } - else if(Mekanism.hooks.IC2APILoaded && inv.getStackInSlot(slotID).getItem() instanceof IElectricItem) + else if(MekanismUtils.useIC2() && inv.getStackInSlot(slotID).getItem() instanceof IElectricItem) { double sent = ElectricItem.manager.charge(inv.getStackInSlot(slotID), (int)(storer.getEnergy()* general.TO_IC2), 4, true, false)* general.FROM_IC2; storer.setEnergy(storer.getEnergy() - sent); diff --git a/src/main/java/mekanism/common/util/MekanismUtils.java b/src/main/java/mekanism/common/util/MekanismUtils.java index 2b0612274..d642fcc38 100644 --- a/src/main/java/mekanism/common/util/MekanismUtils.java +++ b/src/main/java/mekanism/common/util/MekanismUtils.java @@ -1158,16 +1158,6 @@ public final class MekanismUtils return "error"; } - /** - * Whether or not BuildCraft power should be used, taking into account whether it is installed or another mod is - * providing its API. - * @return if BuildCraft power should be used - */ - public static boolean useBuildCraft() - { - return Mekanism.hooks.BuildCraftPowerLoaded && !general.blacklistBC; - } - /** * Whether or not IC2 power should be used, taking into account whether or not it is installed or another mod is * providing its API. @@ -1185,7 +1175,7 @@ public final class MekanismUtils */ public static boolean useRF() { - return Mekanism.hooks.RedstoneFluxLoaded && !general.blacklistRF; + return Mekanism.hooks.CoFHCoreLoaded && !general.blacklistRF; } /** diff --git a/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java b/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java index be14d0a58..7d414b132 100644 --- a/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java +++ b/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java @@ -51,8 +51,8 @@ import ic2.api.item.ISpecialElectricItem; */ @InterfaceList({ - @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), - @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") + @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"), + @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2") }) public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISpecialElectricItem, ISustainedInventory, ISustainedTank, IEnergyContainerItem { @@ -193,42 +193,42 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public boolean canProvideEnergy(ItemStack itemStack) { return canSend(itemStack); } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getChargedItem(ItemStack itemStack) { return this; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public Item getEmptyItem(ItemStack itemStack) { return this; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getMaxCharge(ItemStack itemStack) { return 0; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public int getTier(ItemStack itemStack) { return 4; } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public double getTransferLimit(ItemStack itemStack) { return 0; @@ -420,7 +420,7 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp } @Override - @Method(modid = "IC2API") + @Method(modid = "IC2") public IElectricItemManager getManager(ItemStack itemStack) { return IC2ItemManager.getManager(this);