This depends on #630
Originally, Inventory resolves for both bounded and unlimited inventory types for item list menus and container inventories, but this is not the best design. So, Inventory is instead made into an interface and 2 separate subclasses BoundedInventory and UnlimitedInventory are made for the corresponding situations. That said, BoundedInventory only handle inventories that have a size limit while UnlimitedInventory does not make any constrains on the size limit by default. This makes the code neater without concerning about "different unused fields exist for each circumstance", which shall be regarded as bad practice.
Then, a RewardChest is added to resolve the original problem that a chest is generated each time rewards are sent. Furthermore, world loading used DeathChest for saving inventory-overflowing items, which may not be well for players, so a RewardChest without timer is used instead. Now, the RewardChest cannot be treated as ordinary chest as items cannot be added and the chest is removed when its inventory is empty. This can reduce the chances players getting more survival-usable chests without any consumption of the desired materials. Also, RewardChest provides an interactive menu, unlike DeathChest. Perhaps, DeathChest should also be made with an interactive menu though.
This depends on #630 Originally,
Inventory
resolves for both bounded and unlimited inventory types for item list menus and container inventories, but this is not the best design. So,Inventory
is instead made into an interface and 2 separate subclassesBoundedInventory
andUnlimitedInventory
are made for the corresponding situations. That said,BoundedInventory
only handle inventories that have a size limit whileUnlimitedInventory
does not make any constrains on the size limit by default. This makes the code neater without concerning about "different unused fields exist for each circumstance", which shall be regarded as bad practice. Then, aRewardChest
is added to resolve the original problem that a chest is generated each time rewards are sent. Furthermore, world loading usedDeathChest
for saving inventory-overflowing items, which may not be well for players, so aRewardChest
without timer is used instead. Now, theRewardChest
cannot be treated as ordinary chest as items cannot be added and the chest is removed when its inventory is empty. This can reduce the chances players getting more survival-usable chests without any consumption of the desired materials. Also,RewardChest
provides an interactive menu, unlikeDeathChest
. Perhaps,DeathChest
should also be made with an interactive menu though.