From 9ae33818af0122b80bc7e771b1710d9ceb90aa1f Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 6 Feb 2015 20:42:11 +1100 Subject: [PATCH] Fix SPIGOT-528: Incorrect owner for merchant inventories. --- nms-patches/InventoryMerchant.patch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nms-patches/InventoryMerchant.patch b/nms-patches/InventoryMerchant.patch index 5782fe5d89..07f3854205 100644 --- a/nms-patches/InventoryMerchant.patch +++ b/nms-patches/InventoryMerchant.patch @@ -1,18 +1,19 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/InventoryMerchant.java 2014-11-28 17:43:43.209707433 +0000 -+++ src/main/java/net/minecraft/server/InventoryMerchant.java 2014-11-28 17:38:23.000000000 +0000 -@@ -1,5 +1,11 @@ +--- ../work/decompile-8eb82bde/net/minecraft/server/InventoryMerchant.java 2015-02-06 20:41:38.537609199 +1100 ++++ src/main/java/net/minecraft/server/InventoryMerchant.java 2015-02-06 20:41:38.537609199 +1100 +@@ -1,5 +1,12 @@ package net.minecraft.server; +// CraftBukkit start +import java.util.List; +import org.bukkit.craftbukkit.entity.CraftHumanEntity; ++import org.bukkit.craftbukkit.entity.CraftVillager; +import org.bukkit.entity.HumanEntity; +// CraftBukkit end + public class InventoryMerchant implements IInventory { private final IMerchant merchant; -@@ -8,6 +14,35 @@ +@@ -8,6 +15,35 @@ private MerchantRecipe recipe; private int e; @@ -41,14 +42,14 @@ + } + + public org.bukkit.inventory.InventoryHolder getOwner() { -+ return player.getBukkitEntity(); ++ return (CraftVillager) ((EntityVillager) this.merchant).getBukkitEntity(); + } + // CraftBukkit end + public InventoryMerchant(EntityHuman entityhuman, IMerchant imerchant) { this.player = entityhuman; this.merchant = imerchant; -@@ -94,7 +129,7 @@ +@@ -94,7 +130,7 @@ } public int getMaxStackSize() {