From c0ca5d195b7fe74b107f7b0977b5ff2cf16e9415 Mon Sep 17 00:00:00 2001 From: filoghost Date: Sat, 8 Aug 2015 21:07:41 +0200 Subject: [PATCH] Try to avoid a Bukkit bug modifying the item after giving it to a player --- .../chestcommands/internal/icon/command/GiveIconCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChestCommands/src/com/gmail/filoghost/chestcommands/internal/icon/command/GiveIconCommand.java b/ChestCommands/src/com/gmail/filoghost/chestcommands/internal/icon/command/GiveIconCommand.java index e8eccb2..818359b 100644 --- a/ChestCommands/src/com/gmail/filoghost/chestcommands/internal/icon/command/GiveIconCommand.java +++ b/ChestCommands/src/com/gmail/filoghost/chestcommands/internal/icon/command/GiveIconCommand.java @@ -18,7 +18,7 @@ public class GiveIconCommand extends IconCommand { try { ItemStackReader reader = new ItemStackReader(command, true); - itemToGive = reader.createStack(); + itemToGive = reader.createStack(); } catch (FormatException e) { errorMessage = ChatColor.RED + "Invalid item to give: " + e.getMessage(); @@ -32,7 +32,7 @@ public class GiveIconCommand extends IconCommand { return; } - player.getInventory().addItem(itemToGive); + player.getInventory().addItem(itemToGive.clone()); } }