Skip to content

Commit

Permalink
Fixed Barrel Dupe Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0wStorm committed Dec 22, 2013
1 parent 71a8a66 commit 471392d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/com/dre/brewery/Barrel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 471392d

Please sign in to comment.