From 04e63c6225f83da31afedf45fe0d794b52e8554b Mon Sep 17 00:00:00 2001 From: Eric Biedert Date: Fri, 24 Jun 2016 14:53:20 +0200 Subject: [PATCH] Prevent Zombies from picking up shop item --- src/de/epiceric/shopchest/shop/Shop.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/de/epiceric/shopchest/shop/Shop.java b/src/de/epiceric/shopchest/shop/Shop.java index a719622..109963c 100644 --- a/src/de/epiceric/shopchest/shop/Shop.java +++ b/src/de/epiceric/shopchest/shop/Shop.java @@ -79,13 +79,14 @@ public class Shop { itemMeta.setLore(lore); itemLocation = new Location(location.getWorld(), hologram.getLocation().getX(), location.getY() + 1, hologram.getLocation().getZ()); - itemStack = new ItemStack(product.getType(), 1, product.getDurability()); - itemStack.setItemMeta(itemMeta); + itemStack = new ItemStack(product); + itemStack.setAmount(1); item = location.getWorld().dropItem(itemLocation, itemStack); item.setVelocity(new Vector(0, 0, 0)); item.setMetadata("shopItem", new FixedMetadataValue(plugin, true)); item.setCustomNameVisible(false); + item.setPickupDelay(Integer.MAX_VALUE); this.item = item; }