* A value of '0' for the 'max-shops-per-player' setting no longer indicates no limit, but can be used to disable the creation and hiring of player shops. 'No limit' is indicated by a value of '-1' now. Any previous limit of '0' is automatically migrated.
* The permissions specified inside the config get cached and checked in decreasing order now. We abort checking permissions if they cannot further increase the player's current shops limit. An effect of this is that it is only possible to increase the default limit, not decrease it.
* Added permission node 'shopkeeper.maxshops.unlimited' (default: op), which disables the max shops limit for a player.
* Message: Changed the 'too-many-shops' message to be more general.
command.
* If the player targets a container (regardless of whether it is
supported), we assume that he might be trying to create a player shop.
However, unlike before this only affects the default shop type that is
chosen if the player does not specify a shop type himself.
* It is now possible to create admin shops via command even when
targeting a container. However, the admin shop type has to be explicitly
specified as command argument.
* When a player shop type is selected, we send appropriate feedback
messages depending on whether player shop creation via command is
enabled, whether a container is targeted, and whether it is a supported
type of container.
* When not specifying a shop object type, we pick the first shop object
type that can be used by the player. This is consistent between the
creation of player and admin shops now.
Messages:
* Added 'must-target-container'.
* Added 'no-player-shops-via-command'.
* Removed 'no-admin-shop-type-selected'.
* Removed 'no-player-shop-type-selected'.
shop creation item.
This seems to cause more confusion than it helps. Also, this is less of
an issue, because the default shop creation item is a villager egg with
specific display name since some time now.
* We always generate an 'en-default' language file. This file acts as a
template for custom language files. It is not meant to be modified and
is replaced with an up-to-date version on every plugin startup.
* Config: Changed the default language from 'en' to 'en-default'.
Existing configs get automatically migrated.
* Fixed: Text#parse can now also parse alternative color codes starting
with '&'. This has an effect when some messages of the specified
language file cannot be loaded and the plugin then uses the default
messages instead. This is part of Text#parse now (instead of requiring a
separate color conversion) for convenience reasons.
* Added warning output when the language file misses messages, or
contains unexpected messages.
* All message keys were changed to no longer start with the 'msg'
prefix.
The idea is that this might allow for optimization when doing shopkeeper lookups: Previously we had to create and check object ids for all shop object types in order to check if a block or entity is a shopkeeper of a certain type. We still have to go through all registered shop object types, but we can skip those which use the default ids.
However, as of right now this doesn't seem to make much of a difference. In a future step we could further optimize this by caching all object types which use non-default object ids.
Also, some default method implementations were moved into AbstractBlockShopObject and AbstractEntityShopObject.
Monsters usually get set on fire quite frequently when standing in sunlight. We therefore give zombies and skeletons a stone button as helmet now. This prevents them from getting set on fire in sunlight, by which we have to process less EntityCombustEvents. The stone button is also small enough to not be visible inside their head.
Entities standing in lava or fire are still set on fire as before.
This is no handled similarly to parrots (which do not support the baby state either).
Also fixed: The villager editor will no longer show the baby editor option for wandering traders.
Any villagers and wandering traders which are not Citizens NPC or shopkeepers are considered 'regular'.
The editor supports editing the villager trades, similar to how editing works for admin shopkeepers. Note that trades created or edited via the editor will have infinite uses, no xp rewards, no price multipliers and the current uses counter gets reset to 0 (there are currently no options to edit or persist these attributes).
To not accidentally edit all original trades whenever the editor is opened and closed (and thereby change the above mentioned trade attributes), we compare the trades from the editor with the villager's current trades before applying the trades from the editor: If the items of a trade are still the same, we keep the original trade without changes. A message indicates how many trades have been modified.
Since villagers may change their trades whenever they change their profession, we set the villager's xp to at least 1 whenever the villager's trades or profession have been modified via the editor.
If the villager is killed or gets unloaded while editing, any changes in the editor will have no effect.
Other supported villager editor options are:
* Deleting the villager entity.
* Opening a copy of the villager's inventory. Note that any changes to the opened inventory are not reflected in the villager's inventory currently (i.e. you can view, but not modify the villager inventory with this).
* Changing the villager profession. Changing the profession via the editor will keep the current trades.
* Changing the villager type (i.e. the biome specific outfit).
* Changing the villager level (i.e. the badge color). This also affects which level is displayed and whether the villager's xp is shown within the villager's trading UI.
* Toggling the villager's AI on and off. This is useful to make the villager stationary while editing it. Otherwise it may wander away.
Related changes:
* Permissions: Added `shopkeeper.edit-villagers` and `shopkeeper.edit-wandering-traders` (default: `op`). These are required to edit regular villagers or wandering traders respectively.
* Added command `/shopkeeper editVillager [villager]`. This opens an editor to edit the specified villager / wandering trader. The villager / wandering trader can either be specified by uuid or by looking at it.
* Config: Added settings `edit-regular-villagers` and `edit-regular-wandering-traders` (default: `true`). With these settings enabled the villager editor can be opened by simply sneaking and right-clicking a regular villager (similar to how editing works for shopkeepers).
Various related internal changes:
* Added new command arguments to specify an entity by uuid.
* Added new command arguments to select a targeted entity.
* Moved and added some merchant and trading recipe related utilities into MerchantUtils.
* Minor changes to the comparison of merchant recipes.
* Moved the shopkeeper metadata key constant into ShopkeeperUtils.
* Added ItemUtils#getOrEmpty(ItemStack).
* ShopkeeperUIHandler is an interface now. This allows for more flexibility in the class hierarchy of UI handlers. Added a basic implementation 'AbstractShopkeeperUIHandler'.
* Removed the unused SKDefaultUITypes#register() method.
* Various refactoring related to the editor UI. There is now a separate base class for the shared implementation of the shopkeeper editor and the new villager editor UI. Any shopkeeper references had to be removed from the base class. All existing shopkeeper editor buttons had to be slightly adapted to this change.
Other changes:
* Minor fix: If the second buy item of a trading recipe is empty, the corresponding created merchant recipe stores that as an empty second ingredient now. This should help when checking if the existing merchant recipes still match the newly created merchant recipes and thereby cause less recipe updates that are not actually required.
Added messages:
* msg-missing-edit-villagers-perm
* msg-missing-edit-wandering-traders-perm:
* msg-must-target-entity
* msg-must-target-villager
* msg-target-entity-is-no-villager
* msg-villager-editor-title
* msg-villager-editor-description-header
* msg-villager-editor-description
* msg-button-delete-villager
* msg-button-delete-villager-lore
* msg-button-villager-inventory
* msg-button-villager-inventory-lore
* msg-button-mob-ai
* msg-button-mob-ai-lore
* msg-villager-inventory-title
* msg-set-villager-xp
* msg-no-villager-trades-changed
* msg-villager-trades-changed
* msg-command-description-edit-villager