Jump to content

[1.8] Saved mod data and deprecated items/blocks.


Ernio

Recommended Posts

Writing adventure mods requires you to make load of quest items, which MIGHT be unobtainable in future (deprecated) or even removed from game code.

While deprecation case doesn't really matter (since item is still in game), there is problem with stuff that is removed from game code.

 

Forge has its system that (I am assuming from observation, not code itself) when world is created creates "dictionary" which matches unlocalized name (short: UN) of item with its world-unique-internal-ID. Then all items of this UN are saved in world as those ids.

This is true, right?

 

For some time now - forge has detection of items that were not found in game code (were not registered in gameRegistry). I am sure everyone saw on-world-load GuiScreen that says that world couldn't assign item to loaded world-saved item.

 

Questions:

* When item is totally removed from registry - what happens to:

- Forge's UN-to-ID "dictionary"? Does the UN stay and points at null thing or is it also removed?

- What happens to world-saved things that cannot find its registy-matches? I know for sure that items and blocks simply disappear - my guess is that if loaded item/block points at nothing it's set to null/0 and removed from loaded-NBT (from world save). Are they removed from disk or just bypassed and left?

- What would happen if I'd remove item from game and after some time re-added other item with same UN (unloc name)? How will forge deal with it?

EDIT:

- What about TileEntities, when their block gets removed - are they not-loaded and if not - is their data lost or just bypassed by world-loading code?

- What about removing TE and leaving Block? Same cleanup disk-data questions apply.

 

 

Basically - if someone knows how forge deals with world-data cleaning up, I'd be glad to hear anything.

 

Also - I have no idea where to look for the code responsible - right now I am literally searching for stuff like "save" "load" keywords, but there is so damn much callbacks :o

 

Thanks :D

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Everything clear as always, thanks man, saved me at least 2 hours.

 

As to Unlocalized name - I just messed up naming. That's what I ment (registry identifier).

 

Basically, if I'd remove something - until I load world for the first time after removal, I can easily register totally other thing to same (old) identifier and it will work (old will become new one, assuming there won't be loading - read NBT error).

 

And if I'd load it at least once, the world will forget about identifier and only leave locked id behind it - which will cause all old stuff to be removed and if I'd put other item with same name identifier - it will still get a new ID (forge won't remember it).

 

If that is right then I am so damn happy.

 

(I have to be reassured because i will be implementing something that simply can't have any issues with its removal in future).

 

Muchas Gracias :P

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.