World Control

World Control

1M Downloads

IC2Core Class usage

Speiger opened this issue ยท 5 comments

commented

Sry for commenting on it again. But you guys still use IC2Exp Core classes.
Could you make it a IC2Proxy that decide between IC2Exp & IC2Classic?
So that IC2Classic can run with it without crashing
https://github.com/World-Control-Team/World-Control/blob/master/src/main/java/worldcontrolteam/worldcontrol/crossmod/industrialcraft2/ReactorUtils.java

That would be nice.

commented

Will look into later today.

commented

Ty

commented

Still not done yet. Not Aproved!

commented

For ic2.core.item.reactor.AbstractDamageableReactorComponent I guess?

commented

ReactorPlannerComponentAPI.zip

yes.
there are two things you can do. Either make this:

    public static int getNuclearCellTimeLeft(ItemStack rStack){
        if(rStack == null){
            return 0;
        }
        if(Loader.isModLoaded("IC2-Spmod-Classic")
                {
            //Classics side
        }
        else
        {
                if(rStack.getItem() instanceof ic2.core.item.reactor.AbstractDamageableReactorComponent){
            if(rStack.getItem() instanceof ICustomDamageItem){
                return ((ICustomDamageItem) rStack.getItem()).getMaxCustomDamage(rStack) - ((ICustomDamageItem) rStack.getItem()).getCustomDamage(rStack);
            }
            return rStack.getMaxDamage() - rStack.getItemDamage();
        }
        }
        return 0;
}

Or you make a ModProxy. That means: You have 2Classes. 1 For classic & 1 For IC2Exp.
And the Proxy load the class based on what IC2 is loaded. (I did that for Nuclear Control if you remember)

Also i added a Class to the attachments. That will be the ReactorPlanner ComponentAPI. IC2Classic fully supports it and you can get stats from it (maxDamage Etc).
If you like to use it. Because IC2Classic has 6 Differend Types of Uran now. xD
All with differend durabilities Etc. Also you can then detect all component types with this class..