Also deprecate amount and account setters on the CurrencyCheckEvent,
these values will be final in a future version. Changing them here does
not make sense in the internal structure.
This should be the final addition that allows other plugins to implement
multi-owner/group shops like requested in #119 and #133 by listening to
all the transaction events to handle money flow and shop/account access
events to enable access to the actual shop.
This adds better support for fake server economy accounts by not
requiring that a player with the name already has an account but allow
automatic creation of the account with the fake UUID provided in the
config.
Old configs that only define the name will still work though.
This makes it possible for other plugins to force allow placing of shops
and avoid potential issues in the check if multiple plugins are changing
the allow settings.
ALso while the allow counters were a nice idea they might not have even
worked correctly because in the case of only one plugin disallowing it
they would've still returned true at the end. Only if one listener
allowed it and another disallowed it the end result would be disallow.
This also makes the BuildPermissionEvent implement Cancellable (which is
an inverted allowed) in order to easily ignore events that are already
disallowed by another listener.
Instead of using different modules we use a bukkit profile to test backwards compatibility with pure-Bukkit servers and use the paper-api in the default profile. This should really be done with modules in the future. The actual selection which listener to use is handled by checking if the event class exists on event registration.
This is necessary as the no_permission error was worded exactly the same making debugging more difficulty. Also this way someone who thinks he needs to access the chest doesn't think that he doesn't have access to the shop at all.
Also fix a bug where it was possible for shops to be created with shop owners that did not have a valid Account information when other plugins manipulated the name line after the NameChecker checked it. Now it gets checked twice, once at the start (to abort early and to populate the ownerAccount field) and once at the end to check again when the name line changed.
This is especially obvious for books where all the text will have color codes after dumping and loading them from the database. In order to be able to still compare to them we will load the item the item and then dump it again if it doesn't match the original one.