Add PlayerTradeEvent and PlayerPurchaseEvent

Co-authored-by: Alexander <protonull@protonmail.com>
This commit is contained in:
Jake Potrebic
2020-07-02 16:12:10 -07:00
parent 46c2fbfb74
commit 597ce940a4
6 changed files with 206 additions and 7 deletions

View File

@@ -1,6 +1,14 @@
--- a/net/minecraft/world/item/trading/Merchant.java
+++ b/net/minecraft/world/item/trading/Merchant.java
@@ -54,4 +54,6 @@
@@ -20,6 +20,7 @@
void overrideOffers(MerchantOffers offers);
+ default void processTrade(MerchantOffer merchantRecipe, @Nullable io.papermc.paper.event.player.PlayerPurchaseEvent event) { this.notifyTrade(merchantRecipe); } // Paper
void notifyTrade(MerchantOffer offer);
void notifyTradeUpdated(ItemStack stack);
@@ -54,4 +55,6 @@
boolean isClientSide();
boolean stillValid(Player player);