summaryrefslogtreecommitdiffstats
path: root/nms-patches/MerchantRecipe.patch
blob: 7a85d094627fc629ad2fd3cd9551038a85375b0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- a/net/minecraft/server/MerchantRecipe.java
+++ b/net/minecraft/server/MerchantRecipe.java
@@ -1,6 +1,7 @@
 package net.minecraft.server;
 
 import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; // CraftBukkit
 
 public class MerchantRecipe {
 
@@ -10,6 +11,18 @@
     public int uses;
     public int maxUses;
     public boolean rewardExp;
+    // CraftBukkit start
+    private CraftMerchantRecipe bukkitHandle;
+
+    public CraftMerchantRecipe asBukkit() {
+        return (bukkitHandle == null) ? bukkitHandle = new CraftMerchantRecipe(this) : bukkitHandle;
+    }
+
+    public MerchantRecipe(ItemStack itemstack, ItemStack itemstack1, ItemStack itemstack2, int i, int j, CraftMerchantRecipe bukkit) {
+        this(itemstack, itemstack1, itemstack2, i, j);
+        this.bukkitHandle = bukkit;
+    }
+    // CraftBukkit end
 
     public MerchantRecipe(NBTTagCompound nbttagcompound) {
         this.a(nbttagcompound);