mirror of
https://github.com/filoghost/ChestCommands.git
synced 2024-11-26 20:16:16 +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 {
|
try {
|
||||||
ItemStackReader reader = new ItemStackReader(command, true);
|
ItemStackReader reader = new ItemStackReader(command, true);
|
||||||
itemToGive = reader.createStack();
|
itemToGive = reader.createStack();
|
||||||
|
|
||||||
} catch (FormatException e) {
|
} catch (FormatException e) {
|
||||||
errorMessage = ChatColor.RED + "Invalid item to give: " + e.getMessage();
|
errorMessage = ChatColor.RED + "Invalid item to give: " + e.getMessage();
|
||||||
@ -32,7 +32,7 @@ public class GiveIconCommand extends IconCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.getInventory().addItem(itemToGive);
|
player.getInventory().addItem(itemToGive.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user