Railcraft

Railcraft

34M Downloads

Wrong IC2 API use

Speiger opened this issue ยท 5 comments

commented

Hi, i was Testing stuff with IC2 Classic and Railcraft and i nodest some issus with your IC2 API usages.

The Energy Unloader returns wrong data: You return on the Tier request 512/1024 (it should be 2048 but ok), but that is a wrong. You have to return 3/4 on the getSinkTier() function because its requesting the EnergyTier and not the Maximum Power that it accepts...

Also a question: Why do you use for almost everything IMetaDelegate?
For the RockCrusher it makes Sence to use that because it is a MultiStructure but why do you use it on none Multistructures?

commented

IC2 Classic?! It seems that is too old. Currently Railcraft supports IC2 Experimental.

commented

@liach
First IC2 Classic uses the IC2 Exp api, and it loads like IC2 so Railcraft do not nodest the difference.
And those things i mentiont are bugs with the exp API (like i told in the topic wrong IC2 API use),
so it does not matter if i tested it with Exp or Classic IC2.

And IC2 Classic is not that old what you think. Current state 1.7.10.

commented

I'm fairly positive my usage is correct. It has always behaved as expected when testing it. The unloader isn't even a Sink so it doesn't even implement getSinkTier().

The delegates are used so that my tile entities are not required to implement IC2 interfaces. This was recommended by Player.

https://github.com/CovertJaguar/Railcraft/blob/master/src/main/java/mods/railcraft/common/blocks/machine/epsilon/TileElectricFeeder.java#L105

    public int getSinkTier() {
        return 3;
    }

https://github.com/CovertJaguar/Railcraft/blob/master/src/main/java/mods/railcraft/common/blocks/machine/gamma/TileEnergyUnloader.java#L186

    public int getSourceTier() {
        return transformerUpgrades > 0 ? 4 : 3;
    }

Please try to fact check you bug reports before making spurious claims or at least include links to the lines you believe are wrong.

commented

Incorrect terminology and misleading information aside, yes the Energy Loader was wrong.

commented

Ok. Good.
Well, you just could used someting like: ISink (which extends IEnergySink) then you have the same result but it is not worth talking about that.
Just a note: With IC2 Classic at the moment Railcraft Machines that accept EU will not work even if you are not using cables..
It is a IC2 Classic bug i know that and i am working on that soon...