setContent

Discussion in 'Plugin Development' started by Moon_werewolf, Mar 18, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Moon_werewolf

    I get a odd error when i set content in a chest

    Code:
    08:45:14 [ALLVARLIG] java.lang.IllegalArgumentException: Invalid inventory size;
    expected 27 or less
    08:45:14 [ALLVARLIG]    at org.bukkit.craftbukkit.inventory.CraftInventory.setCo
    ntents(CraftInventory.java:60)
    08:45:14 [ALLVARLIG]    at swe.moon_werewolf.nanobot.blueprint.NanoMemmory.chang
    eBlock(NanoMemmory.java:177)
    08:45:14 [ALLVARLIG]    at swe.moon_werewolf.nanobot.NanoOrder.process(NanoOrder
    .java:109)
    08:45:14 [ALLVARLIG]    at swe.moon_werewolf.nanobot.blueprint.NanoFamily.runRem
    ote(NanoFamily.java:490)
    08:45:14 [ALLVARLIG]    at swe.moon_werewolf.nanobot.cpu.CpuCoreSlow.run(CpuCore
    Slow.java:48)
    08:45:14 [ALLVARLIG]    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainT
    hreadHeartbeat(CraftScheduler.java:126)
    08:45:14 [ALLVARLIG]    at net.minecraft.server.MinecraftServer.w(MinecraftServe
    r.java:520)
    08:45:14 [ALLVARLIG]    at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:452)
    08:45:14 [ALLVARLIG]    at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:490)
    everything works fine. i get the content in the chest but i still get that error. It also only happens when i do it on a double chest.

    Code:
    Inventory inv = tr.getBlockInventory(block);
                if(items != null && inv != null)
                {
                    inv.setContents(items);// <-- This is code row NanoMemmory.java:177
                }
    I use this code to get the inventory
    Code:
    Inventory inv = tr.getBlockInventory(b);
            if(inv != null)
            {
                items = inv.getContents().clone();
            }
     
Thread Status:
Not open for further replies.

Share This Page