void WriteMetadata() { nbt.Write(NbtTagType.Compound); nbt.Write("Metadata"); nbt.Write(NbtTagType.Compound); nbt.Write("CPE"); LocalPlayer p = game.LocalPlayer; nbt.WriteCpeExtCompound("ClickDistance", 1); nbt.Write(NbtTagType.Int16); nbt.Write("Distance"); nbt.WriteInt16((short)(p.ReachDistance * 32)); nbt.Write(NbtTagType.End); nbt.WriteCpeExtCompound("EnvWeatherType", 1); nbt.Write(NbtTagType.Int8); nbt.Write("WeatherType"); nbt.WriteUInt8((byte)map.Env.Weather); nbt.Write(NbtTagType.End); nbt.WriteCpeExtCompound("EnvMapAppearance", 1); nbt.Write(NbtTagType.Int8); nbt.Write("SideBlock"); nbt.WriteUInt8(map.Env.SidesBlock); nbt.Write(NbtTagType.Int8); nbt.Write("EdgeBlock"); nbt.WriteUInt8(map.Env.EdgeBlock); nbt.Write(NbtTagType.Int16); nbt.Write("SideLevel"); nbt.WriteInt16((short)map.Env.EdgeHeight); nbt.Write(NbtTagType.String); string url = game.World.TextureUrl == null ? "" : game.World.TextureUrl; nbt.Write("TextureURL"); nbt.Write(url); nbt.Write(NbtTagType.End); nbt.WriteCpeExtCompound("EnvColors", 1); WriteColourCompound("Sky", map.Env.SkyCol); WriteColourCompound("Cloud", map.Env.CloudsCol); WriteColourCompound("Fog", map.Env.FogCol); WriteColourCompound("Ambient", map.Env.Shadowlight); WriteColourCompound("Sunlight", map.Env.Sunlight); nbt.Write(NbtTagType.End); nbt.WriteCpeExtCompound("BlockDefinitions", 1); for (int block = 1; block < 256; block++) { if (BlockInfo.IsCustomDefined((byte)block)) { WriteBlockDefinitionCompound((byte)block); } } nbt.Write(NbtTagType.End); nbt.Write(NbtTagType.End); nbt.Write(NbtTagType.Compound); nbt.Write("ClassiCube"); nbt.Write(NbtTagType.Compound); nbt.Write("RandomSeed"); nbt.Write(NbtTagType.Int64); nbt.Write("RandomSeed"); nbt.WriteInt64((long)game.Server.seed); nbt.Write(NbtTagType.End); nbt.Write(NbtTagType.End); nbt.Write(NbtTagType.End); }