GlowstoneMC/Glowkit — pull request #8 by Ribesg (2014-09-10 19:25:53+00:00)
Title: Add API to use 1.7 chat features. Adds BUKKIT-5245

##### The Issue:
There are currently no easy way to use the new chat features introduced in 1.7.

##### Justification for this PR:
As said before, there are currently no way (except from directly using the ``/tellraw`` command and passing your own generated json to it) to use the 1.7 chat features.

##### PR Breakdown:
This PR adds a builder interface based on a ``Message`` to which you append ``Part``s to build a rich chat message containing (or not):
* a ChatColor compatible text, a localized text, an ``ItemStack`` name or an ``Achievement`` name ;
* an optional ``Hover`` text (showing a multi-color multi-line text, an ``ItemStack`` description or an ``Achievement`` description) ;
* an optional ``Click`` action (executing commands / sending chat message, proposing commands / proposing chat message, or opening urls (actually opens the prompt)).

These messages handle colors and formatting using ChatColor just like standard messages, internally using the existing algorithm built by the great @mbax.

Many (**many**) shortcuts have been added to ``Message`` to make it easier to append specific elements, see ``Message`` static constructors, ``append`` methods and ``insert`` methods.

``Message`` and ``Part`` will be ``ConfigurationSerializable`` making it easy to save and load them from a config file.

This PR also adds methods to ``Player`` to send a ``Message`` and two methods to ``Server`` and ``Bukkit`` to broadcast a ``Message``. Those methods are closed to the standards String methods.

Usage examples can be found [in the TestPlugin after this line](https://github.com/Ribesg/TestPlugin/blob/BUKKIT-5245-v2/src/main/java/fr/ribesg/bukkit/testplugin/TestCommandExecutor.java#L56). You can get builds of all of this and test it yourself using the link below.

This PR is a complete rewrite based on the previous one and on @feildmaster's work on the subject.

##### Testing Results and Materials:
[Test Plugin Source](https://github.com/Ribesg/TestPlugin/tree/BUKKIT-5245-v2)
Build everything yourself to test it as we're not allowed to link CB builds here.

Quick build & test:
````bash
BRANCH=BUKKIT-5245-v2
mkdir ./build
cd ./build

git clone https://github.com/Ribesg/Bukkit.git -b $BRANCH
git clone https://github.com/Ribesg/CraftBukkit.git -b $BRANCH
git clone https://github.com/Ribesg/TestPlugin.git -b $BRANCH

cd ./Bukkit && mvn install
cd ../CraftBukkit && mvn install
cd ../TestPlugin && mvn install

cd ../..
mkdir ./run
mkdir ./run/plugins
cp ./build/CraftBukkit/target/craftbukkit-1.7.10-R0.1-SNAPSHOT.jar ./run
cp ./build/TestPlugin/target/TestPlugin.jar ./run/plugins

cd ./run
java -jar craftbukkit-1.7.10-R0.1-SNAPSHOT.jar
````
##### Relevant PR(s):
[B-1111](https://github.com/Bukkit/Bukkit/pull/1111) - Original Bukkit PR
~~[CB-1413](https://github.com/Bukkit/CraftBukkit/pull/1413) - Original CraftBukkit PR~~
[B-1065](https://github.com/Bukkit/Bukkit/pull/1065) & ~~[CB-1378](https://github.com/Bukkit/CraftBukkit/pull/1378)~~ - Old PRs

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

##### Authors
Of the previous PRs and of this one
* @bendem did a lot of things (Mostly Bukkit part)
* @Ribesg did a lot of other things (CB part and Bukkit part)
* @ST-DDT did the Javadocs for multiple Bukkit files