IC2 Classic

IC2 Classic

2M Downloads

Iridium Neutron Reflector is not in ItemAPI

coderbot16 opened this issue ยท 13 comments

commented

Minor detail I noticed: the iridium neutron reflector isn't registered in the ItemAPI like the other reflectors.

commented

Yeah you will find plenty more of those.
Since i was finished with the ic2exp compat and starting my own content and not being on the latest version and actually not planning to go there i decided to stop adding these things to the registry.
Like a lot of things are missing.

since i wasnt expecting any addon/mod support that i wasnt writing myself.

commented

Ok, makes sense. In that case, what is the recommended stable way to retrieve IC2 Classic blocks and items? I've been using ItemAPI, but I also see an Ic2Items class that includes all of the items. I'm just curious which one I should use from an addon or compat point of view, since I want to avoid an unintentional dependency on an internal/unstable API.

commented

@coderbot16 ItemAPI is for if you just want a save way to interact with IC2Classic & IC2Experimental, without a dependency. Ic2Items will basically put the IC2Experimental compat away, since their class is move to another area. (Now there is ways to make that work but if you already have this issue open then you dont know about it).
So classloading issue would show up if you would do it directly.

That is just up to you how much you want to support and what you want to do.

There is 4 options:

  • 1: Wait until i fix the issue in the ItemAPI.
  • 2: Use Ic2Items and lose compat of one of the ic2s.
  • 3: Make a Wrapper that loads the right wrapper for the present IC2 version.
  • 4: Use GameRegistry.getItem()/ItemStack()/Block() and handle it from there? (which would still lead into a somewhat wrapper)
commented

The addon/mod is specifically designed for IC2 Classic (it's the IC2C compat module for TechReborn) so using Ic2Items will work fine, as long as it is a stable API. In any case, I can wait until ItemAPI is updated, since I won't need to release the mod for a few weeks. In any case, thanks for the support! (Even though I don't need IC2E I think using ItemAPI is the best since if Ic2Items is changed it won't lead to a full crash)

commented

IC2Items is Ic2s direct ItemStack reference storage, the old IC2Exp api (until i asked them to move away from reflection) was linking via reflection directly for that. The only way its going to change is either addition/removal, no renaming of things since that would break a lot internally.

(If removal happens then even if you use ItemAPI it would be the same effect).
And even if IC2Items gets a couple fields renamed its not like that fixing that would take long at all.

commented

Alright, good to know. In that case, that means that Ic2Items just as safe/stable as using ItemAPI? In that case, all I would want to know is if one API is preferred over the other.

commented

IC2Items gets created, after that i build the ItemAPI out of it (manually though because i have to adjust to ic2exp standarts).
Since IC2Items is my ItemStack Storage you can read it how you want it has 100% priority.

commented

Sounds good. Good to know which one you prefer people use, I'll make sure to do that in later projects.

commented

still needed? (because right now i dont have the time to go through everything and give it proper registry names.

commented

Yeah, since IC2 Classic compatibility was merged into TechReborn the iridium reflector thing is a sort of special case, since I have to go through GameRegistry. It's not the end of the world if it's not added, but would be nice to have.

commented

Also if more show up i add them based on when the show up.

commented

@coderbot16 ok partically fixed i bet i missed a couple of them but i added a whole bunch of missing ones.

To make it easier for later parts the ItemAPI has now a classic unique interface for reading all keys and also for adding custom items (as override or missing things because addons)

That should help at least temporary fixing issues via plugins that auto load for example.

Once released i close this issue.

commented

Fixed in latest patch.