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.
This commit is contained in:
Ben Spiers 2015-03-16 15:47:18 +00:00
parent 9db789674a
commit 71a9bfc4f9
18 changed files with 85 additions and 106 deletions

View file

@ -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", @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;" + dependencies = "after:ForgeMultipart;after:BuildCraft;after:BuildCraftAPI;after:IC2;after:CoFHCore;" +
"after:MineFactoryReloaded;after:MetallurgyCore;after:EnderIO;after:ExtraUtilities;after:Railcraft;after:Forestry;after:RedstoneArsenal") "after:ComputerCraft;after:Galacticraft API;after:MetallurgyCore")
public class Mekanism public class Mekanism
{ {
/** Mekanism Packet Pipeline */ /** Mekanism Packet Pipeline */

View file

@ -14,7 +14,7 @@ import dan200.computercraft.api.peripheral.IPeripheral;
@InterfaceList({ @InterfaceList({
@Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), @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") @Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft")
}) })
public interface IAdvancedBoundingBlock extends IBoundingBlock, ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IStrictEnergyStorage, IEnergyHandler, IPeripheral, IFilterAccess public interface IAdvancedBoundingBlock extends IBoundingBlock, ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IStrictEnergyStorage, IEnergyHandler, IPeripheral, IFilterAccess

View file

