public static void GlobalBlockchange(Level level, int b, byte type, byte extType) { ushort x, y, z; level.IntToPos(b, out x, out y, out z); GlobalBlockchange(level, x, y, z, type, extType); }
public static void GlobalBlockchange(Level level, int b, ExtBlock block) { ushort x, y, z; level.IntToPos(b, out x, out y, out z); GlobalBlockchange(level, x, y, z, block); }
public override Level Read(Stream src, string name, bool metadata) { NbtFile file = new NbtFile(); file.LoadFromStream(src); NbtCompound root = file.RootTag; byte[] raw = root["Blocks"].ByteArrayValue; byte[] meta = root["Data"].ByteArrayValue; int width = root["Width"].ShortValue; int height = root["Height"].ShortValue; int length = root["Length"].ShortValue; Level lvl = new Level(name, (ushort)width, (ushort)height, (ushort)length); byte[] blocks = lvl.blocks; for (int i = 0; i < blocks.Length; i++) { blocks[i] = (byte)mcConv[raw[i], meta[i] & 0x0F]; } for (int i = 0; i < blocks.Length; i++) { byte block = blocks[i]; if (block < Block.CpeCount) { continue; } blocks[i] = Block.custom_block; ushort x, y, z; lvl.IntToPos(i, out x, out y, out z); lvl.FastSetExtTile(x, y, z, block); } return(lvl); }