Examples of InventoryExtended


Examples of micdoodle8.mods.galacticraft.core.inventory.InventoryExtended

                {
                    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]);
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.inventory.InventoryExtended

        // has yet been run.
        // Dontload resets to nothing on server restart so that all will
        // auto-restore on a server restart.
        {
            ItemStack[] saveinv = CommandGCInv.savedata.get(theName);
            InventoryExtended gcInventory = GCPlayerStats.get(thePlayer).extendedInventory;
            for (int i = 0; i < gcInventory.getSizeInventory(); i++)
            {
                gcInventory.setInventorySlotContents(i, saveinv[i]);
            }
            CommandGCInv.savedata.remove(theName);
            CommandGCInv.writefile();
            System.out.println("[GCInv] Restored GC inventory slots of " + thePlayer.getGameProfile().getName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.