schedulable = false)
public boolean giveItem(final String playerName, final int aID, final int aAmount, final byte data) {
final Player player = Bukkit.getPlayer(playerName);
if (player != null) {
final ItemStack stack = new ItemStack(aID, aAmount, (short) 0, data);
final PlayerInventory inventory = player.getInventory();
final int maxStackSize = stack.getMaxStackSize();
if (stack.getAmount() <= maxStackSize)
inventory.addItem(stack);
final int amount = stack.getAmount();
final int quotient = amount / maxStackSize;
final int remainder = amount % maxStackSize;
for (int i = 0; i < quotient; i++)
inventory.addItem(new ItemStack(aID, maxStackSize, (short) 0, data));
if (remainder > 0)
inventory.addItem(new ItemStack(aID, remainder, (short) 0, data));
return true;
}
return false;
}