[API] Conflict of IC²-API with Forge

    • Official Post

    So, I wanted to make an electric Energystorage (Machines are EU-Storages), which can also store Liquids. Now I have the Problem that both Interfaces "ILiquidTank" and "IEnergyStorage" have a Function called "getCapacity()", so you can guess that there is a Problem.


    How the fuck am I supposed to seperate them? If someone knows a way, then please tell me. I know its more Forges fault as they made the Method after IC², but I want to know how to fix that.


    I already tried to add the Class-Hierarchy behind the Functions Name, but then Ecplise mauls around.

    • Official Post

    Afaik, not possible. You either have to make electriccapacity==liquidcapacity or wait for either party to change it accordingly.

    My current "way" is, that the Machine has both: A limit of 10000 EU and 10000 Millibuckets of Water. It works, but rather bad because I originally wanted to store 2000 Millibuckets.


    Edit: Is it possible for you to change it? And then btw, make the teleporter compatible with all Energystorages, by adding some stuff like drainEnergy(), isTeleporterCompatible() and getTier() to the Interface?

  • Don't implement ILiquidTank, implement ITankContainer in your TileEntity.


    There's already a half-decent ILiquidTank in Forge called LiquidTank, it does almost everything necessary. I actually needed to extend it to give it a simple getLiquidAmount(), as I'd otherwise have to poke about in its internals. Then again, that was when I was using buildcraft.api.liquids.LiquidTank, dunno if Forge's version has that.

    • Official Post

    Don't implement ILiquidTank, implement ITankContainer in your TileEntity.


    There's already a half-decent ILiquidTank in Forge called LiquidTank, it does almost everything necessary. I actually needed to extend it to give it a simple getLiquidAmount(), as I'd otherwise have to poke about in its internals. Then again, that was when I was using buildcraft.api.liquids.LiquidTank, dunno if Forge's version has that.

    Yes I already found that out. Forge has just a Copy of the BC-Liquid-API, but cpw improved it a bit.