Bukkit/Bukkit — pull request #803 by evilmidget38 (2013-03-18 05:42:19+00:00)
Title: [B+C] BlockState for Command Blocks. Adds BUKKIT-3805

The Issue:

Currently in Bukkit there is no method whatsoever to modify the command or name of a Command Block.

Justification for this PR:

Currently in Bukkit there is no way to modify, much less retrieve either the command or the name of Command Blocks. This issue is particularly damaging to plugins such as WorldEdit, which attempt to copy and paste blocks, but face particular trouble with the inability to copy these values over using purely the bukkit API. Other plugins, such as any logging plugin really, also face the issue of being unable to correctly replace blocks, which is a bit of a pain for the end user.

PR Breakdown:

This PR is relatively straightforward, adding a total of one new interface, with its four methods. The first method, CommandBlock#getCommand() returns the command that the command block will execute when powered, as indicated in the javadoc. It will never return null, as the server currently does not cope with a null value for the command. The second method, CommandBlock#setCommand(String), is straightforward, and changes the command for the CommandBlock. Setting it to null is the same as setting it to an empty string for the reason mentioned above: the server doesn't cope with a null value.The third method, CommandBlock#getName() simply gets the name of the Command Block. The default name of a CommandBlock is "@", as described in the javadocs. The final method is CommandBlock#setName(String), which changes the name of the CommandBlock. As mentioned above, setting the name to null isn't handled well by the server, so setting it to null reverts it back to the default name, "@".

Relevant PR(s):

B-#### - https://github.com/Bukkit/Bukkit/pull/#### - Reason
CB-#### - https://github.com/Bukkit/CraftBukkit/pull/#### - Reason

JIRA Ticket:

BUKKIT-3805 - https://bukkit.atlassian.net/browse/BUKKIT-3805