gcInventory.setInventorySlotContents(i, null);
}
}
else
{
throw new WrongUsageException("Invalid GCInv command. Usage: " + this.getCommandUsage(icommandsender), new Object[0]);
}
}
else
{
// Special rule for 'restore' command if player not found -
// look to see if the player is offline (i.e. had a saved
// inventory already)
if (astring[0].equalsIgnoreCase("restore"))
{
ItemStack[] saveinv = CommandGCInv.savedata.get(astring[1].toLowerCase());
if (saveinv != null)
{
System.out.println("[GCInv] Restore command for offline player " + astring[1] + ", setting to restore GCInv on next login.");
CommandGCInv.dontload.remove(astring[1].toLowerCase()); // Now
// it
// can
// autoload
// on
// next
// player
// logon
return;
}
}
// No player found, and not a 'restore' command
if (astring[0].equalsIgnoreCase("clear") || astring[0].equalsIgnoreCase("save") || astring[0].equalsIgnoreCase("drop"))
{
System.out.println("GCInv command: player " + astring[1] + " not found.");
}
else
{
throw new WrongUsageException("Invalid GCInv command. Usage: " + this.getCommandUsage(icommandsender), new Object[0]);
}
}
}
catch (final Exception e)
{
System.out.println(e.toString());
e.printStackTrace();
}
}
else
{
throw new WrongUsageException("Not enough command arguments! Usage: " + this.getCommandUsage(icommandsender), new Object[0]);
}
}