diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/MerchantContainer.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/MerchantContainer.java.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/MerchantContainer.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/MerchantContainer.java.patch new file mode 100644 index 0000000000..b4ca78ad64 --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/MerchantContainer.java.patch @@ -0,0 +1,63 @@ +--- a/net/minecraft/world/inventory/MerchantContainer.java ++++ b/net/minecraft/world/inventory/MerchantContainer.java +@@ -9,6 +12,13 @@ + import net.minecraft.world.item.trading.Merchant; + import net.minecraft.world.item.trading.MerchantOffer; + import net.minecraft.world.item.trading.MerchantOffers; ++// CraftBukkit start ++import java.util.List; ++import org.bukkit.Location; ++import org.bukkit.craftbukkit.entity.CraftHumanEntity; ++import org.bukkit.craftbukkit.entity.CraftAbstractVillager; ++import org.bukkit.entity.HumanEntity; ++// CraftBukkit end + + public class MerchantContainer implements Container { + private final Merchant merchant; +@@ -18,6 +29,46 @@ + private int selectionHint; + private int futureXp; + ++ // CraftBukkit start - add fields and methods ++ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); ++ private int maxStack = MAX_STACK; ++ ++ public List<ItemStack> getContents() { ++ return this.itemStacks; ++ } ++ ++ public void onOpen(CraftHumanEntity who) { ++ transaction.add(who); ++ } ++ ++ public void onClose(CraftHumanEntity who) { ++ transaction.remove(who); ++ merchant.setTradingPlayer((Player) null); // SPIGOT-4860 ++ } ++ ++ public List<HumanEntity> getViewers() { ++ return transaction; ++ } ++ ++ @Override ++ public int getMaxStackSize() { ++ return maxStack; ++ } ++ ++ public void setMaxStackSize(int i) { ++ maxStack = i; ++ } ++ ++ public org.bukkit.inventory.InventoryHolder getOwner() { ++ return (merchant instanceof AbstractVillager) ? (CraftAbstractVillager) ((AbstractVillager) this.merchant).getBukkitEntity() : null; ++ } ++ ++ @Override ++ public Location getLocation() { ++ return (merchant instanceof Villager) ? ((Villager) this.merchant).getBukkitEntity().getLocation() : null; ++ } ++ // CraftBukkit end ++ + public MerchantContainer(Merchant merchant) { + this.merchant = merchant; + } |