GlowstoneMC/Glowstone — pull request #358 by socram8888 (2014-09-27 23:03:05+00:00)
Title: Preliminary support for Double chests

This PR adds preliminary support for Double Chest inventories.

The core of GlowDoubleChestInventory is GlowSuperInventory, which allows developers to create Inventory trees, that is, Inventories whose changes are delegated to other sub-inventories. A change in a child is immediately reflected in the GlowSuperInventory, and equally a change in GlowSuperInventory is also reflected in the original inventories.

Other cool stuff which this PR adds is:
- SuperSet: adds a set which delegates in other sets, and as in GlowSuperInventory, changes are propagated in either way. Employed to implement the viewers of GlowSuperInventory.
- SuperIterator: accepts a list of iterators, and it consumes them in order. Why? Well, you can then iterate through a list of inventories without building a temporary intermediate list, which is very efficient performance-wise.
- GlowInventorySlot: an inventory slot. This, and the new "slotIterator" method in GlowInventory allows for efficient linear navigation and modification.