mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-09 20:21:07 +00:00
Prevent Zombies from picking up shop item
This commit is contained in:
parent
08286e6beb
commit
04e63c6225
@ -79,13 +79,14 @@ public class Shop {
|
|||||||
itemMeta.setLore(lore);
|
itemMeta.setLore(lore);
|
||||||
|
|
||||||
itemLocation = new Location(location.getWorld(), hologram.getLocation().getX(), location.getY() + 1, hologram.getLocation().getZ());
|
itemLocation = new Location(location.getWorld(), hologram.getLocation().getX(), location.getY() + 1, hologram.getLocation().getZ());
|
||||||
itemStack = new ItemStack(product.getType(), 1, product.getDurability());
|
itemStack = new ItemStack(product);
|
||||||
itemStack.setItemMeta(itemMeta);
|
itemStack.setAmount(1);
|
||||||
|
|
||||||
item = location.getWorld().dropItem(itemLocation, itemStack);
|
item = location.getWorld().dropItem(itemLocation, itemStack);
|
||||||
item.setVelocity(new Vector(0, 0, 0));
|
item.setVelocity(new Vector(0, 0, 0));
|
||||||
item.setMetadata("shopItem", new FixedMetadataValue(plugin, true));
|
item.setMetadata("shopItem", new FixedMetadataValue(plugin, true));
|
||||||
item.setCustomNameVisible(false);
|
item.setCustomNameVisible(false);
|
||||||
|
item.setPickupDelay(Integer.MAX_VALUE);
|
||||||
|
|
||||||
this.item = item;
|
this.item = item;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user