Bukkit/CraftBukkit — pull request #1404 by JeromSar (2014-07-31 21:36:01+00:00)
Title: Add Sign GUI API. Adds BUKKIT-5437

**The Issue:**
There is currently no easy way to access the sign GUI without hacking into sign placement.

**Justification for this PR:**
This PR adds functionality to `HumanEntity`. Plugins can now open a client-side sign GUI which interacts with a sign on the server. Additionally, this PR allows plugins to open "phantom signs" which aren't tied to any sign on the server. The resulting `SignChangeEvent` will always be cancelled by default.

**PR Breakdown:**
This PR adds three new methods to `HumanEntity`: `openSign()`, `openSign(Sign)` and `openSign(Sign, boolean)`. `openSign()` opens a new "phantom sign" which is not tied to any sign on the server. Its resulting `SignChangeEvent` will always be cancelled by default. `openSign(Sign, boolean)` will open a new sign GUI for the given Sign. The second parameter indicates if the server should accept the player's edit by default. The resulting `SignChangeEvent` might be cancelled by default depending on the second flag. `openSign(Sign)` is a shorthand for `openSign(Sign, true)`.

**Testing Results and Materials:**
A simple test plugin can be found here: https://github.com/JeromSar/SignEditTest
A compiled binary can be found here: https://github.com/JeromSar/SignEditTest/releases/

When the plugin is enabled on a server, it will attempt to log all `SignEditEvent` events to the console. The log entry contains the default `isCancelled()` value and the contents of the first line. Players right-click with a stick in the air to open a phantom sign. This sign is not attached to any Sign blockstate and the resulting `SignEditEvent` will thus be cancelled by default. Right clicking on a `SIGN_POST` will show a sign GUI to the player and accept its result (update the sign on the server). Right-clicking on a `WALL_SIGN` will open the sign GUI but will discard the result by default. On both accounts, an `SignEditEvent` will be called and logged.

**Relevant PR(s)**
* https://github.com/Bukkit/Bukkit/pull/1038 - The original PR by @CelticMinstrel. The PR lacked testing materials and needed to be merged with master.

**JIRA Tickets:**
https://bukkit.atlassian.net/browse/BUKKIT-5437