PaperMC/nms-patches/MerchantRecipe.patch

30 lines
973 B
Diff
Raw Normal View History

2016-02-29 22:32:46 +01:00
--- a/net/minecraft/server/MerchantRecipe.java
+++ b/net/minecraft/server/MerchantRecipe.java
2016-05-10 13:47:39 +02:00
@@ -1,6 +1,7 @@
2016-02-29 22:32:46 +01:00
package net.minecraft.server;
2016-05-10 13:47:39 +02:00
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; // CraftBukkit
2016-02-29 22:32:46 +01:00
public class MerchantRecipe {
2016-05-10 13:47:39 +02:00
@@ -10,6 +11,18 @@
2016-02-29 22:32:46 +01:00
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);