From 471392dc68f3465786ee1ae7582020dae67df979 Mon Sep 17 00:00:00 2001 From: Sn0wStorm Date: Sun, 22 Dec 2013 03:49:50 +0100 Subject: [PATCH] Fixed Barrel Dupe Bug --- src/com/dre/brewery/Barrel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/dre/brewery/Barrel.java b/src/com/dre/brewery/Barrel.java index 4258c7a9..cf1fa1c8 100644 --- a/src/com/dre/brewery/Barrel.java +++ b/src/com/dre/brewery/Barrel.java @@ -3,6 +3,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.Map; +import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.block.Block; import org.bukkit.inventory.Inventory; @@ -129,6 +130,9 @@ public static boolean create(Block spigot) { // removes a barrel, throwing included potions to the ground public void remove(Block broken) { if (inventory != null) { + for (HumanEntity human : inventory.getViewers()) { + human.closeInventory(); + } ItemStack[] items = inventory.getContents(); for (ItemStack item : items) { if (item != null) {