OreCruncher / ThermalRecycling

Thermal Expansion add-on for recycling
MIT License
10 stars 7 forks source link

Crash with IC2 Classic #98

Open parcel31u opened 8 years ago

parcel31u commented 8 years ago

http://pastebin.com/Ae3Q9L2N

Speiger commented 8 years ago

I checkt the code and i am not sure what could cause that....

OreCruncher commented 8 years ago

Looks to be straight forward. IC2 Classic != IC2 Experimental. The IC2 changed the names of some of the blocks and items. What is happening on this line is that the mod is not finding the empty cell ItemStack using the given name. When get() is invoked it throws an exception because the internal reference is null.

NOTE: Thermal Recycling supports IC2 Experimental, not Classic.

Speiger commented 8 years ago

@OreCruncher even if IC2 Classic is not Exp it does support IC2 Exp items with a fake item that is just a EmptyIcon and no use.... So no thats not the case... And the UnlocalizedName stuff is something differend. If you want a IC2 Item then use the IC2 API.

OreCruncher commented 8 years ago

sigh That string there means something to the logic of Thermal Recycling - has nothing to do really with the unlocalized name. It's the string item ID in the Forge dictionary. Have you tried using IC2 Experimental?

Speiger commented 8 years ago

IC2 Classic uses the Unlocalized name for the ForgeRegistry same as IC2 Exp... So yeah thats why i say use the IC2 API for getting items because the field names are the same...

OreCruncher commented 8 years ago

Again, have you tried Experimental? Back when I developed the mod my intent was to support both versions of IC2. Then I discovered that they changed how some of the items are named in Experimental, one of those items being cells. It's why the mod doesn't support Classic.

Speiger commented 8 years ago

I am the IC2 Classic dev... (Even if you know) the thing is i use differend unlocalized name then ic2 Exp.. Unintendet since they changed their system drasticly...

OreCruncher commented 8 years ago

They did. And if I recall they didn't change the internal mod ID, and they probably should so that we can distinguish between the two versions. It would make supporting both classic and experimental much easier.

Speiger commented 8 years ago

No they should not change it. There should be a Universal ModID for IC2 and that is IC2. Classic already added a SecondModID that allows you to detect it. But Player does not see a reason to add a Second ModID to IC2 Exp...

OreCruncher commented 8 years ago

So it Experimental a fork of the original IC2 meaning that IC2 classic will continue to evolve as a separate independent mod?

Speiger commented 8 years ago

Both are based on the old IC2 but each version runs into his own version. But classic try to support as much as it can from Exp... Like a Multivers^^"

Speiger commented 8 years ago

Anyway i suggest you to use the IC2 API because classic uses always a: item.gameRegistry name in his code and i can not change that since whole worlds could be corrupted by that.

OreCruncher commented 8 years ago

Are the Classic and Experimental API the same, or do I need special code to detect which version I am dealing with?

Speiger commented 8 years ago

Nope. IC2Classic supports the IC2Exp API as best as it can. Even fake items from Classic if the item is not added by Classic...

OreCruncher commented 8 years ago

Several things that need to occur:

Speiger commented 8 years ago

Hehehe

OreCruncher commented 8 years ago

How would I go about detecting whether IC2 is Classic or Experimental?

parcel31u commented 8 years ago

I fixed it by disabling IC2 integration in the config for thermal Recycling.

Speiger commented 8 years ago

Ic2 Classic has a Second ModID so you can detect it. But IC2 Exp has no second one... Thanks playerSF for that... He sees no reason for it... (Aka wants a reason) link: https://github.com/TinyModularThings/IC2Classic/blob/master/src/main/java/ic2/api/info/IC2Classic.java#L76