diff --git a/src/de/epiceric/shopchest/ShopChest.java b/src/de/epiceric/shopchest/ShopChest.java index e78e18b..784ec05 100644 --- a/src/de/epiceric/shopchest/ShopChest.java +++ b/src/de/epiceric/shopchest/ShopChest.java @@ -20,6 +20,9 @@ import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.permission.Permission; import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.World; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.plugin.RegisteredServiceProvider; import org.bukkit.plugin.java.JavaPlugin; @@ -268,6 +271,17 @@ public class ShopChest extends JavaPlugin { for (Shop shop : ShopUtils.getShops()) { ShopUtils.removeShop(shop, false); } + + for (World world : Bukkit.getWorlds()) { + for (Entity entity : world.getEntities()) { + if (entity instanceof Item) { + Item item = (Item) entity; + if (item.hasMetadata("shopItem")) { + item.remove(); + } + } + } + } } private void initializeShops() {