For some reason items might corrupt in the encoding and decoding process leading to invalid YAML strings. There's also another issue of the server not being able to load certain old itemstacks. (seems to be especially an issue with old entity types)
This is required as we now move items between inventories instead of individually removing and adding. This basically adds the stock represented by the admin shop sign to the AdminInventory so all transactions should always be possible.
This is due to a bug in CraftBukkit not properly supporting localised/translatable display names when serialising item meta.
This also adds/improves the message when no valid item ID could be generated.
This adds separate permissions for accessing, creating and destroying of shops.
It also adds a config entry to allow using of a shop even if someone have access to it due to their permissions.
The InventoryMoveItemEvent is now only used for Hopper Minecarts, other blocks that could move items (Hoppers and Droppers) are checked on place. That way players that have access to a shop can just use the blocks normally but other players can't place them.
This is necessary due to the extended length of some material names in 1.13 as they directly include the variation into the material where previously only the data value was used. (E.g. BLACK_STAINED_GLASS_PANE) By removing the spaces and using uppercase characters to separate parts the string stays both readable to the user and parseable by the plugin. It should also be backwards compatible with the old format. (At least with 1.13 material names)
This uses hardcoded widths for the main characters used in Minecraft and might not be precise for some characters but better than the previous 15 char hard limit.
This also makes it possible to input IDs on the sign that are longer than the max sign letters that the plugin uses as that just gets auto corrected back down to the correct amount.
This includes a new price_precision config entry to set the amount of decimal places to allow on a shop sign (set to 2 by default). Thanks to @andrewkm for this idea.
It also fixes an issue where a zero inside the decimal places was removed instead of it's end and also removes the point and zeros from prices that only have trailing zeros to avoid confusion (e.g. in languages that use the decimal point for thousands)
This uses a cache for players that we haven't found before so to not check the cache too often and also checks if the online mode of the queried OfflinePlayer matches the server's mode (gotten from the first logged-in player in order to be compatible with BungeeCord requiring the server to be in offline-mode.
This introduces a new AccountCheckEvent to check if a user actually has an account with the used economy plugin. Also fix CurrencyTransferEvent logic (even though it's not used anywhere currently)
Iirc this was only async for database logging or name resolving. Neither of these is done anymore and async access of the Bukkit API can lead to strange problems like the CME described in the mentioned issue.
This is necessary so that we still store the messages with the & code internally as they would get saved back to the config file using the converted color code (section sign) which could lead to encoding issues on different operating systems. (It also fixes issues with strings that contain an and sign that isn't supposed to be a color code) Instead we load the real string and color messages via the prefix method which should get called in every instance where a message is send.
The NameManager appends a unique id for every player that has the same short name as another already existing one with a colon to the end of the clashing usernames. This is necessary so that a player can't just change their name to another user's old name and get access to all his shops.
This changes events to store the database Account instead of an OfflinePlayer and deprecates any event method that uses/returns OfflinePlayer. This is necessary as Bukkit#getOfflinePlayer(String) queries Mojang for the UUID when the user was not found in the local cache. As we already store this information (name to UUID mapping) in our database we should not have no need to rely on querying Mojang. (This might make transactions fail for shop owners that haven't played before but that shouldn't really be an issue in most cases)
This also fixes some conditions under which the STACK_TO_64 option did not get applied correctly and wrong inventory space checking for items with a max stack size of less than 64
Inspired by @Brokkonaut's fork this adds a new NOT_ENOUGH_SPACE_IN_YOUR_SHOP message to send to the shop owner when someone tries to sell to his shop. It also adds new %world, %x, %y and %z variables to display the shop's location in the message, adds a config option to make both the full-shop and out-of-stock messages respect /cstoggle and makes values in the locale.yml support ampersand color codes.
This should fix the issue where the player's short name on the shop sign does not reflect the actual player's name. This works by storing every uuid-username combination together with the associated short name and the last time the player logged in with that combination.
This should fix issues with how name changes are handled and also prevent short names of different players from clashing. It also uses guava caches instead of maps now with a configurable cache size
Partial revert of 'Do not let people with already used usernames connect to the server' commit.
See comments here b0369d8e69 (commitcomment-14185778) and here.
c169df2265 (commitcomment-12846919)
I personally believe ChestShops should not dictate whether a player is allowed to connect to the server or not. I personally have had issues with ChestShops kicking legitimate players from the server in online mode.
This fixes an infinite loop crash where the sign update calls the piston event and the update again and again.
Also signs can't even be pushed by pistons...