How to load Schematics with chest contents...

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

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

    SoS_Dylan

    The schematic that i'm loading defiantly has the data for chests because I loaded it perfectly with MCEdit. Its the way the code loads it. Any ideas would be amasing.
    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");
    15.  
    16. fis.close();
    17.  
    18. return new Schematic(file.getName(), width, height, length, "", blocks, data);
    19. } catch (Exception e) {
    20. e.printStackTrace();
    21. }
    22. return null;
    23. }


    Anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  2. Offline

    Plo124

    SoS_Dylan Please don't bump within 24 hours.
     
Thread Status:
Not open for further replies.

Share This Page