Jump to content

scaroyder

Members
  • Posts

    5
  • Joined

  • Last visited

scaroyder's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Yep I've digged further and it seems like that .schematic format is completely screwed in latest versions of mc. Need to use sponges .schem Thanks anyway!
  2. public static Schematic get(File f) { CompoundTag nbtdata = NbtIo.readCompressed(f); short width = nbtdata.getShort("Width"); short height = nbtdata.getShort("Height"); short length = nbtdata.getShort("Length"); byte[] blocks = nbtdata.getByteArray("Blocks"); byte[] data = nbtdata.getByteArray("Data"); return new Schematic(width, height, length, blocks, data); } public Schematic(short width, short height, short length, byte[] blocks, byte[] data) { this.width = width; this.height = height; this.length = length; this.blocks = blocks; this.data = data; } and then I'm using Schematic instance to build schematic in world by calling Level#setBlock. Well, I supposed to be doing that, but I can't because I dont know where should I get BlockState. In 1.6.4 I were able to place a block in world just with coords, blockID and blockdata.
  3. have a look at net.minecraft.nbt.NbtIo Im using it to load schematics from files or to send NBT data via packets between server/client. Well, I used to do so in 1.6.4, lol. In those times it was named CompressedStreamTools. The goal im trying to achive is to make schematics import much easier at the server side. I will be able to dl some schematic, put it into server subfolder, and then manipulate with it as I want (dynamically spawn the schematic for some event, or add it to custom worldgen, etc etc etc)
  4. actually .schematic file just contains a nbt compound, so why not? I just read it with NbtIo without any problems...
  5. I've got a problem with schematics generation. So actually after reading .schematic file I'm getting two arrays of bytes (blockid and blockdata). The problem is I dont know how to obtain a BlockState for Level#setBlock (2nd parameter), because I dont know what kind of block I'm going to place, just id and data, and I see no static plug for this parameter (Like BlockState.WHATEVER). So how can I deal with it?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.