Bukkit/CraftBukkit — pull request #1350 by Schmoller (2014-02-28 06:32:10+00:00)
Title: [C+B] Adds replacement block data related methods. Adds BUKKIT-5444

#### The Issue:
When magic values were deprecated, no direct way was provided for dealing with block data that wasnt deprecated. This PR adds 3 new methods for using MaterialData to set and get block data.

#### Justification for this PR:
The existing way to set a block type based on material data involves creating a BlockState instance, setting the data, then updating it. This process should be simplified to improve code readability, and awareness of this alternative to setting raw data values.

#### PR Breakdown:
This PR adds 3 methods to Block.java:
* setType(MaterialData data)
* setType(MaterialData data, boolean allowPhysics)
* MaterialData getTypeData()

The methods for setting MaterialData set both type and data value from the MaterialData object. Both call back into setTypeIdAndData()

#### Testing Results and Materials:
A simple plugin was used. On a right click of a block, it grabbed the MaterialData object through the getTypeData() method, then if it was a sign it inverted the direction; if it was a log, it cycled the direction of the log. Last, it set the block back to the MaterialData object using the setType(MaterialData, boolean) method.

In all cases the block was set back to the correct block type (the same type for everything except signs and logs). Planks did cycle through their data values but this is because they use the Tree MaterialData object as well as logs

Test plugin (source inside jar):
https://www.dropbox.com/s/kvsfjkmobe9ixkb/TestPlugin.jar

#### Relevant PR(s):
Bukkit Pull Request: Bukkit/Bukkit#1042

#### JIRA Ticket:
https://bukkit.atlassian.net/browse/BUKKIT-5444