mirror of
https://github.com/filoghost/ChestCommands.git
synced 2024-11-23 02:25:26 +01:00
Try to avoid a Bukkit bug modifying the item after giving it to a player
This commit is contained in:
parent
fb129c4173
commit
c0ca5d195b
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user