-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
git-Spigot-a99063f-fad2494 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)
-
Yes
First a note that I do not use this event, so am indifferent as to whether it is fixed. Just reporting to make sure it is documented.
First the javadocs for the VillagerReplenishTradeEvent is outdated, reflecting outdated villager trading mechanics. Specifically...
- Main class comment mentions the maximum uses increasing. This no longer happens in Minecraft 1.15. Their Trade uses gets reset down to zero, instead of increasing the max uses now.
- getBonus/setBonus. If one looks at the implementation of this event (where it is called); you will notice that this actually effects the special price parameter of the trade. No longer reflects the changing of the max uses.
This leads into the crux of the issue. Is that the event is called in the wrong place for when the trade is replenished. Trades are now replenished/restocked when a villager works. (BehaviorWork).
The best foolproof way to explain where to find where the trades are restocked is to search usages of resetUses() in MerchantRecipe.
The possibility of restocking is only triggered by the work behavior. Trades will restock if enough world time has passed since they last restocked and/or if it hasn't met the maximum number of restocks in the day and and obviously needs to restock.
I hope this is helpful to whoever wants to take this issue on.
If one were to rename the current event to be more appropriately named. It would be VillagerIncreaseSpecialPriceEvent. I guess.