TehNut-Mods / ResourcefulCrops

Simply JSON based resource crops
MIT License
12 stars 7 forks source link

Agricraft and YOU #26

Closed Fortist closed 7 years ago

Fortist commented 8 years ago

Well, Im trying to configure new crops and remove stupid ones from the default. However, when changing the first three in most ways, I get one kind of crash. I think removing "Vanilla" stuff causes the crash, as I did try and remove the Gunpowder seed as well. When adding new crops, I get the same crash I think. I assume it's an Agricraft thing. http://pastebin.com/wT68zWsK

Probably gonna go post this aswell on the Agri Github

TehNut commented 8 years ago

Removing should have no effect on this. Try adding "seedReq": {} to your additional seeds.

I didn't fully understand how JSON worked when I moved over to it, so a lot of my handling is archaic and just plain stupid.

InfinityRaider commented 8 years ago

You can let Gson write the file for you, I tend to do that, it works very well and haven't had any issues with it so far.

InfinityRaider commented 8 years ago

To get to the point, not sure if this is an issue in my code or in yours. Are there things null that shouldn't be null? Or did I miss a needed null check?

TehNut commented 8 years ago

You can let Gson write the file for you, I tend to do that, it works very well and haven't had any issues with it so far.

Yeah I learned that a while after doing the JSON for this. I'll be rewriting it in the 1.8 version (sadly, that will require everybody to nuke their old configs).

To get to the point, not sure if this is an issue in my code or in yours. Are there things null that shouldn't be null? Or did I miss a needed null check?

Looking into that right now. As mentioned above, adding "seedReq": {} should be a working solution bandaid for OP, as that's what all the default seeds use.

TehNut commented 8 years ago

I'm actually not sure why that would be returning null... If the seedReq JSON object doesn't exist, I just return a default one.

@Fortist Could I see your current seed JSON?

Fortist commented 8 years ago

http://pastebin.com/tAmzZ3CK

Like, I can get rid of Cobalt and Ardite. But if I try and get rid of "Inky" or even rename it, I get that crash.

TehNut commented 8 years ago

Ahhh, I see what's happening here. SeedRegistry.getSeedList() isn't the primary "registry" list. I set that later here for more efficient lookup. The actual registry list is here (The cache).

The cache is used to make sure there's no shifting of ID's when the world is reloaded with a modified seed list. (IE: Remove index 7, everything after that gets shifted left one)

Because of this, old ID spots are blacklisted from future use. When setting the Seed list, those blacklisted spots effectively become null as there is no data to put there.

I can't really think of a fix for this on my end as it's just how the cache works.

Armagedon13 commented 7 years ago

Try to go in your Saves folder, and delete ResourcefulCropsCache.dat.

TehNut commented 7 years ago

Non-issue on modern MC