SpoutDev/SpoutAPI — pull request #127 by bergerkiller (2012-03-11 22:50:14+00:00)
Title: Added block data classes+functions and material stubs

Signed-off-by: berger killer

This is a pretty big and important pull and WILL require the main Spout and Vanilla to be updated.

Simple summary:
- MaterialSource - supplies getId() - passed in functions using materials
- MaterialDataSource - supplies getData() - passed in functions using data
- several implementations of the above

BlockSource - supplies all information about blocks, such as material id and data
Block - also adds write access
AreaBlockReadAccess - supplies area block get operations
AreaBlockAccess - also adds block setting operations

Materials have been splitted into two categories. GenericMaterial, implementing Material, contains all info common to both ItemMaterial and BlockMaterial. This one should be used when giving players items the generic way. (Generic)Itemmaterial will get item-specific info, such as onInterract. (Generic)BlockMaterial will have all block-specific info, such as onPlacement.

I have separated the two to make better distinctions. All material classes also contain a 'createData' function, which constructs a new MaterialData wrapper around the data specified. This can be used to, for example, set special block or item info such as the color, attached face and durability.

Everything is based on interfaces to make it easy for people to add new data sources. For example, you can make an enum implementing it so you can pass in enum constants.

Again, this needs a thorough sweep along Spout and Vanilla.