diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/item/trading/Merchant.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/item/trading/Merchant.java.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/item/trading/Merchant.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/item/trading/Merchant.java.patch new file mode 100644 index 0000000000..f4aecf8456 --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/item/trading/Merchant.java.patch @@ -0,0 +1,45 @@ +--- a/net/minecraft/world/item/trading/Merchant.java ++++ b/net/minecraft/world/item/trading/Merchant.java +@@ -5,12 +5,12 @@ + import net.minecraft.network.chat.Component; + import net.minecraft.sounds.SoundEvent; + import net.minecraft.world.SimpleMenuProvider; +-import net.minecraft.world.entity.player.Inventory; + import net.minecraft.world.entity.player.Player; + import net.minecraft.world.inventory.MerchantMenu; + import net.minecraft.world.item.ItemStack; + + public interface Merchant { ++ + void setTradingPlayer(@Nullable Player tradingPlayer); + + @Nullable +@@ -37,16 +37,21 @@ + } + + default void openTradingScreen(Player player, Component displayName, int level) { +- OptionalInt optionalInt = player.openMenu( +- new SimpleMenuProvider((containerId, inventory, player1) -> new MerchantMenu(containerId, inventory, this), displayName) +- ); +- if (optionalInt.isPresent()) { +- MerchantOffers offers = this.getOffers(); +- if (!offers.isEmpty()) { +- player.sendMerchantOffers(optionalInt.getAsInt(), offers, level, this.getVillagerXp(), this.showProgressBar(), this.canRestock()); ++ OptionalInt optionalint = player.openMenu(new SimpleMenuProvider((j, playerinventory, entityhuman1) -> { ++ return new MerchantMenu(j, playerinventory, this); ++ }, displayName)); ++ ++ if (optionalint.isPresent()) { ++ MerchantOffers merchantrecipelist = this.getOffers(); ++ ++ if (!merchantrecipelist.isEmpty()) { ++ player.sendMerchantOffers(optionalint.getAsInt(), merchantrecipelist, level, this.getVillagerXp(), this.showProgressBar(), this.canRestock()); + } + } ++ + } + + boolean isClientSide(); ++ ++ org.bukkit.craftbukkit.inventory.CraftMerchant getCraftMerchant(); // CraftBukkit + } |