v2.8.0
Details
-
FilenameShopkeepers-2.8.0.jar
-
Uploaded by
-
UploadedAug 21, 2019
-
Size687.75 KB
-
Downloads1,951
-
MD5fcb3c41bc65683ce926ea3387486e9ce
Supported Bukkit Versions
- 1.14
Changelog
v2.8.0 for MC 1.14.4
Checkout the changelog of v2.7.0 regarding the update to MC 1.14.
- Bumped Bukkit dependency from 1.14.3 to 1.14.4.
- Added: Changed how items are getting defined in the config.
- Internally this new format uses Bukkit's item serialization for parsing the item data, which allows it to support the specification of arbitrary item data and hopefully not require any major maintenance for future minecraft versions. At the same time it tries to stay (slightly) more user-friendly than Bukkit's item serialization by omitting any data that can be restored by the plugin, by avoiding one level of nesting between the item type and item data, by translating ampersand ('&') color codes in display name and lore, and by offering a compact representation for specifying an item only by its type. See the updated wiki for a detailed explanation on how to specify item data inside the config: https://github.com/Shopkeepers/Shopkeepers-Wiki/wiki/Configuration
- This change also allows a more detailed specification of some of the editor button items. However, many editor buttons still miss corresponding config settings. Also keep in mind that the display name and lore for these button items get specified via corresponding message settings, so any specified item display name and lore will get replaced by that.
- When checking if an in-game item matches the item data specified in the config, only the specified data gets compared. So this does not check for item data equality, but instead the checked item is able to contain additional data but still get matched (like before, but previously this was limited to checking display name and lore).
- The previous item data gets automatically migrated to the new format (config version 2).
- Renamed the setting 'high-zero-currency-item' to 'zero-high-currency-item'. This gets automatically updated during the migration.
- Changed: All priorities and ignoring of cancelled events were reconsidered.
- Event handlers potentially modifying or canceling the event and which don't depend on other plugins' event handling are called early (LOW or LOWEST), so that other plugins can react to / ignore those modified or canceled events.
- All event handlers which simply cancel some event use the LOW priority now and more consistently ignore the event if already cancelled. Previously they mostly used NORMAL priority.
- Zombie villager curing is prevented (this includes sending the player a message) on LOW priority now. If some plugin wants to bypass Shopkeepers (for example to allow the curing of specific zombie villagers) it can still cancel the event on lowest priority, so that Shopkeepers ignores it, and then uncancel it afterwards.
- Interaction with the shop creation item (chest selection, shop creation) is handled at LOWEST priority now, so that hopefully even protection plugins can ignore the cancelled event and don't handle it twice when we check chest access by calling another fake interact event. In order to resolve potential conflicts with other event handlers acting on LOWEST priority (such as Shopkeepers' sign interaction listener), we ignore the event if interaction with the item got already cancelled.
- Interaction with shopkeepers (entities and signs) are handled at LOWEST priority now, so that other plugins more reliably ignore the cancelled event. This makes bypassing of other plugin's interaction blocking the new default behavior. Taking the interaction result of other plugins into account can be enabled by the new setting 'check-shop-interaction-result', which involves calling a fake interact event (similarly to how chest access is checked). Since this is usually not wanted and might in general cause side effects (depending on the other plugins active on the server) this is disabled by default. In order to resolve conflicts with other event handlers acting on LOWEST priority (such as Shopkeepers' shop creation item interaction handling), the interaction is ignored if the event got already cancelled.
- Most UI clicking is handled at LOW priority (like before).
- Event handlers purely reacting to an event (without modifying or canceling it) are called at the MONITOR stage.
- The shop creation item usage gets sent on MONITOR priority now when switching the held item.
- Handling of shopkeepers spawning and despawning on chunk/world loading/unloading and world saving happens on MONITOR priority to reliably ignore cancelled events. Loading of shopkeepers might even happen delayed, to ignore chunks which only get loaded temporarily (like before).
- Handling of UI closing happens on MONITOR priority now.
- Event handlers potentially modifying or canceling the event and which depend on other plugins' event handling are called late (HIGH or HIGHEST).
- Clicks in the trading UI are handled at HIGH priority (like before), so that other plugins have a chance to cancel the trading by canceling the corresponding click event, while still allowing other plugins to react to / ignore the event after we have cancelled it.
- Interactions with regular villagers (blocking, hiring) are handled at HIGH priority (like before), so that hiring can be skipped if some other plugin has cancelled the interaction.
- Event handlers potentially modifying or canceling the event and which don't depend on other plugins' event handling are called early (LOW or LOWEST), so that other plugins can react to / ignore those modified or canceled events.
- Changed: Replaced the 'bypass-shop-interaction-blocking' setting (default: false) with the new setting 'check-shop-interaction-result' (default: false).
- Changed: The new 'check-shop-interaction-result' setting also applies to sign shops now.
- Changed: Added a new 'loadbefore' entry for GriefPrevention as workaround to fix some compatibility issue caused by our changed event priorities and GriefPrevention reacting to entity interactions at LOWEST priority.
- Fixed: Also cancelling the PlayerInteractAtEntityEvent for shopkeeper entity interactions.
- Changed: When forcing an entity to spawn, the pitch and yaw of the expected and actual spawn location are ignored now. This avoids a warning message for some entity types (such as shulkers), which always spawn with fixed pitch and yaw.
- Changed: Some entity attributes are setup prior to entity spawning now (such as metadata, non-persist flag and name (if it has/uses one)). This should help other plugins to identify Shopkeeper entities during spawning.
- Changed: Added setting 'increment-villager-statistics' (default: false) which controls whether opening the trading menu and trading with shopkeepers increment minecraft's 'talked-to-villager' and 'traded-with-villager' statistics. Previously the talked-to-villager statistics would always get incremented and the traded-with-villager statistic was not used.
- Added: The previous, current and next page items inside the editor view will now use their stack size to visualize the previous, current and next page number. This even works for items which are usually not stackable.
- Added: Added the config setting 'register-world-guard-allow-shop-flag' (default: true) which can be used to disable the registration of the 'allow-shop' WorldGuard flag. Note that changing this setting has no effect until the next server restart or full server reload.
API:
- API: Added interfaces for the different shopkeeper types and their offers to the API. They allow modifying the shopkeepers' trades. Factory methods for the different types of offers are provided via ShopkeepersPlugin and ShopkeepersAPI. The internal shopkeeper classes got renamed.
- API: Added a few utility methods to TradingRecipe for comparing the recipes with given items or other recipes.
- API: Added toString, hashCode and equals to TradingRecipe and the new offer types.
- API: Minor javadoc changes.
- API/Fixed: ShopkeepersAPI was missing getDefaultUITypes.
Internal:
- Internal: Made some small change that resulted in major performance improvements for handling items moving between inventories (hoppers, droppers, etc.).
- Internal: Slightly improved performance for handling block physics events.
- Internal: Moved some initialization and config loading into the onLoad phase.
- Internal: Avoiding ItemStack#hasItemMeta calls before getting an item's ItemMeta, since this might be heavier than simply getting the ItemMeta directly and performing only the relevant checks on that. Internally ItemStack#hasItemMeta checks emptiness for all item attributes and might (for CraftItemStacks) even first copy all the item's data into a new ItemMeta object. And even if the item actually has no data (Bukkit ItemStack with null ItemMeta), ItemStack#getItemMeta will simply create a new empty ItemMeta object without having to copy any data, so this is still a similarly lightweight operation anyways.
- Internal: Made all priorities and ignoring of cancelled events explicit.
- Internal: Moved code for checking chest access into util package.
- Internal: Moved config migrations into a separate package.
- Internal: Moved some functions into ConfigUtils.
- Internal: Slightly changed how the plugin checks whether the high currency is enabled.
- Internal: Metrics will also report now whether the settings 'check-shop-interaction-result', 'bypass-spawn-blocking', 'enable-spawn-verifier' and 'increment-villager-statistics' are used.
- Internal: Skipping shopkeeper spawning requests for unloaded worlds (should usually not be the case, but we guard against this anyways now).
- Internal: Spigot is stopping the conversion of zombie villagers on its own now if the corresponding transform event gets cancelled.
- Internal: Added a test to ensure consistency between ShopkeepersPlugin and ShopkeepersAPI.
- Internal: Added ItemData tests. This requires CraftBukkit as new test dependency due to relying on item serialization.
Debugging:
- Debugging: Added new debug command "/shopkeepers yaml", which prints Bukkit's yaml serialization and the item data representation used in the config for the currently held item.
- Debugging: Added entity, invalid entity and dead entity count to shopkeeper's "check" command. Also restructured the output slightly to make it more compact and clearer.
- Debugging: Minor changes to the "checkitem" command. It nows compares the items in main and off hand and also checks if the item in the main hand matches the item in the off-hand.
- Debugging: Small changes and additions to some debug messages, especially related to shopkeeper interactions and shopkeeper spawning.
- Debugging: Added setting 'debug-options', which can be used to enable additional debugging tools.
- Option 'log-all-events': Logs all events. Subsequent calls of the same event get combined into a single logging entry to slightly reduce spam.
- Option 'print-listeners': Prints the registered listeners for the first call of each event.
Known potential issues: See here.
Donations
If you like this plugin, consider making a donation.
Thanks!
Thanks to all donations since the last update:
- FatherWh0 (merchantvillages.com)
- lukeeexd (tws-mc.com)
- PapaJuan