I want to have a “virtual chest”-capability for my plugin. Would it be possible to create a Chest
(just as an Object
, not in the World
) for every Player
and serialize/deserialize it to a file? (possibly even saving/loading it to/from the User
file?) Or do I have to wait for the inventory-API?
An inventory is not seralizable
See this related issue
Ok. That means I would have to do it myself. But I would probably have to wait for Invntory-API for things like getting/setting the Items etc, right?
How would I register a chest?
You would have to iterate over each slot in the inventory and save the ItemStack if there is one, you don’t serialize the chest directly.
Note that currently only player inventories are implemented so getting the chest inventory won’t work yet.
Ok. So chest.getInventory();
is not implemented?