Chickens

Chickens

17M Downloads

Registry IDs

GenDeathrow opened this issue ยท 6 comments

commented

So got a question for ya. I know your using Integers to id the chickens. Two things I was thinking.
if we use id's we should prolly have blocked off id's basicaly if you need to block off for future chickens you want to add.example: 0-100 for your chickens, And I would just add my modded ids after, That way I dont use your IDs, which I hadn't thought of when I made it the first time. so My mod will break when I change them.
or....
It could use ResourceLocation Id... so chickens would be named "morechickens:ardite_chicken" or "chickens:flint_chicken". Only downside is it breaks both previous versions of our mod.

both haves ups and downs. first one would be less invasive, it will be easy for me to change.
second would mean we would never have to worry about overlapping ids, cause each mod would be in control.

I'm not really sure whats the best course of action

Also Im not sure if ResourceLocations are a good idea or not.. but it was an idea.

commented

Hi, it's great that you are thinking about it. I'll go through my code and try to find if e.g. the modid could be used as a distinguisher. My first idea was simple, each addon could pick a random high number as its base for IDs, e.g. have base 100 000 and then use 100 001, 100 002, ... but once some ID is released we cannot change so I will keep it on my mind during the investigation. What IDs are you currently using?

commented

If you want to keep normal ID's I started to register my chickens at 80+. I would hope 0-79 will work for yours. like i said if we need to change anything I'm up for it.

commented

I start at 80 and each mod I support I add about 10+ to 20+. I think the mod id works best, but I get it, it would be a major change. My idea only really comes from forge, they did away with the ids, because of overlapping(ie potions), and they moved over to the modids. plus when messing with nbt data in the chickens, it would be a lot easier to read type = "morechickens:ardite_chicken" instead of type = "81".

But than again, currently I'm the only one with an add-on atm. And any change that is made, we will have to make sure we synced up. So I can make sure my mods get updated at the same time.

Anyways its a suggestion more than anything. for now the system works, and to be honest, This could be held off till a lot later.

You could have both systems in-place so when we push one or the other, ppls worlds wouldn't get broken. Basically register both ID's, save both ID's in nbt data, and than after a few updates, remove the old system.

commented

Yeah, that was my thought. I can check if the new NBT entry is present and upgrade it in the runtime. But besides that, I would need to redesign my spawn eggs, they use item metadata to spawn a concrete chicken. I agree with you and I would leave it as it is for now with suggestion for other developers to add some random high base number to their IDs, e.g. 1 000 000 (addon base ID) + 5 (addon chicken ID) = 1 000 005.

BTW: IDs I am using were based on their tiers, e.g. tier 2 chickens were 2xx, tier 3 were 3xx, natural spawn and special chickens are XX. The tiers based system showed not to be very convenient.

commented

Yeah I realize that now.. and wish I had done the same thing with the id's. So hopfully we don't overlap. As far as spawn eggs go. You could do this.. you still have ID's but you let the registry set the ids automatic. Kinda how forge does it. Since mods pretty much always load in the same order the spawn eggs wont really be messed up. You have two list, <ID, ChickenITem> & <resourceLocation: ChickenItem>.. kinda how EntityList is set up. Than you can match ID to Names viseversa. Me and anyone else you decided to register off your mod would never have to worry about the ids.

commented

Hey when I get a chance, I'm going to write up a PR for this, and let you look it over. I have an idea in my head that will work for me, but also changes nothing for you. I started up a little last week. That way you can focus on your features. Also seems the mod is doing really well. I heard lots of good things about it so far.