@ -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.IEnergySink", modid = "IC2"),
@Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2"), @Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2"),
@Interface(iface = "ic2.api.tile.IEnergyStorage", 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 public interface IEnergyWrapper extends IStrictEnergyStorage, IEnergyHandler, IEnergySink, IEnergySource, IEnergyStorage, IStrictEnergyAcceptor, ICableOutputter, IInventory
{ {

View file

@ -16,7 +16,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModAPIManager;
import cpw.mods.fml.common.Optional.Method; import cpw.mods.fml.common.Optional.Method;
import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.event.FMLInterModComms;
@ -37,10 +36,8 @@ public final class MekanismHooks
private Class BuildCraftEnergy; private Class BuildCraftEnergy;
public boolean IC2Loaded = false; public boolean IC2Loaded = false;
public boolean IC2APILoaded = false;
public boolean RailcraftLoaded = false; public boolean RailcraftLoaded = false;
public boolean BuildCraftPowerLoaded = false; public boolean CoFHCoreLoaded = false;
public boolean RedstoneFluxLoaded = false;
public boolean TELoaded = false; public boolean TELoaded = false;
public boolean CCLoaded = false; public boolean CCLoaded = false;
@ -49,9 +46,7 @@ public final class MekanismHooks
public void hook() public void hook()
{ {
if(ModAPIManager.INSTANCE.hasAPI("IC2API")) IC2APILoaded = true; if(Loader.isModLoaded("CoFHCore")) CoFHCoreLoaded = true;
if(ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|power")) BuildCraftPowerLoaded = true;
if(ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy")) RedstoneFluxLoaded = true;
if(Loader.isModLoaded("IC2")) IC2Loaded = true; if(Loader.isModLoaded("IC2")) IC2Loaded = true;
if(Loader.isModLoaded("Railcraft")) RailcraftLoaded = true; if(Loader.isModLoaded("Railcraft")) RailcraftLoaded = true;
if(Loader.isModLoaded("ThermalExpansion")) TELoaded = true; if(Loader.isModLoaded("ThermalExpansion")) TELoaded = true;
@ -70,11 +65,6 @@ public final class MekanismHooks
Mekanism.logger.info("Hooked into IC2 successfully."); Mekanism.logger.info("Hooked into IC2 successfully.");
} }
if(BuildCraftPowerLoaded)
{
Mekanism.logger.info("Hooked into BuildCraft successfully.");
}
if(CCLoaded) if(CCLoaded)
{ {
loadCCPeripheralProviders(); loadCCPeripheralProviders();

View file

@ -41,8 +41,8 @@ import ic2.api.item.IElectricItemManager;
import ic2.api.item.ISpecialElectricItem; import ic2.api.item.ISpecialElectricItem;
@InterfaceList({ @InterfaceList({
@Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"),
@Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2")
}) })
public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IEnergyCube, ISpecialElectricItem, ISustainedInventory, IEnergyContainerItem public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IEnergyCube, ISpecialElectricItem, ISustainedInventory, IEnergyContainerItem
{ {
@ -136,28 +136,28 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public boolean canProvideEnergy(ItemStack itemStack) public boolean canProvideEnergy(ItemStack itemStack)
{ {
return true; return true;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getMaxCharge(ItemStack itemStack) public double getMaxCharge(ItemStack itemStack)
{ {
return 0; return 0;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public int getTier(ItemStack itemStack) public int getTier(ItemStack itemStack)
{ {
return 4; return 4;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getTransferLimit(ItemStack itemStack) public double getTransferLimit(ItemStack itemStack)
{ {
return 0; return 0;
@ -310,21 +310,21 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public IElectricItemManager getManager(ItemStack itemStack) public IElectricItemManager getManager(ItemStack itemStack)
{ {
return IC2ItemManager.getManager(this); return IC2ItemManager.getManager(this);
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getChargedItem(ItemStack itemStack) public Item getChargedItem(ItemStack itemStack)
{ {
return this; return this;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getEmptyItem(ItemStack itemStack) public Item getEmptyItem(ItemStack itemStack)
{ {
return this; return this;

View file

@ -109,8 +109,8 @@ import ic2.api.item.ISpecialElectricItem;
* *
*/ */
@InterfaceList({ @InterfaceList({
@Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"),
@Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2")
}) })
public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpecialElectricItem, IFactory, ISustainedInventory, ISustainedTank, IElectricChest, IEnergyContainerItem, IFluidContainerItem 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 @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public boolean canProvideEnergy(ItemStack itemStack) public boolean canProvideEnergy(ItemStack itemStack)
{ {
return false; return false;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getMaxCharge(ItemStack itemStack) public double getMaxCharge(ItemStack itemStack)
{ {
return 0; return 0;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public int getTier(ItemStack itemStack) public int getTier(ItemStack itemStack)
{ {
return 4; return 4;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getTransferLimit(ItemStack itemStack) public double getTransferLimit(ItemStack itemStack)
{ {
return 0; return 0;
@ -927,21 +927,21 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public IElectricItemManager getManager(ItemStack itemStack) public IElectricItemManager getManager(ItemStack itemStack)
{ {
return IC2ItemManager.getManager(this); return IC2ItemManager.getManager(this);
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getChargedItem(ItemStack itemStack) public Item getChargedItem(ItemStack itemStack)
{ {
return this; return this;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getEmptyItem(ItemStack itemStack) public Item getEmptyItem(ItemStack itemStack)
{ {
return this; return this;

View file

@ -34,7 +34,7 @@ import cofh.api.item.IToolHammer;
import cpw.mods.fml.common.Optional.Interface; import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.common.Optional.Method; 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 class ItemConfigurator extends ItemEnergized implements IMekWrench, IToolWrench, IToolHammer
{ {
public final int ENERGY_PER_CONFIGURE = 400; public final int ENERGY_PER_CONFIGURE = 400;
@ -244,14 +244,14 @@ public class ItemConfigurator extends ItemEnergized implements IMekWrench, ITool
} }
@Override @Override
@Method(modid = "BuildCraftAPI|tools") @Method(modid = "BuildCraft")
public boolean canWrench(EntityPlayer player, int x, int y, int z) public boolean canWrench(EntityPlayer player, int x, int y, int z)
{ {
return canUseWrench(player, x, y, z); return canUseWrench(player, x, y, z);
} }
@Override @Override
@Method(modid = "BuildCraftAPI|tools") @Method(modid = "BuildCraft")
public void wrenchUsed(EntityPlayer player, int x, int y, int z) {} public void wrenchUsed(EntityPlayer player, int x, int y, int z) {}
@Override @Override

View file

@ -23,8 +23,8 @@ import ic2.api.item.IElectricItemManager;
import ic2.api.item.ISpecialElectricItem; import ic2.api.item.ISpecialElectricItem;
@InterfaceList({ @InterfaceList({
@Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"),
@Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2")
}) })
public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpecialElectricItem, IEnergyContainerItem public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpecialElectricItem, IEnergyContainerItem
{ {
@ -66,42 +66,42 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public boolean canProvideEnergy(ItemStack itemStack) public boolean canProvideEnergy(ItemStack itemStack)
{ {
return canSend(itemStack); return canSend(itemStack);
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getChargedItem(ItemStack itemStack) public Item getChargedItem(ItemStack itemStack)
{ {
return this; return this;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getEmptyItem(ItemStack itemStack) public Item getEmptyItem(ItemStack itemStack)
{ {
return this; return this;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getMaxCharge(ItemStack itemStack) public double getMaxCharge(ItemStack itemStack)
{ {
return 0; return 0;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public int getTier(ItemStack itemStack) public int getTier(ItemStack itemStack)
{ {
return 4; return 4;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getTransferLimit(ItemStack itemStack) public double getTransferLimit(ItemStack itemStack)
{ {
return 0; return 0;
@ -215,7 +215,7 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public IElectricItemManager getManager(ItemStack itemStack) public IElectricItemManager getManager(ItemStack itemStack)
{ {
return IC2ItemManager.getManager(this); return IC2ItemManager.getManager(this);

View file

@ -36,8 +36,8 @@ import ic2.api.item.IElectricItemManager;
import ic2.api.item.ISpecialElectricItem; import ic2.api.item.ISpecialElectricItem;
@InterfaceList({ @InterfaceList({
@Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"),
@Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2")
}) })
public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpecialElectricItem, IEnergyContainerItem public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpecialElectricItem, IEnergyContainerItem
{ {
@ -103,42 +103,42 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public boolean canProvideEnergy(ItemStack itemStack) public boolean canProvideEnergy(ItemStack itemStack)
{ {
return canSend(itemStack); return canSend(itemStack);
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getChargedItem(ItemStack itemStack) public Item getChargedItem(ItemStack itemStack)
{ {
return this; return this;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getEmptyItem(ItemStack itemStack) public Item getEmptyItem(ItemStack itemStack)
{ {
return this; return this;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getMaxCharge(ItemStack itemStack) public double getMaxCharge(ItemStack itemStack)
{ {
return 0; return 0;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public int getTier(ItemStack itemStack) public int getTier(ItemStack itemStack)
{ {
return 4; return 4;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getTransferLimit(ItemStack itemStack) public double getTransferLimit(ItemStack itemStack)
{ {
return 0; return 0;
@ -252,7 +252,7 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public IElectricItemManager getManager(ItemStack itemStack) public IElectricItemManager getManager(ItemStack itemStack)
{ {
return IC2ItemManager.getManager(this); return IC2ItemManager.getManager(this);

View file

@ -43,7 +43,6 @@ import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@Interface(iface = "buildcraft.api.transport.IPipeTile", modid = "BuildCraftAPI|transport")
public class PartLogisticalTransporter extends PartTransmitter<InventoryNetwork> implements ILogisticalTransporter public class PartLogisticalTransporter extends PartTransmitter<InventoryNetwork> implements ILogisticalTransporter
{ {
public static TransmitterIcons transporterIcons = new TransmitterIcons(3, 4); public static TransmitterIcons transporterIcons = new TransmitterIcons(3, 4);

View file

@ -33,7 +33,7 @@ import cofh.api.energy.IEnergyProvider;
import ic2.api.energy.tile.IEnergySource; import ic2.api.energy.tile.IEnergySource;
@InterfaceList({ @InterfaceList({
@Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHAPI|energy"), @Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHCore"),
}) })
public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implements IStrictEnergyAcceptor, IEnergyHandler public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implements IStrictEnergyAcceptor, IEnergyHandler
{ {
@ -279,7 +279,7 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
{ {
if(canReceiveEnergy(from)) if(canReceiveEnergy(from))
@ -291,28 +291,28 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
{ {
return 0; return 0;
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public boolean canConnectEnergy(ForgeDirection from) public boolean canConnectEnergy(ForgeDirection from)
{ {
return canConnect(from); return canConnect(from);
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int getEnergyStored(ForgeDirection from) public int getEnergyStored(ForgeDirection from)
{ {
return 0; return 0;
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int getMaxEnergyStored(ForgeDirection from) public int getMaxEnergyStored(ForgeDirection from)
{ {
return (int)Math.round(getTransmitterNetwork().getEnergyNeeded()*general.TO_TE); return (int)Math.round(getTransmitterNetwork().getEnergyNeeded()*general.TO_TE);

View file

@ -23,7 +23,7 @@ import dan200.computercraft.api.peripheral.IPeripheral;
@InterfaceList({ @InterfaceList({
@Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), @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") @Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft")
}) })
public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock implements ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IEnergyHandler, IPeripheral, IFilterAccess public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock implements ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IEnergyHandler, IPeripheral, IFilterAccess
@ -201,7 +201,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
{ {
if(getInv() == null) if(getInv() == null)
@ -213,7 +213,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
{ {
if(getInv() == null) if(getInv() == null)
@ -225,7 +225,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public boolean canConnectEnergy(ForgeDirection from) public boolean canConnectEnergy(ForgeDirection from)
{ {
if(getInv() == null) if(getInv() == null)
@ -237,7 +237,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int getEnergyStored(ForgeDirection from) public int getEnergyStored(ForgeDirection from)
{ {
if(getInv() == null) if(getInv() == null)
@ -249,7 +249,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int getMaxEnergyStored(ForgeDirection from) public int getMaxEnergyStored(ForgeDirection from)
{ {
if(getInv() == null) if(getInv() == null)

View file

@ -27,7 +27,7 @@ import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.common.Optional.Interface; import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.common.Optional.Method; 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 public abstract class TileEntityBasicBlock extends TileEntity implements IWrenchable, ITileNetwork, IChunkLoadHandler
{ {
/** The direction this block is facing. */ /** The direction this block is facing. */
@ -183,14 +183,14 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
{ {
return true; return true;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public short getFacing() public short getFacing()
{ {
return (short)facing; return (short)facing;
@ -223,21 +223,21 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public boolean wrenchCanRemove(EntityPlayer entityPlayer) public boolean wrenchCanRemove(EntityPlayer entityPlayer)
{ {
return true; return true;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public float getWrenchDropRate() public float getWrenchDropRate()
{ {
return 1.0F; return 1.0F;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
{ {
return getBlockType().getPickBlock(null, worldObj, xCoord, yCoord, zCoord, entityPlayer); return getBlockType().getPickBlock(null, worldObj, xCoord, yCoord, zCoord, entityPlayer);

View file

@ -207,7 +207,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
{ {
if(getConsumingSides().contains(from)) if(getConsumingSides().contains(from))
@ -226,7 +226,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
{ {
if(getOutputtingSides().contains(from)) if(getOutputtingSides().contains(from))
@ -245,21 +245,21 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public boolean canConnectEnergy(ForgeDirection from) public boolean canConnectEnergy(ForgeDirection from)
{ {
return getConsumingSides().contains(from) || getOutputtingSides().contains(from); return getConsumingSides().contains(from) || getOutputtingSides().contains(from);
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int getEnergyStored(ForgeDirection from) public int getEnergyStored(ForgeDirection from)
{ {
return (int)Math.round(getEnergy()* general.TO_TE); return (int)Math.round(getEnergy()* general.TO_TE);
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int getMaxEnergyStored(ForgeDirection from) public int getMaxEnergyStored(ForgeDirection from)
{ {
return (int)Math.round(getMaxEnergy()* general.TO_TE); return (int)Math.round(getMaxEnergy()* general.TO_TE);

View file

@ -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.IEnergySink", modid = "IC2"),
@Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2"), @Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2"),
@Interface(iface = "ic2.api.tile.IEnergyStorage", 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 public class TileEntityInductionPort extends TileEntityInductionCasing implements IEnergyWrapper, IConfigurable
{ {
@ -225,7 +225,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
{ {
if(getConsumingSides().contains(from)) if(getConsumingSides().contains(from))
@ -244,7 +244,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
{ {
if(getOutputtingSides().contains(from)) if(getOutputtingSides().contains(from))
@ -264,21 +264,21 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public boolean canConnectEnergy(ForgeDirection from) public boolean canConnectEnergy(ForgeDirection from)
{ {
return structure != null; return structure != null;
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int getEnergyStored(ForgeDirection from) public int getEnergyStored(ForgeDirection from)
{ {
return (int)Math.round(getEnergy()* general.TO_TE); return (int)Math.round(getEnergy()* general.TO_TE);
} }
@Override @Override
@Method(modid = "CoFHAPI|energy") @Method(modid = "CoFHCore")
public int getMaxEnergyStored(ForgeDirection from) public int getMaxEnergyStored(ForgeDirection from)
{ {
return (int)Math.round(getMaxEnergy()* general.TO_TE); return (int)Math.round(getMaxEnergy()* general.TO_TE);

View file

@ -78,7 +78,7 @@ public final class ChargeUtils
{ {
storer.setEnergy(storer.getEnergy() - EnergizedItemManager.charge(inv.getStackInSlot(slotID), storer.getEnergy())); 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; 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); storer.setEnergy(storer.getEnergy() - sent);

View file

@ -1158,16 +1158,6 @@ public final class MekanismUtils
return "error"; 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 * Whether or not IC2 power should be used, taking into account whether or not it is installed or another mod is
* providing its API. * providing its API.
@ -1185,7 +1175,7 @@ public final class MekanismUtils
*/ */
public static boolean useRF() public static boolean useRF()
{ {
return Mekanism.hooks.RedstoneFluxLoaded && !general.blacklistRF; return Mekanism.hooks.CoFHCoreLoaded && !general.blacklistRF;
} }
/** /**

View file

@ -51,8 +51,8 @@ import ic2.api.item.ISpecialElectricItem;
*/ */
@InterfaceList({ @InterfaceList({
@Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy"), @Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHCore"),
@Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2API") @Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2")
}) })
public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISpecialElectricItem, ISustainedInventory, ISustainedTank, IEnergyContainerItem public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISpecialElectricItem, ISustainedInventory, ISustainedTank, IEnergyContainerItem
{ {
@ -193,42 +193,42 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public boolean canProvideEnergy(ItemStack itemStack) public boolean canProvideEnergy(ItemStack itemStack)
{ {
return canSend(itemStack); return canSend(itemStack);
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getChargedItem(ItemStack itemStack) public Item getChargedItem(ItemStack itemStack)
{ {
return this; return this;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public Item getEmptyItem(ItemStack itemStack) public Item getEmptyItem(ItemStack itemStack)
{ {
return this; return this;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getMaxCharge(ItemStack itemStack) public double getMaxCharge(ItemStack itemStack)
{ {
return 0; return 0;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public int getTier(ItemStack itemStack) public int getTier(ItemStack itemStack)
{ {
return 4; return 4;
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public double getTransferLimit(ItemStack itemStack) public double getTransferLimit(ItemStack itemStack)
{ {
return 0; return 0;
@ -420,7 +420,7 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
} }
@Override @Override
@Method(modid = "IC2API") @Method(modid = "IC2")
public IElectricItemManager getManager(ItemStack itemStack) public IElectricItemManager getManager(ItemStack itemStack)
{ {
return IC2ItemManager.getManager(this); return IC2ItemManager.getManager(this);