UploadedDec 16, 2021
Supported Bukkit Versions
v2.14.0 for MC 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.15.2, 1.14.4
I only list the primary changes here. For information on API changes, internal changes, and changes to the language files, you can find the complete changelog on Github: https://github.com/Shopkeepers/Shopkeepers/blob/master/CHANGELOG.md
- Updated for MC 1.18 and MC 1.18.1.
- Updated the 'compatibility mode' implementation, which broke with the Miecraft 1.18 update. However, due to some server internal mapping changes, it is likely that this compatibility mode will break again in future updates.
- Added the option for admins to create and restore snapshots of shopkeepers.
- Each snapshot captures the shopkeeper's dynamic state (i.e. its trades, shop object configuration, etc.), a timestamp, and is associated with a unique name that is provided when the snapshot is created.
- The name can currently be at most 64 characters long and not contain any color codes.
- This feature is currently meant to only be used by admins and third-party plugins. Shop owners are not yet able to create and restore snapshots of their own shops.
- The shopkeeper data of snapshots is automatically migrated during plugin startup, just like the shopkeeper's normal data.
- Shopkeeper snapshots are currently expected to be used sparsely. In order to guard against the unnoticed creation of excessive amounts of snapshots, we log a warning whenever a shopkeeper has more than 10 snapshots.
- When formatting the timestamp of a snapshot for display, we currently use the server's default time zone. There is no option in Shopkeepers yet to use a different timezone. If you want to use a different timezone for formatting the timestamps, you can change your server's default timezone via the JVM command line argument '-Duser.timezone=America/New_York' when you start your server.
- Command: Added commands '/shopkeeper snapshot [list|create|remove|restore]' to manage shopkeeper snapshots.
- Permission: Added permission 'shopkeeper.snapshot' (default: 'op') that provides access to the new snapshot commands.
- Experimental: It is also possible to capture and restore the NPC state of Citizens NPC shopkeepers.
- Config: Added setting 'snapshots-save-citizen-npc-data' (default: 'true') that controls whether shopkeeper snapshots capture and restore Citizens NPC data.
- When this setting is disabled, the Shopkeepers plugin automatically deletes all previously saved NPC data again.
- Capturing the data of a Citizens NPC will not work if the NPC is not available at the time the snapshot is created (e.g. if the Citizens plugin is not running currently).
- If the Citizens NPC is not available when a snapshot is restored, the shopkeeper remembers the NPC data until the NPC becomes available again and the stored NPC state can be applied. If another snapshot is restored in the meantime that does not store any NPC data, we retain the previously restored but not yet applied NPC state.
- Added editor options to change the puff state of puffer fish, as well as the pattern and colors of tropical fish.
- Added sound effects when a trade succeeds or fails.
- Config: These sound effects can be changed or disabled (by setting their volume to zero) via the new config settings 'trade-succeeded-sound' and 'trade-failed-sound'.
- Added settings to simulate the trading sounds of vanilla villagers and wandering traders.
- Config: Added setting 'simulate-villager-trading-sounds' (default: 'true').
- Config: Added setting 'simulate-villager-ambient-sounds' (default: 'false').
- Config: Added setting 'simulate-wandering-trader-trading-sounds' (default: 'true').
- Config: Added setting 'simulate-wandering-trader-ambient-sounds' (default: 'false').
- Config: Added setting 'simulate-villager-trading-sounds-only-for-the-trading-player' (default: 'true').
- By default, we now simulate the trading sounds of villagers and wandering traders for the trading player. These sounds are only played if the trading player is in the vicinity of the shopkeeper. Trading remotely will not play these sounds.
- Debug: Debug output for these simulated villager sounds can be enabled via the existing debug option 'regular-tick-activities'.
- Shopkeepers store the yaw angle now with which they are initially spawned.
- When placing a shopkeeper on top of a block, the yaw angle is chosen so that the shopkeeper faces towards the player who is creating the shopkeeper. When placing a shopkeeper against the side of a block, the shopkeeper is rotated according to the direction of the targeted block side.
- Existing shopkeepers will have a yaw of 0, i.e. they face south just like before. In the future, it will be possible to reposition shopkeepers and thereby also adjust the yaw of already existing shopkeepers. But this is not yet available.
- Data: Sign shopkeepers no longer store their sign facing. Instead, this facing is now derived from the shopkeeper's yaw. Existing sign shops will automatically migrate their currently stored sign facing to the shopkeeper's yaw.
- Shopkeeper mobs will rotate back to their initial direction now when there is no player to look at. However, this requires a player to still be somewhat nearby, since we only tick shopkeeper mobs when players are nearby.
- Config: Added setting 'set-citizen-npc-owner-of-player-shops' (default: 'false').
- When enabled, we set the Citizens NPC owner of player-owned NPC shopkeepers. When disabled, we automatically remove any previously set Citizens NPC owners from those player-owned NPC shopkeepers again.
- By enabling this setting, and configuring the Citizens command permissions for your players accordingly, you can allow shop owners to use the commands of the Citizens plugin to edit the Citizens NPCs of their NPC shopkeepers.
- Fixed: Wandering traders and trader llama shopkeepers despawned roughly every 40 minutes due to Minecraft's despawning timer still being active for these mobs, even when their AI is disabled. However, this issue has been rather minor, because the affected shopkeepers automatically respawned a few seconds afterwards. This issue has now been fixed by setting the 'DespawnDelay' of wandering traders to '0' and marking trader llamas as 'tamed', which disables Minecraft's despawning timer for these mobs.
- Fixed: We were not able to detect item stack deserialization issues, because Bukkit only logs an error in this case instead of throwing an exception. This also resulted in the loss of shopkeeper data when someone tried to revert from one server version to an older one, because the loading of item stacks that were saved on a newer server version is not supported by Bukkit. We are now able to detect these deserialization issues and then shut down the plugin before any data is lost.
- Fixed: Shopkeepers could lose some of their trades during item migrations. When an item was migrated, but the subsequent trades did not require any item migrations, these subsequent trades were lost. However, it was relatively unlikely to encounter this issue in practice. An exception to this is in combination with the following Paper-specific issue that only affects trades with certain enchanted book items.
- Fixed: On Paper servers, the comparisons of enchanted book items with multiple stored enchantments were not working as expected. The issue was caused by the server reordering the stored enchantments in some cases, as well as Paper automatically converting any deserialized Bukkit item stacks to CraftItemStacks, which behave differently when being compared to other CraftItemStacks. One known effect of this was that the above issue of trades potentially being lost due to item migrations would be encountered more likely on Paper servers, because the reordering of these stored enchantments would be detected as an 'item migration' by the Shopkeepers plugin. It also caused an unnecessary save of all shopkeeper data after every plugin reload.
- Fixed: The "/shopkeeper removeAll" command always tried to remove all player shops, instead of only the shops of the executing player.
- Data: Various kinds of invalid shopkeeper data and failed data migrations that have previously been ignored or only triggered a warning are now checked for and will prevent the shopkeeper from loading. Most notably, this includes the data of shopkeeper offers, and the hire cost item of player shops. Previously, this invalid data would be cleared. Now, it is retained for a server admin to investigate the issue.
- Data: It is invalid now to mix legacy and non-legacy book offer data (changed during late MC 1.14.4).
- When shopkeepers of inactive players are removed, we now trigger an immediate save, even if the 'save-instantly' setting is disabled.
- Versioning: Snapshot builds will now include the Git hash in their plugin version.
- Debug: The 'shopkeeper-activation' debug option will now log additional details about every single shopkeeper activation and deactivation, instead of only logging a summary about how many shopkeepers were activated per chunk.
- Various minor changes to error and debug log messages:
- Some error and debug log messages have slightly changed.
- Log messages involving a specific shopkeeper are more consistently formatted now.
- Some groups of error messages are now logged as a single message.
- In a few remaining cases, stack traces are no longer printed directly to the server log, but through the plugin logger.
- During the initial plugin startup, we now test if the server meets certain basic assumptions about its API implementation. In order to prevent damage due to unexpected server and plugin behavior, the plugin shuts itself down if any of these assumptions turn out to be incorrect. These tests are meant to be lightweight, but may be expanded in the future.
- Debug: Added a debug log message whenever a player tries to set an invalid shop name.
- Debug: Added a debug log message when the creation of a Citizens NPC fails.
- Data: Removed various 3 year old data migrations:
- We no longer check for and remove entity uuids from the data of living entity shopkeepers.
- The object data of shopkeepers is expected to be located in its own dedicated 'object' section.
- The stored object type identifiers of shopkeepers are expected to perfectly match the registered shop object types. They are no longer normalized and fuzzy matched.
- Data: We no longer generate a new unique id if the shopkeeper data is missing the shopkeeper's unique id. Instead, the loading of the shopkeeper fails now in this case.
- Data: All item stacks are now (shallow) copied before they are saved to the shopkeeper data. This prevents SnakeYaml from representing the item stacks using anchors and aliases (a Yaml feature) inside the shopkeepers save file if the same item stack instances would otherwise be saved multiple times in different contexts.
- Command: For consistency among commands, and to avoid certain ambiguous command parsing cases, the "edit", "remote", and "remove" commands no longer merge trailing arguments to derive the target shopkeeper name. It is still possible to target shopkeepers with names that consist of multiple words by using a dash as word separator instead of a space.
- Command: Shopkeeper and entity command arguments now propose the ids of targeted shopkeepers and entities.
- Fixed: The "testSpawn" debug command would respawn the shopkeepers in the executing player's chunk, but would not immediately update their object id registrations. The shop objects will now automatically and immediately inform the shopkeeper registry about those object id changes.
- Fixed: When changing the container location of a player shop via the API, the protection for the previous container was not properly disabled.
- Fixed: Any code that retrieves the container block of a player shopkeeper accounts now for the fact that the block might be null. This was only really an issue when another plugin invokes internal operations that require the container block to be available in a situation in which it might not be available currently.
- Fixed: The order of the enabled living shop object types was not updated on plugin reloads based on their order inside the config.
- Debug: Removed the debug option 'capabilities' again. We already always log whether server version specific features are enabled. This also resolves an internal issue related to whether the config has already been loaded at the time this debug option is checked.
- Fixed: In order to resolve compatibility issues with plugins that modify chat messages at lowest event priority, we now enforce that our chat input event handler always executes first. This should resolve compatibility issues with shopkeeper names not being considered valid, because some other plugin injected color codes into the player's chat message before we were able to process it.
- Fixed: Since Bukkit 1.16.5, the data version was no longer guaranteed to be the first entry of the save file, and the log message for the number of loaded shopkeepers has been off by one if the save file did not contain any data version yet.
- Fixed: We now check if the UI session is still valid before handling an inventory event at the HIGH event priority. Previously, the UI session was simply expected to still be valid. But this assumption can be violated by plugins that (incorrectly per API documentation) close the inventory during the handling of an inventory event.
- Fixed: Sound effects played to players would sometimes appear to be played slightly to the left or the right of the player's head.
- Fixed: When a NPC player shopkeeper moved to a different world, its container location (which is currently expected to always be located in the same world as the shopkeeper) and the protection of the container were not getting updated.
- Data: Under certain circumstances, one of the publicly posted snapshots of this update accidentally saved shopkeeper ids as normal attributes into the save file. The save file data version was bumped from 2 to 3, so that any previously saved shopkeeper ids are automatically removed again.
- Data: Improved the detection of server and plugin downgrades.
- We now use the data version that is stored inside the Shopkeepers save file to detect Minecraft server and Shopkeepers plugin downgrades. When a downgrade is detected, we log an error and disable the plugin to prevent any potential loss of data.
- There is one minor issue with this: After server downgrades, Spigot fails to load item stacks that are stored inside the save file. This causes the loading of the save file to fail before we are able to extract the data version. Our own Minecraft server downgrade check will therefore usually not actually be reached. However, the plugin will disable itself in this situation anyway. But the error message will then be different and more verbose. It should, however, also mention that the server downgrade is the issue.
- In order to be able to more reliably detect downgrades of the Shopkeepers plugin that might affect the saved shopkeeper data, we added a new 'shopkeeper data version' component to the data version that is stored inside the save file. The previous 'shopkeeper storage version' was, and still is, used for changes that require a save of all shopkeepers, such as for example when the storage format has changed. The new shopkeeper data version, however, is meant to be incremented more frequently, namely after every change to the data format of shopkeepers and shop objects. Usually, these changes only affect a subset of the shopkeepers and shop objects, so no full save of all shopkeepers is required when this data version component has changed.
- These shopkeeper and shop object data format changes also include the addition of new shopkeeper or shop object attributes: Since older plugin versions are not aware of these new attributes, the data for these attributes can get lost when an older plugin version would be allowed to load and later save shopkeepers that previously contained data for these attributes.
API changes, internal changes, and changes to the language files: See the complete changelog for details.
Known potential issues: See here.
If you like this plugin, consider making a donation.