SpongePowered/SpongeAPI — pull request #347 by ST-DDT (2014-12-30 18:09:12+00:00)
Title: Improve Builders

This PRs deals with three problems of the builders.
1) Getting new builders from the GameRegistry is one method yes, but it is burried along with one hundred other methods, so i renamed them from `getXBuilder` to `newXBuilder`. This way you can easyly check what kind of builders exist in the game registry simply by using the autocomplete functionality.

2) Some implementations may require/use a subclass of builder for specific types. Example to better deal with Books etc. Currently this not that much represented in the API, but especially `ItemStack` can have lots of NBT attributes, that you probably don't want to edit only using the Persistance API.
`ItemStack`s are immutable, so you have to use the builders to modify them and then either using builder subclasses or a `ItemData` attribute.
So either the builders have to be bound be type specific or the data. So I removed `withType` from the builders. So if you cannot set all properties you also cannot reset them entirely or reuse them after you have used them, thats why i also removed `reset()`. This also applies to other builders than `ItemStackBuilder`.
(if the ItemStack and other stuff is/will be only accessible via Persistance API, this point is obsolete. I hope that for usability reasons a fully grown API like the Entity API will be available for the other types as well. (Mainly ItemStack)

3) The `fromX` methods are dividing responsibilities and may introcude inconsistencies in the future. The `GameRegistry` should be the only access point to get things or create new builders for things. Especially with the things mentioned in 2) this could cause issues.

There is a related PR of mine (that has been closed because the Persistance API is not ready yet), which shows the intentions i had in mind with this one. https://github.com/SpongePowered/SpongeAPI/pull/328/files
@gratimax said i should move the builder stuff to an own PR. Here it is.
That PR only deals with `ItemStack`s. There `ItemData` are virtual sub types of `ItemType`s that hold all NBT data related to the item.
Ingame: Everything with the same/equal `ItemData` could be considered stackable. `ItemData` contains the description, book pages, enchantments, the spawn eggs entity and all that.