SpoutDev/SpoutAPI — pull request #128 by bergerkiller (2012-03-12 17:04:48+00:00)
Title: Added material type and data classes with functions

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:
- MaterialTypeSource - supplies getType() and getTypeId() - passed in functions using materials
- MaterialDataSource - supplies getData() - passed in functions using data
- Access versions - adds setter functions

MaterialSource - adds createData functions to the above two source types
MaterialAccess - adds setters to the above
AreaBlockReadAccess - supplies area block get operations
AreaBlockAccess - also adds block setting operations

This means that a new Material system is used:
Material: Defines both type and data
Type: Defines the material ID (Wool)
Data: Defines additional data (RED , or , Wool_RED)

All functions allow passing in 'MaterialType/DataSource' as argument. This way all objects implementing this (ItemStacks, blocks, materials, custom types) can be passed directly into these function. This makes global data constants easier to make.

The Material class is immutable from the outside; you can't change the type or data after construction. You can change properties though. Materials are automatically registered.

To get Materials, you can now use the following functions:
Material.get(args)
ItemMaterial.get(args)
BlockMaterial.get(args)
args can be type (and data) or the name, and an optional aux data.

Again, this needs a thorough sweep along Spout and Vanilla, especially in the Block and World classes. I made unity between them to have one common JavaDoc for all functions, instead of copy-pasting it everywhere.