EmilHernvall / tregmine

The tregmine plugins
http://tregmine.info/
BSD 4-Clause "Original" or "Old" License
8 stars 10 forks source link

Multi world inventory support. #252

Closed lDiverse closed 10 years ago

lDiverse commented 10 years ago

So the concept should work, but I'm not fully familiar with the way out worlds work.

In theory this should, on world change, check their world and if its either world (Overworld) world_the_end (End) or world_nether (Nether) then set the inventory to 'survival' which is what we use currently to store all inventories.

If its not one of the three above, then load the inventory world.getName() which will load a dynamic inventory based on what world they go into. It also saves the previous inventory.

So in all theory it should work. but triple check world names and such.

lDiverse commented 10 years ago

Two notes,

  1. The reason two commits is because I forgot to update first, so I did a second commit to fix all the overrides.
  2. The worst thing that could happen if this code fails - Which I do find unlikely, is people will walk around with independent inventories for all the worlds... This will not break anything - Just revert back to the previous jar, or remove this code and use the new jar and their inventory will return. Magic.