summaryrefslogtreecommitdiffstats
path: root/nms-patches/MerchantRecipe.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/MerchantRecipe.patch')
-rw-r--r--nms-patches/MerchantRecipe.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/nms-patches/MerchantRecipe.patch b/nms-patches/MerchantRecipe.patch
new file mode 100644
index 00000000..a5a3a802
--- /dev/null
+++ b/nms-patches/MerchantRecipe.patch
@@ -0,0 +1,29 @@
+--- a/net/minecraft/server/MerchantRecipe.java
++++ b/net/minecraft/server/MerchantRecipe.java
+@@ -1,5 +1,7 @@
+ package net.minecraft.server;
+
++import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe;
++
+ public class MerchantRecipe {
+
+ public ItemStack buyingItem1;
+@@ -8,6 +10,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);