diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/inventory/ContainerBrewingStand.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/inventory/ContainerBrewingStand.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/inventory/ContainerBrewingStand.patch b/patch-remap/og/net/minecraft/world/inventory/ContainerBrewingStand.patch new file mode 100644 index 0000000000..9fa2aa3fdd --- /dev/null +++ b/patch-remap/og/net/minecraft/world/inventory/ContainerBrewingStand.patch @@ -0,0 +1,59 @@ +--- a/net/minecraft/world/inventory/ContainerBrewingStand.java ++++ b/net/minecraft/world/inventory/ContainerBrewingStand.java +@@ -13,6 +13,11 @@ + import net.minecraft.world.item.alchemy.PotionRegistry; + import net.minecraft.world.item.alchemy.PotionUtil; + ++// CraftBukkit start ++import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer; ++import org.bukkit.craftbukkit.inventory.CraftInventoryView; ++// CraftBukkit end ++ + public class ContainerBrewingStand extends Container { + + private static final int BOTTLE_SLOT_START = 0; +@@ -29,12 +34,18 @@ + private final IContainerProperties brewingStandData; + private final Slot ingredientSlot; + ++ // CraftBukkit start ++ private CraftInventoryView bukkitEntity = null; ++ private PlayerInventory player; ++ // CraftBukkit end ++ + public ContainerBrewingStand(int i, PlayerInventory playerinventory) { + this(i, playerinventory, new InventorySubcontainer(5), new ContainerProperties(2)); + } + + public ContainerBrewingStand(int i, PlayerInventory playerinventory, IInventory iinventory, IContainerProperties icontainerproperties) { + super(Containers.BREWING_STAND, i); ++ player = playerinventory; // CraftBukkit + checkContainerSize(iinventory, 5); + checkContainerDataCount(icontainerproperties, 2); + this.brewingStand = iinventory; +@@ -62,6 +73,7 @@ + + @Override + public boolean stillValid(EntityHuman entityhuman) { ++ if (!this.checkReachable) return true; // CraftBukkit + return this.brewingStand.stillValid(entityhuman); + } + +@@ -199,4 +211,17 @@ + return 64; + } + } ++ ++ // CraftBukkit start ++ @Override ++ public CraftInventoryView getBukkitView() { ++ if (bukkitEntity != null) { ++ return bukkitEntity; ++ } ++ ++ CraftInventoryBrewer inventory = new CraftInventoryBrewer(this.brewingStand); ++ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this); ++ return bukkitEntity; ++ } ++ // CraftBukkit end + } |