Chest Inventory

Discussion in 'Plugin Development' started by SoS_Dylan, Nov 30, 2013.

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

    SoS_Dylan

    How would I be able to get items from a Chest in a Schematic file?

    Code:java
    1. public static Schematic loadScheamtic(File file) {
    2. try {
    3. InputStream fis = new FileInputStream(file);
    4. NBTTagCompound nbtdata = NBTCompressedStreamTools.a(fis);
    5.  
    6. short width = nbtdata.getShort("Width");
    7. short height = nbtdata.getShort("Height");
    8. short length = nbtdata.getShort("Length");
    9.  
    10. byte[] blocks = nbtdata.getByteArray("Blocks");
    11. byte[] data = nbtdata.getByteArray("Data");
    12.  
    13. // NBTTagList entities = nbtdata.getList("Entities");
    14. NBTTagList tileentities = nbtdata.getList("TileEntities"); // THIS IS WHERE THE CHEST INVENTORY IS LOACATED
    15.  
    16. fis.close();
    17.  
    18. return new Schematic(file.getName(), width, height, length, "", blocks, data, null);
    19. } catch (Exception e) {
    20. e.printStackTrace();
    21. }
    22. return null;
    23. }
     
Thread Status:
Not open for further replies.

Share This Page