Bukkit/CraftBukkit — pull request #1309 by me4502 (2014-01-03 03:20:46+00:00)
Title: [B+C] Implement BlockCommandPreprocessEvent. Adds BUKKIT-3545

The Issue:

Currently it is not possible to preprocess CommandBlock commands, similar to how ServerCommandEvent and PlayerCommandPreprocessEvent work.

Justification for this PR:

This event allows for many things to be done with command blocks, such as plugins adding things similar to @p, etc. It also adds consistency between command types.

PR Breakdown:

This PR adds an event that occurs in the loop where commands are sent. This event is sent per command, as that seems to be easier for the developer. Plus this is more consistent. If cancelled, the command is no longer sent, but further commands from the same block will still be sent as long as their events aren't cancelled.

Testing Results and Materials:

This binary tests the event. It replaces @b, with the type id of the block below it.
https://dl.dropboxusercontent.com/u/20806998/BCPETest.jar

Relevant PR(s):

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

JIRA Ticket:

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