{
GCPlayerStats stats = GCPlayerStats.get(thePlayer);
if (astring[0].equalsIgnoreCase("drop"))
{
InventoryExtended gcInventory = stats.extendedInventory;
gcInventory.dropExtendedItems(thePlayer);
}
else if (astring[0].equalsIgnoreCase("save"))
{
InventoryExtended gcInventory = stats.extendedInventory;
ItemStack[] saveinv = new ItemStack[gcInventory.getSizeInventory()];
for (int i = 0; i < gcInventory.getSizeInventory(); i++)
{
saveinv[i] = gcInventory.getStackInSlot(i);
gcInventory.setInventorySlotContents(i, null);
}
CommandGCInv.savedata.put(astring[1].toLowerCase(), saveinv);
CommandGCInv.dontload.add(astring[1].toLowerCase());
CommandGCInv.writefile();
System.out.println("[GCInv] Saving and clearing GC inventory slots of " + thePlayer.getGameProfile().getName());
}
else if (astring[0].equalsIgnoreCase("restore"))
{
ItemStack[] saveinv = CommandGCInv.savedata.get(astring[1].toLowerCase());
CommandGCInv.dontload.remove(astring[1].toLowerCase());
if (saveinv == null)
{
System.out.println("[GCInv] Tried to restore but player " + thePlayer.getGameProfile().getName() + " had no saved GC inventory items.");
return;
}
CommandGCInv.doLoad(thePlayer);
}
else if (astring[0].equalsIgnoreCase("clear"))
{
InventoryExtended gcInventory = stats.extendedInventory;
for (int i = 0; i < gcInventory.getSizeInventory(); i++)
{
gcInventory.setInventorySlotContents(i, null);
}
}
else
{
throw new WrongUsageException("Invalid GCInv command. Usage: " + this.getCommandUsage(icommandsender), new Object[0]);