From 7fb11d2ffb3de60b34ad670c5464e93b9961aee8 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Wed, 2 Mar 2022 12:15:56 +0200 Subject: [PATCH 01/19] Support 1.18.2 --- .../limbo/connection/ClientConnection.java | 3 + .../limbo/connection/PacketSnapshots.java | 4 + .../packets/play/PacketEmptyChunk.java | 51 + .../protocol/packets/play/PacketJoinGame.java | 24 +- .../nanit/limbo/protocol/registry/State.java | 31 +- .../limbo/protocol/registry/Version.java | 3 +- src/main/java/ru/nanit/limbo/util/Colors.java | 5 +- .../world/dimension/DimensionRegistry.java | 44 +- .../{codec_new.snbt => codec_1_16.snbt} | 0 .../resources/dimension/codec_1_18_2.snbt | 2093 +++++++++++++++++ 10 files changed, 2216 insertions(+), 42 deletions(-) create mode 100644 src/main/java/ru/nanit/limbo/protocol/packets/play/PacketEmptyChunk.java rename src/main/resources/dimension/{codec_new.snbt => codec_1_16.snbt} (100%) create mode 100644 src/main/resources/dimension/codec_1_18_2.snbt diff --git a/src/main/java/ru/nanit/limbo/connection/ClientConnection.java b/src/main/java/ru/nanit/limbo/connection/ClientConnection.java index 4d4324b..28b7476 100644 --- a/src/main/java/ru/nanit/limbo/connection/ClientConnection.java +++ b/src/main/java/ru/nanit/limbo/connection/ClientConnection.java @@ -154,6 +154,9 @@ public class ClientConnection extends ChannelInboundHandlerAdapter { if (PacketSnapshots.PACKET_HEADER_AND_FOOTER != null) writePacket(PacketSnapshots.PACKET_HEADER_AND_FOOTER); + if (clientVersion.moreOrEqual(Version.V1_18_2)) + writePacket(PacketSnapshots.PACKET_EMPTY_CHUNK); + sendKeepAlive(); } diff --git a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java index 9fc1d48..8c65165 100644 --- a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java +++ b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java @@ -43,6 +43,7 @@ public final class PacketSnapshots { public static PacketSnapshot PACKET_JOIN_MESSAGE; public static PacketSnapshot PACKET_BOSS_BAR; public static PacketSnapshot PACKET_HEADER_AND_FOOTER; + public static PacketSnapshot PACKET_EMPTY_CHUNK; public static PacketSnapshot PACKET_TITLE_TITLE; public static PacketSnapshot PACKET_TITLE_SUBTITLE; @@ -52,6 +53,7 @@ public final class PacketSnapshots { public static PacketSnapshot PACKET_TITLE_LEGACY_SUBTITLE; public static PacketSnapshot PACKET_TITLE_LEGACY_TIMES; + private PacketSnapshots() { } public static void initPackets(LimboServer server) { @@ -108,6 +110,8 @@ public final class PacketSnapshots { PACKET_DECLARE_COMMANDS = PacketSnapshot.of(declareCommands); + PACKET_EMPTY_CHUNK = PacketSnapshot.of(new PacketEmptyChunk()); + if (server.getConfig().isUseHeaderAndFooter()) { PacketPlayerListHeader header = new PacketPlayerListHeader(); header.setHeader(server.getConfig().getPlayerListHeader()); diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketEmptyChunk.java b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketEmptyChunk.java new file mode 100644 index 0000000..4be6433 --- /dev/null +++ b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketEmptyChunk.java @@ -0,0 +1,51 @@ +package ru.nanit.limbo.protocol.packets.play; + +import io.netty.buffer.ByteBufOutputStream; +import ru.nanit.limbo.protocol.ByteMessage; +import ru.nanit.limbo.protocol.PacketOut; +import ru.nanit.limbo.protocol.registry.Version; + +import java.io.IOException; + +public class PacketEmptyChunk implements PacketOut { + + @Override + public void encode(ByteMessage msg, Version version) { + msg.writeInt(0); + msg.writeInt(0); + + writeHeightmaps(msg, version.getProtocolNumber()); + + byte[] sectionData = new byte[]{0, 0, 0, 0, 0, 0, 1, 0}; + msg.writeVarInt(sectionData.length * 16); + for (int i = 0; i < 16; i++) { + msg.writeBytes(sectionData); + } + + msg.writeVarInt(0); + + byte[] lightData = new byte[]{1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, -1, -1, 0, 0}; + msg.writeBytes(lightData); + } + + private void writeHeightmaps(ByteMessage buf, int version) { + try (ByteBufOutputStream output = new ByteBufOutputStream(buf)) { + output.writeByte(10); //CompoundTag + output.writeUTF(""); // CompoundName + output.writeByte(10); //CompoundTag + output.writeUTF("root"); //root compound + output.writeByte(12); //long array + output.writeUTF("MOTION_BLOCKING"); + long[] longArrayTag = new long[version < Version.V1_18.getProtocolNumber() ? 36 : 37]; + output.writeInt(longArrayTag.length); + for (int i = 0, length = longArrayTag.length; i < length; i++) { + output.writeLong(longArrayTag[i]); + } + buf.writeByte(0); //end of compound + buf.writeByte(0); //end of compound + } + catch (IOException ex) { + throw new RuntimeException(ex); + } + } +} diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java index fdc3398..f6f9361 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java @@ -101,7 +101,7 @@ public class PacketJoinGame implements PacketOut { if (version.fromTo(Version.V1_8, Version.V1_9_1)) { msg.writeByte(gameMode); - msg.writeByte(dimensionRegistry.getDefaultDimension().getId()); + msg.writeByte(dimensionRegistry.getDefaultDimension_1_16().getId()); msg.writeByte(0); // Difficulty msg.writeByte(maxPlayers); msg.writeString("flat"); // Level type @@ -110,7 +110,7 @@ public class PacketJoinGame implements PacketOut { if (version.fromTo(Version.V1_9_2, Version.V1_13_2)) { msg.writeByte(gameMode); - msg.writeInt(dimensionRegistry.getDefaultDimension().getId()); + msg.writeInt(dimensionRegistry.getDefaultDimension_1_16().getId()); msg.writeByte(0); // Difficulty msg.writeByte(maxPlayers); msg.writeString("flat"); // Level type @@ -119,7 +119,7 @@ public class PacketJoinGame implements PacketOut { if (version.fromTo(Version.V1_14, Version.V1_14_4)) { msg.writeByte(gameMode); - msg.writeInt(dimensionRegistry.getDefaultDimension().getId()); + msg.writeInt(dimensionRegistry.getDefaultDimension_1_16().getId()); msg.writeByte(maxPlayers); msg.writeString("flat"); // Level type msg.writeVarInt(viewDistance); @@ -128,7 +128,7 @@ public class PacketJoinGame implements PacketOut { if (version.fromTo(Version.V1_15, Version.V1_15_2)) { msg.writeByte(gameMode); - msg.writeInt(dimensionRegistry.getDefaultDimension().getId()); + msg.writeInt(dimensionRegistry.getDefaultDimension_1_16().getId()); msg.writeLong(hashedSeed); msg.writeByte(maxPlayers); msg.writeString("flat"); // Level type @@ -142,7 +142,7 @@ public class PacketJoinGame implements PacketOut { msg.writeByte(previousGameMode); msg.writeStringsArray(worldNames); msg.writeCompoundTag(dimensionRegistry.getOldCodec()); - msg.writeString(dimensionRegistry.getDefaultDimension().getName()); + msg.writeString(dimensionRegistry.getDefaultDimension_1_16().getName()); msg.writeString(worldName); msg.writeLong(hashedSeed); msg.writeByte(maxPlayers); @@ -158,8 +158,8 @@ public class PacketJoinGame implements PacketOut { msg.writeByte(gameMode); msg.writeByte(previousGameMode); msg.writeStringsArray(worldNames); - msg.writeCompoundTag(dimensionRegistry.getCodec()); - msg.writeCompoundTag(dimensionRegistry.getDefaultDimension().getData()); + msg.writeCompoundTag(dimensionRegistry.getCodec_1_16()); + msg.writeCompoundTag(dimensionRegistry.getDefaultDimension_1_16().getData()); msg.writeString(worldName); msg.writeLong(hashedSeed); msg.writeVarInt(maxPlayers); @@ -175,8 +175,14 @@ public class PacketJoinGame implements PacketOut { msg.writeByte(gameMode); msg.writeByte(previousGameMode); msg.writeStringsArray(worldNames); - msg.writeCompoundTag(dimensionRegistry.getCodec()); - msg.writeCompoundTag(dimensionRegistry.getDefaultDimension().getData()); + if (version.moreOrEqual(Version.V1_18_2)) { + msg.writeCompoundTag(dimensionRegistry.getCodec_1_18_2()); + msg.writeCompoundTag(dimensionRegistry.getDefaultDimension_1_18_2().getData()); + } + else { + msg.writeCompoundTag(dimensionRegistry.getCodec_1_16()); + msg.writeCompoundTag(dimensionRegistry.getDefaultDimension_1_16().getData()); + } msg.writeString(worldName); msg.writeLong(hashedSeed); msg.writeVarInt(maxPlayers); diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/State.java b/src/main/java/ru/nanit/limbo/protocol/registry/State.java index ae72454..79b097c 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/State.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/State.java @@ -84,7 +84,7 @@ public enum State { map(0x0E, V1_13, V1_13_2), map(0x0F, V1_14, V1_15_2), map(0x10, V1_16, V1_16_4), - map(0x0F, V1_17, V1_18) + map(0x0F, V1_17, V1_18_2) ); clientBound.register(PacketDeclareCommands::new, @@ -92,7 +92,7 @@ public enum State { map(0x12, V1_15, V1_15_2), map(0x11, V1_16, V1_16_1), map(0x10, V1_16_2, V1_16_4), - map(0x12, V1_17, V1_18) + map(0x12, V1_17, V1_18_2) ); clientBound.register(PacketJoinGame::new, map(0x01, V1_8, V1_8), @@ -101,7 +101,7 @@ public enum State { map(0x26, V1_15, V1_15_2), map(0x25, V1_16, V1_16_1), map(0x24, V1_16_2, V1_16_4), - map(0x26, V1_17, V1_18) + map(0x26, V1_17, V1_18_2) ); clientBound.register(PacketPluginMessage::new, map(0x19, V1_13, V1_13_2), @@ -109,7 +109,7 @@ public enum State { map(0x19, V1_15, V1_15_2), map(0x18, V1_16, V1_16_1), map(0x17, V1_16_2, V1_16_4), - map(0x18, V1_17, V1_18) + map(0x18, V1_17, V1_18_2) ); clientBound.register(PacketPlayerAbilities::new, map(0x39, V1_8, V1_8), @@ -120,7 +120,7 @@ public enum State { map(0x32, V1_15, V1_15_2), map(0x31, V1_16, V1_16_1), map(0x30, V1_16_2, V1_16_4), - map(0x32, V1_17, V1_18) + map(0x32, V1_17, V1_18_2) ); clientBound.register(PacketPlayerPositionAndLook::new, map(0x08, V1_8, V1_8), @@ -131,7 +131,7 @@ public enum State { map(0x36, V1_15, V1_15_2), map(0x35, V1_16, V1_16_1), map(0x34, V1_16_2, V1_16_4), - map(0x38, V1_17, V1_18) + map(0x38, V1_17, V1_18_2) ); clientBound.register(PacketKeepAlive::new, map(0x00, V1_8, V1_8), @@ -141,7 +141,7 @@ public enum State { map(0x21, V1_15, V1_15_2), map(0x20, V1_16, V1_16_1), map(0x1F, V1_16_2, V1_16_4), - map(0x21, V1_17, V1_18) + map(0x21, V1_17, V1_18_2) ); clientBound.register(PacketChatMessage::new, map(0x02, V1_8, V1_8), @@ -149,13 +149,13 @@ public enum State { map(0x0E, V1_13, V1_14_4), map(0x0F, V1_15, V1_15_2), map(0x0E, V1_16, V1_16_4), - map(0x0F, V1_17, V1_18) + map(0x0F, V1_17, V1_18_2) ); clientBound.register(PacketBossBar::new, map(0x0C, V1_9, V1_14_4), map(0x0D, V1_15, V1_15_2), map(0x0C, V1_16, V1_16_4), - map(0x0D, V1_17, V1_18) + map(0x0D, V1_17, V1_18_2) ); clientBound.register(PacketPlayerInfo::new, map(0x38, V1_8, V1_8), @@ -166,7 +166,7 @@ public enum State { map(0x34, V1_15, V1_15_2), map(0x33, V1_16, V1_16_1), map(0x32, V1_16_2, V1_16_4), - map(0x36, V1_17, V1_18) + map(0x36, V1_17, V1_18_2) ); clientBound.register(PacketTitleLegacy::new, map(0x45, V1_8, V1_11_1), @@ -179,15 +179,15 @@ public enum State { ); clientBound.register(PacketTitleSetTitle::new, map(0x59, V1_17, V1_17_1), - map(0x5A, V1_18, V1_18) + map(0x5A, V1_18, V1_18_2) ); clientBound.register(PacketTitleSetSubTitle::new, map(0x57, V1_17, V1_17_1), - map(0x58, V1_18, V1_18) + map(0x58, V1_18, V1_18_2) ); clientBound.register(PacketTitleTimes::new, map(0x5A, V1_17, V1_17_1), - map(0x5B, V1_18, V1_18) + map(0x5B, V1_18, V1_18_2) ); clientBound.register(PacketPlayerListHeader::new, map(0x47, V1_8, V1_8), @@ -200,7 +200,10 @@ public enum State { map(0x54, V1_15, V1_15_2), map(0x53, V1_16, V1_16_4), map(0x5E, V1_17, V1_17_1), - map(0x5F, V1_18, V1_18) + map(0x5F, V1_18, V1_18_2) + ); + clientBound.register(PacketEmptyChunk::new, + map(0x22, V1_18, V1_18_2) ); } }; diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/Version.java b/src/main/java/ru/nanit/limbo/protocol/registry/Version.java index 68b5e26..31891c1 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/Version.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/Version.java @@ -56,8 +56,9 @@ public enum Version { // 1.16.5 has same protocol number V1_17(755), V1_17_1(756), - V1_18(757); + V1_18(757), // 1.18.1 has same protocol number + V1_18_2(758); private static final Map VERSION_MAP; private static final Version MAX; diff --git a/src/main/java/ru/nanit/limbo/util/Colors.java b/src/main/java/ru/nanit/limbo/util/Colors.java index 3518028..0a3e437 100644 --- a/src/main/java/ru/nanit/limbo/util/Colors.java +++ b/src/main/java/ru/nanit/limbo/util/Colors.java @@ -20,9 +20,10 @@ package ru.nanit.limbo.util; public final class Colors { private static final char CHAR_FROM = '&'; - private static final char CHAR_TO = 'ยง'; + private static final char CHAR_TO = '\u00a7'; - private Colors() {} + private Colors() { + } public static String of(String text) { if (text == null) return null; diff --git a/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java b/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java index bac9a77..29eac0b 100644 --- a/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java +++ b/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java @@ -31,33 +31,49 @@ public final class DimensionRegistry { private final LimboServer server; - private Dimension defaultDimension; + private Dimension defaultDimension_1_16; + private Dimension defaultDimension_1_18_2; - private CompoundBinaryTag codec; + private CompoundBinaryTag codec_1_16; + private CompoundBinaryTag codec_1_18_2; private CompoundBinaryTag oldCodec; public DimensionRegistry(LimboServer server) { this.server = server; } - public CompoundBinaryTag getCodec() { - return codec; + public CompoundBinaryTag getCodec_1_16() { + return codec_1_16; + } + + public CompoundBinaryTag getCodec_1_18_2() { + return codec_1_18_2; } public CompoundBinaryTag getOldCodec() { return oldCodec; } - public Dimension getDefaultDimension() { - return defaultDimension; + public Dimension getDefaultDimension_1_16() { + return defaultDimension_1_16; + } + + public Dimension getDefaultDimension_1_18_2() { + return defaultDimension_1_18_2; } public void load(String def) throws IOException { - codec = readCodecFile("/dimension/codec_new.snbt"); + codec_1_16 = readCodecFile("/dimension/codec_1_16.snbt"); + codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt"); // On 1.16-1.16.1 different codec format oldCodec = readCodecFile("/dimension/codec_old.snbt"); - ListBinaryTag dimensions = codec.getCompound("minecraft:dimension_type").getList("value"); + defaultDimension_1_16 = getDefaultDimension(def, codec_1_16); + defaultDimension_1_18_2 = getDefaultDimension(def, codec_1_18_2); + } + + private Dimension getDefaultDimension(String def, CompoundBinaryTag tag) { + ListBinaryTag dimensions = tag.getCompound("minecraft:dimension_type").getList("value"); CompoundBinaryTag overWorld = (CompoundBinaryTag) ((CompoundBinaryTag) dimensions.get(0)).get("element"); CompoundBinaryTag nether = (CompoundBinaryTag) ((CompoundBinaryTag) dimensions.get(2)).get("element"); @@ -65,18 +81,14 @@ public final class DimensionRegistry { switch (def.toLowerCase()) { case "overworld": - defaultDimension = new Dimension(0, "minecraft:overworld", overWorld); - break; + return new Dimension(0, "minecraft:overworld", overWorld); case "nether": - defaultDimension = new Dimension(-1, "minecraft:nether", nether); - break; + return new Dimension(-1, "minecraft:nether", nether); case "the_end": - defaultDimension = new Dimension(1, "minecraft:the_end", theEnd); - break; + return new Dimension(1, "minecraft:the_end", theEnd); default: - defaultDimension = new Dimension(1, "minecraft:the_end", theEnd); Logger.warning("Undefined dimension type: '%s'. Using THE_END as default", def); - break; + return new Dimension(1, "minecraft:the_end", theEnd); } } diff --git a/src/main/resources/dimension/codec_new.snbt b/src/main/resources/dimension/codec_1_16.snbt similarity index 100% rename from src/main/resources/dimension/codec_new.snbt rename to src/main/resources/dimension/codec_1_16.snbt diff --git a/src/main/resources/dimension/codec_1_18_2.snbt b/src/main/resources/dimension/codec_1_18_2.snbt new file mode 100644 index 0000000..3e9b347 --- /dev/null +++ b/src/main/resources/dimension/codec_1_18_2.snbt @@ -0,0 +1,2093 @@ +{ + "minecraft:dimension_type": { + type: "minecraft:dimension_type", + value: [ + { + name: "minecraft:overworld", + id: 0, + element: { + piglin_safe: 0b, + natural: 1b, + ambient_light: 0.0f, + infiniburn: "#minecraft:infiniburn_overworld", + respawn_anchor_works: 0b, + has_skylight: 1b, + bed_works: 1b, + effects: "minecraft:overworld", + has_raids: 1b, + min_y: 0, + height: 256, + logical_height: 256, + coordinate_scale: 1.0d, + ultrawarm: 0b, + has_ceiling: 0b + } + }, + { + name: "minecraft:overworld_caves", + id: 1, + element: { + piglin_safe: 0b, + natural: 1b, + ambient_light: 0.0f, + infiniburn: "#minecraft:infiniburn_overworld", + respawn_anchor_works: 0b, + has_skylight: 1b, + bed_works: 1b, + effects: "minecraft:overworld", + has_raids: 1b, + min_y: 0, + height: 256, + logical_height: 256, + coordinate_scale: 1.0d, + ultrawarm: 0b, + has_ceiling: 1b + } + }, + { + name: "minecraft:the_nether", + id: 2, + element: { + piglin_safe: 1b, + natural: 0b, + ambient_light: 0.1f, + infiniburn: "#minecraft:infiniburn_nether", + respawn_anchor_works: 1b, + has_skylight: 0b, + bed_works: 0b, + effects: "minecraft:the_nether", + fixed_time: 18000L, + has_raids: 0b, + min_y: 0, + height: 256, + logical_height: 128, + coordinate_scale: 8.0d, + ultrawarm: 1b, + has_ceiling: 1b + } + }, + { + name: "minecraft:the_end", + id: 3, + element: { + piglin_safe: 0b, + natural: 0b, + ambient_light: 0.0f, + infiniburn: "#minecraft:infiniburn_end", + respawn_anchor_works: 0b, + has_skylight: 0b, + bed_works: 0b, + effects: "minecraft:the_end", + fixed_time: 6000L, + has_raids: 1b, + min_y: 0, + height: 256, + logical_height: 256, + coordinate_scale: 1.0d, + ultrawarm: 0b, + has_ceiling: 0b + } + } + ] + }, + "minecraft:worldgen/biome": { + type: "minecraft:worldgen/biome", + value: [ + { + name: "minecraft:ocean", + id: 0, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:plains", + id: 1, + element: { + precipitation: "rain", + effects: { + sky_color: 7907327, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 0.8f, + scale: 0.05f, + downfall: 0.4f, + category: "plains" + } + }, + { + name: "minecraft:desert", + id: 2, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 2.0f, + scale: 0.05f, + downfall: 0.0f, + category: "desert" + } + }, + { + name: "minecraft:mountains", + id: 3, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.0f, + temperature: 0.2f, + scale: 0.5f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:forest", + id: 4, + element: { + precipitation: "rain", + effects: { + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.7f, + scale: 0.2f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:taiga", + id: 5, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.25f, + scale: 0.2f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:swamp", + id: 6, + element: { + precipitation: "rain", + effects: { + grass_color_modifier: "swamp", + sky_color: 7907327, + foliage_color: 6975545, + water_fog_color: 2302743, + fog_color: 12638463, + water_color: 6388580, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -0.2f, + temperature: 0.8f, + scale: 0.1f, + downfall: 0.9f, + category: "swamp" + } + }, + { + name: "minecraft:river", + id: 7, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -0.5f, + temperature: 0.5f, + scale: 0.0f, + downfall: 0.5f, + category: "river" + } + }, + { + name: "minecraft:nether_wastes", + id: 8, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.nether_wastes", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.nether_wastes.loop", + additions_sound: { + sound: "minecraft:ambient.nether_wastes.additions", + tick_chance: 0.0111d + }, + water_fog_color: 329011, + fog_color: 3344392, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.nether_wastes.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + }, + { + name: "minecraft:the_end", + id: 9, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:frozen_ocean", + id: 10, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 3750089, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.0f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean", + temperature_modifier: "frozen" + } + }, + { + name: "minecraft:frozen_river", + id: 11, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 3750089, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -0.5f, + temperature: 0.0f, + scale: 0.0f, + downfall: 0.5f, + category: "river" + } + }, + { + name: "minecraft:snowy_tundra", + id: 12, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 0.0f, + scale: 0.05f, + downfall: 0.5f, + category: "icy" + } + }, + { + name: "minecraft:snowy_mountains", + id: 13, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.0f, + scale: 0.3f, + downfall: 0.5f, + category: "icy" + } + }, + { + name: "minecraft:mushroom_fields", + id: 14, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.9f, + scale: 0.3f, + downfall: 1.0f, + category: "mushroom" + } + }, + { + name: "minecraft:mushroom_field_shore", + id: 15, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.0f, + temperature: 0.9f, + scale: 0.025f, + downfall: 1.0f, + category: "mushroom" + } + }, + { + name: "minecraft:beach", + id: 16, + element: { + precipitation: "rain", + effects: { + sky_color: 7907327, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.0f, + temperature: 0.8f, + scale: 0.025f, + downfall: 0.4f, + category: "beach" + } + }, + { + name: "minecraft:desert_hills", + id: 17, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 2.0f, + scale: 0.3f, + downfall: 0.0f, + category: "desert" + } + }, + { + name: "minecraft:wooded_hills", + id: 18, + element: { + precipitation: "rain", + effects: { + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.7f, + scale: 0.3f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:taiga_hills", + id: 19, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.25f, + scale: 0.3f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:mountain_edge", + id: 20, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.8f, + temperature: 0.2f, + scale: 0.3f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:jungle", + id: 21, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.95f, + scale: 0.2f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:jungle_hills", + id: 22, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.95f, + scale: 0.3f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:jungle_edge", + id: 23, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.95f, + scale: 0.2f, + downfall: 0.8f, + category: "jungle" + } + }, + { + name: "minecraft:deep_ocean", + id: 24, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:stone_shore", + id: 25, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.2f, + scale: 0.8f, + downfall: 0.3f, + category: "none" + } + }, + { + name: "minecraft:snowy_beach", + id: 26, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.0f, + temperature: 0.05f, + scale: 0.025f, + downfall: 0.3f, + category: "beach" + } + }, + { + name: "minecraft:birch_forest", + id: 27, + element: { + precipitation: "rain", + effects: { + sky_color: 8037887, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.6f, + scale: 0.2f, + downfall: 0.6f, + category: "forest" + } + }, + { + name: "minecraft:birch_forest_hills", + id: 28, + element: { + precipitation: "rain", + effects: { + sky_color: 8037887, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.6f, + scale: 0.3f, + downfall: 0.6f, + category: "forest" + } + }, + { + name: "minecraft:dark_forest", + id: 29, + element: { + precipitation: "rain", + effects: { + grass_color_modifier: "dark_forest", + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.7f, + scale: 0.2f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:snowy_taiga", + id: 30, + element: { + precipitation: "snow", + effects: { + sky_color: 8625919, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: -0.5f, + scale: 0.2f, + downfall: 0.4f, + category: "taiga" + } + }, + { + name: "minecraft:snowy_taiga_hills", + id: 31, + element: { + precipitation: "snow", + effects: { + sky_color: 8625919, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: -0.5f, + scale: 0.3f, + downfall: 0.4f, + category: "taiga" + } + }, + { + name: "minecraft:giant_tree_taiga", + id: 32, + element: { + precipitation: "rain", + effects: { + sky_color: 8168447, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.3f, + scale: 0.2f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:giant_tree_taiga_hills", + id: 33, + element: { + precipitation: "rain", + effects: { + sky_color: 8168447, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.3f, + scale: 0.3f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:wooded_mountains", + id: 34, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.0f, + temperature: 0.2f, + scale: 0.5f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:savanna", + id: 35, + element: { + precipitation: "none", + effects: { + sky_color: 7711487, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 1.2f, + scale: 0.05f, + downfall: 0.0f, + category: "savanna" + } + }, + { + name: "minecraft:savanna_plateau", + id: 36, + element: { + precipitation: "none", + effects: { + sky_color: 7776511, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.5f, + temperature: 1.0f, + scale: 0.025f, + downfall: 0.0f, + category: "savanna" + } + }, + { + name: "minecraft:badlands", + id: 37, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:wooded_badlands_plateau", + id: 38, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.5f, + temperature: 2.0f, + scale: 0.025f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:badlands_plateau", + id: 39, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.5f, + temperature: 2.0f, + scale: 0.025f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:small_end_islands", + id: 40, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:end_midlands", + id: 41, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:end_highlands", + id: 42, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:end_barrens", + id: 43, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:warm_ocean", + id: 44, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 270131, + fog_color: 12638463, + water_color: 4445678, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:lukewarm_ocean", + id: 45, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 267827, + fog_color: 12638463, + water_color: 4566514, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:cold_ocean", + id: 46, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:deep_warm_ocean", + id: 47, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 270131, + fog_color: 12638463, + water_color: 4445678, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:deep_lukewarm_ocean", + id: 48, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 267827, + fog_color: 12638463, + water_color: 4566514, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:deep_cold_ocean", + id: 49, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:deep_frozen_ocean", + id: 50, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 3750089, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean", + temperature_modifier: "frozen" + } + }, + { + name: "minecraft:the_void", + id: 127, + element: { + precipitation: "none", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "none" + } + }, + { + name: "minecraft:sunflower_plains", + id: 129, + element: { + precipitation: "rain", + effects: { + sky_color: 7907327, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 0.8f, + scale: 0.05f, + downfall: 0.4f, + category: "plains" + } + }, + { + name: "minecraft:desert_lakes", + id: 130, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.225f, + temperature: 2.0f, + scale: 0.25f, + downfall: 0.0f, + category: "desert" + } + }, + { + name: "minecraft:gravelly_mountains", + id: 131, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.0f, + temperature: 0.2f, + scale: 0.5f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:flower_forest", + id: 132, + element: { + precipitation: "rain", + effects: { + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.7f, + scale: 0.4f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:taiga_mountains", + id: 133, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.3f, + temperature: 0.25f, + scale: 0.4f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:swamp_hills", + id: 134, + element: { + precipitation: "rain", + effects: { + grass_color_modifier: "swamp", + sky_color: 7907327, + foliage_color: 6975545, + water_fog_color: 2302743, + fog_color: 12638463, + water_color: 6388580, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -0.1f, + temperature: 0.8f, + scale: 0.3f, + downfall: 0.9f, + category: "swamp" + } + }, + { + name: "minecraft:ice_spikes", + id: 140, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.425f, + temperature: 0.0f, + scale: 0.45000002f, + downfall: 0.5f, + category: "icy" + } + }, + { + name: "minecraft:modified_jungle", + id: 149, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.95f, + scale: 0.4f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:modified_jungle_edge", + id: 151, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.95f, + scale: 0.4f, + downfall: 0.8f, + category: "jungle" + } + }, + { + name: "minecraft:tall_birch_forest", + id: 155, + element: { + precipitation: "rain", + effects: { + sky_color: 8037887, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.6f, + scale: 0.4f, + downfall: 0.6f, + category: "forest" + } + }, + { + name: "minecraft:tall_birch_hills", + id: 156, + element: { + precipitation: "rain", + effects: { + sky_color: 8037887, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.55f, + temperature: 0.6f, + scale: 0.5f, + downfall: 0.6f, + category: "forest" + } + }, + { + name: "minecraft:dark_forest_hills", + id: 157, + element: { + precipitation: "rain", + effects: { + grass_color_modifier: "dark_forest", + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.7f, + scale: 0.4f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:snowy_taiga_mountains", + id: 158, + element: { + precipitation: "snow", + effects: { + sky_color: 8625919, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.3f, + temperature: -0.5f, + scale: 0.4f, + downfall: 0.4f, + category: "taiga" + } + }, + { + name: "minecraft:giant_spruce_taiga", + id: 160, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.25f, + scale: 0.2f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:giant_spruce_taiga_hills", + id: 161, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.25f, + scale: 0.2f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:modified_gravelly_mountains", + id: 162, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.0f, + temperature: 0.2f, + scale: 0.5f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:shattered_savanna", + id: 163, + element: { + precipitation: "none", + effects: { + sky_color: 7776767, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.3625f, + temperature: 1.1f, + scale: 1.225f, + downfall: 0.0f, + category: "savanna" + } + }, + { + name: "minecraft:shattered_savanna_plateau", + id: 164, + element: { + precipitation: "none", + effects: { + sky_color: 7776511, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.05f, + temperature: 1.0f, + scale: 1.2125001f, + downfall: 0.0f, + category: "savanna" + } + }, + { + name: "minecraft:eroded_badlands", + id: 165, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:modified_wooded_badlands_plateau", + id: 166, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 2.0f, + scale: 0.3f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:modified_badlands_plateau", + id: 167, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 2.0f, + scale: 0.3f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:bamboo_jungle", + id: 168, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.95f, + scale: 0.2f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:bamboo_jungle_hills", + id: 169, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.95f, + scale: 0.3f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:soul_sand_valley", + id: 170, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.soul_sand_valley", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.soul_sand_valley.loop", + additions_sound: { + sound: "minecraft:ambient.soul_sand_valley.additions", + tick_chance: 0.0111d + }, + particle: { + probability: 0.00625f, + options: { + type: "minecraft:ash" + } + }, + water_fog_color: 329011, + fog_color: 1787717, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.soul_sand_valley.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + }, + { + name: "minecraft:crimson_forest", + id: 171, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.crimson_forest", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.crimson_forest.loop", + additions_sound: { + sound: "minecraft:ambient.crimson_forest.additions", + tick_chance: 0.0111d + }, + particle: { + probability: 0.025f, + options: { + type: "minecraft:crimson_spore" + } + }, + water_fog_color: 329011, + fog_color: 3343107, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.crimson_forest.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + }, + { + name: "minecraft:warped_forest", + id: 172, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.warped_forest", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.warped_forest.loop", + additions_sound: { + sound: "minecraft:ambient.warped_forest.additions", + tick_chance: 0.0111d + }, + particle: { + probability: 0.01428f, + options: { + type: "minecraft:warped_spore" + } + }, + water_fog_color: 329011, + fog_color: 1705242, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.warped_forest.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + }, + { + name: "minecraft:basalt_deltas", + id: 173, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.basalt_deltas", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.basalt_deltas.loop", + additions_sound: { + sound: "minecraft:ambient.basalt_deltas.additions", + tick_chance: 0.0111d + }, + particle: { + probability: 0.118093334f, + options: { + type: "minecraft:white_ash" + } + }, + water_fog_color: 4341314, + fog_color: 6840176, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.basalt_deltas.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + } + ] + } +} From 0a98b8257f7ff3af672d9063a5382d7b60aebf42 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Sat, 5 Mar 2022 11:56:38 +0200 Subject: [PATCH 02/19] Remove empty chunk packet --- .../limbo/connection/ClientConnection.java | 3 -- .../limbo/connection/PacketSnapshots.java | 3 -- .../packets/play/PacketEmptyChunk.java | 51 ------------------- .../nanit/limbo/protocol/registry/State.java | 3 -- 4 files changed, 60 deletions(-) delete mode 100644 src/main/java/ru/nanit/limbo/protocol/packets/play/PacketEmptyChunk.java diff --git a/src/main/java/ru/nanit/limbo/connection/ClientConnection.java b/src/main/java/ru/nanit/limbo/connection/ClientConnection.java index 28b7476..4d4324b 100644 --- a/src/main/java/ru/nanit/limbo/connection/ClientConnection.java +++ b/src/main/java/ru/nanit/limbo/connection/ClientConnection.java @@ -154,9 +154,6 @@ public class ClientConnection extends ChannelInboundHandlerAdapter { if (PacketSnapshots.PACKET_HEADER_AND_FOOTER != null) writePacket(PacketSnapshots.PACKET_HEADER_AND_FOOTER); - if (clientVersion.moreOrEqual(Version.V1_18_2)) - writePacket(PacketSnapshots.PACKET_EMPTY_CHUNK); - sendKeepAlive(); } diff --git a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java index 8c65165..68e0916 100644 --- a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java +++ b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java @@ -43,7 +43,6 @@ public final class PacketSnapshots { public static PacketSnapshot PACKET_JOIN_MESSAGE; public static PacketSnapshot PACKET_BOSS_BAR; public static PacketSnapshot PACKET_HEADER_AND_FOOTER; - public static PacketSnapshot PACKET_EMPTY_CHUNK; public static PacketSnapshot PACKET_TITLE_TITLE; public static PacketSnapshot PACKET_TITLE_SUBTITLE; @@ -110,8 +109,6 @@ public final class PacketSnapshots { PACKET_DECLARE_COMMANDS = PacketSnapshot.of(declareCommands); - PACKET_EMPTY_CHUNK = PacketSnapshot.of(new PacketEmptyChunk()); - if (server.getConfig().isUseHeaderAndFooter()) { PacketPlayerListHeader header = new PacketPlayerListHeader(); header.setHeader(server.getConfig().getPlayerListHeader()); diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketEmptyChunk.java b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketEmptyChunk.java deleted file mode 100644 index 4be6433..0000000 --- a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketEmptyChunk.java +++ /dev/null @@ -1,51 +0,0 @@ -package ru.nanit.limbo.protocol.packets.play; - -import io.netty.buffer.ByteBufOutputStream; -import ru.nanit.limbo.protocol.ByteMessage; -import ru.nanit.limbo.protocol.PacketOut; -import ru.nanit.limbo.protocol.registry.Version; - -import java.io.IOException; - -public class PacketEmptyChunk implements PacketOut { - - @Override - public void encode(ByteMessage msg, Version version) { - msg.writeInt(0); - msg.writeInt(0); - - writeHeightmaps(msg, version.getProtocolNumber()); - - byte[] sectionData = new byte[]{0, 0, 0, 0, 0, 0, 1, 0}; - msg.writeVarInt(sectionData.length * 16); - for (int i = 0; i < 16; i++) { - msg.writeBytes(sectionData); - } - - msg.writeVarInt(0); - - byte[] lightData = new byte[]{1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, -1, -1, 0, 0}; - msg.writeBytes(lightData); - } - - private void writeHeightmaps(ByteMessage buf, int version) { - try (ByteBufOutputStream output = new ByteBufOutputStream(buf)) { - output.writeByte(10); //CompoundTag - output.writeUTF(""); // CompoundName - output.writeByte(10); //CompoundTag - output.writeUTF("root"); //root compound - output.writeByte(12); //long array - output.writeUTF("MOTION_BLOCKING"); - long[] longArrayTag = new long[version < Version.V1_18.getProtocolNumber() ? 36 : 37]; - output.writeInt(longArrayTag.length); - for (int i = 0, length = longArrayTag.length; i < length; i++) { - output.writeLong(longArrayTag[i]); - } - buf.writeByte(0); //end of compound - buf.writeByte(0); //end of compound - } - catch (IOException ex) { - throw new RuntimeException(ex); - } - } -} diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/State.java b/src/main/java/ru/nanit/limbo/protocol/registry/State.java index 79b097c..2ac3a3c 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/State.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/State.java @@ -202,9 +202,6 @@ public enum State { map(0x5E, V1_17, V1_17_1), map(0x5F, V1_18, V1_18_2) ); - clientBound.register(PacketEmptyChunk::new, - map(0x22, V1_18, V1_18_2) - ); } }; From c4985c5b6be788db2852669cf76fd6fb592b10a8 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Sat, 5 Mar 2022 23:36:36 +0200 Subject: [PATCH 03/19] Change default spawnPosition height to 400 --- src/main/resources/settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/settings.yml b/src/main/resources/settings.yml index dc997c7..fd4c6da 100644 --- a/src/main/resources/settings.yml +++ b/src/main/resources/settings.yml @@ -34,7 +34,7 @@ headerAndFooter: # Spawn position in the world spawnPosition: x: 0.0 - y: 64.0 + y: 400.0 z: 0.0 yaw: 0.0 pitch: 0.0 From dc6f85f6b77ac58e3c9790f2db60dda53f7ab522 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Sun, 6 Mar 2022 12:49:18 +0200 Subject: [PATCH 04/19] Fix UNDEFINED packed encoding --- src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java b/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java index 8feaa91..0dc2a65 100644 --- a/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java +++ b/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java @@ -45,8 +45,6 @@ public class PacketSnapshot implements PacketOut { Map hashes = new HashMap<>(); for (Version version : Version.values()) { - if (version.equals(Version.UNDEFINED)) continue; - ByteMessage encodedMessage = ByteMessage.create(); packet.encode(encodedMessage, version); From b08599dedae3adac6802e4ea75a959fec4fb6d5b Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Wed, 8 Jun 2022 01:05:38 +0300 Subject: [PATCH 05/19] Add 1.19 mappings --- .../nanit/limbo/protocol/registry/State.java | 40 ++++++++++++------- .../limbo/protocol/registry/Version.java | 3 +- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/State.java b/src/main/java/ru/nanit/limbo/protocol/registry/State.java index 2ac3a3c..eaa8c4d 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/State.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/State.java @@ -84,7 +84,8 @@ public enum State { map(0x0E, V1_13, V1_13_2), map(0x0F, V1_14, V1_15_2), map(0x10, V1_16, V1_16_4), - map(0x0F, V1_17, V1_18_2) + map(0x0F, V1_17, V1_18_2), + map(0x11, V1_19, V1_19) ); clientBound.register(PacketDeclareCommands::new, @@ -92,7 +93,8 @@ public enum State { map(0x12, V1_15, V1_15_2), map(0x11, V1_16, V1_16_1), map(0x10, V1_16_2, V1_16_4), - map(0x12, V1_17, V1_18_2) + map(0x12, V1_17, V1_18_2), + map(0x0F, V1_19, V1_19) ); clientBound.register(PacketJoinGame::new, map(0x01, V1_8, V1_8), @@ -101,7 +103,8 @@ public enum State { map(0x26, V1_15, V1_15_2), map(0x25, V1_16, V1_16_1), map(0x24, V1_16_2, V1_16_4), - map(0x26, V1_17, V1_18_2) + map(0x26, V1_17, V1_18_2), + map(0x23, V1_19, V1_19) ); clientBound.register(PacketPluginMessage::new, map(0x19, V1_13, V1_13_2), @@ -109,7 +112,8 @@ public enum State { map(0x19, V1_15, V1_15_2), map(0x18, V1_16, V1_16_1), map(0x17, V1_16_2, V1_16_4), - map(0x18, V1_17, V1_18_2) + map(0x18, V1_17, V1_18_2), + map(0x15, V1_19, V1_19) ); clientBound.register(PacketPlayerAbilities::new, map(0x39, V1_8, V1_8), @@ -120,7 +124,8 @@ public enum State { map(0x32, V1_15, V1_15_2), map(0x31, V1_16, V1_16_1), map(0x30, V1_16_2, V1_16_4), - map(0x32, V1_17, V1_18_2) + map(0x32, V1_17, V1_18_2), + map(0x2F, V1_19, V1_19) ); clientBound.register(PacketPlayerPositionAndLook::new, map(0x08, V1_8, V1_8), @@ -131,7 +136,8 @@ public enum State { map(0x36, V1_15, V1_15_2), map(0x35, V1_16, V1_16_1), map(0x34, V1_16_2, V1_16_4), - map(0x38, V1_17, V1_18_2) + map(0x38, V1_17, V1_18_2), + map(0x36, V1_19, V1_19) ); clientBound.register(PacketKeepAlive::new, map(0x00, V1_8, V1_8), @@ -141,7 +147,8 @@ public enum State { map(0x21, V1_15, V1_15_2), map(0x20, V1_16, V1_16_1), map(0x1F, V1_16_2, V1_16_4), - map(0x21, V1_17, V1_18_2) + map(0x21, V1_17, V1_18_2), + map(0x1E, V1_19, V1_19) ); clientBound.register(PacketChatMessage::new, map(0x02, V1_8, V1_8), @@ -149,13 +156,15 @@ public enum State { map(0x0E, V1_13, V1_14_4), map(0x0F, V1_15, V1_15_2), map(0x0E, V1_16, V1_16_4), - map(0x0F, V1_17, V1_18_2) + map(0x0F, V1_17, V1_18_2), + map(0x5F, V1_19, V1_19) ); clientBound.register(PacketBossBar::new, map(0x0C, V1_9, V1_14_4), map(0x0D, V1_15, V1_15_2), map(0x0C, V1_16, V1_16_4), - map(0x0D, V1_17, V1_18_2) + map(0x0D, V1_17, V1_18_2), + map(0x0F, V1_19, V1_19) ); clientBound.register(PacketPlayerInfo::new, map(0x38, V1_8, V1_8), @@ -166,7 +175,8 @@ public enum State { map(0x34, V1_15, V1_15_2), map(0x33, V1_16, V1_16_1), map(0x32, V1_16_2, V1_16_4), - map(0x36, V1_17, V1_18_2) + map(0x36, V1_17, V1_18_2), + map(0x34, V1_19, V1_19) ); clientBound.register(PacketTitleLegacy::new, map(0x45, V1_8, V1_11_1), @@ -175,19 +185,19 @@ public enum State { map(0x4B, V1_13, V1_13_2), map(0x4F, V1_14, V1_14_4), map(0x50, V1_15, V1_15_2), - map(0x4F, V1_16, V1_16_4) + map(0x4F, V1_16, V1_19) ); clientBound.register(PacketTitleSetTitle::new, map(0x59, V1_17, V1_17_1), - map(0x5A, V1_18, V1_18_2) + map(0x5A, V1_18, V1_19) ); clientBound.register(PacketTitleSetSubTitle::new, map(0x57, V1_17, V1_17_1), - map(0x58, V1_18, V1_18_2) + map(0x58, V1_18, V1_19) ); clientBound.register(PacketTitleTimes::new, map(0x5A, V1_17, V1_17_1), - map(0x5B, V1_18, V1_18_2) + map(0x5B, V1_18, V1_19) ); clientBound.register(PacketPlayerListHeader::new, map(0x47, V1_8, V1_8), @@ -200,7 +210,7 @@ public enum State { map(0x54, V1_15, V1_15_2), map(0x53, V1_16, V1_16_4), map(0x5E, V1_17, V1_17_1), - map(0x5F, V1_18, V1_18_2) + map(0x60, V1_18, V1_18_2) ); } }; diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/Version.java b/src/main/java/ru/nanit/limbo/protocol/registry/Version.java index 31891c1..733ee92 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/Version.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/Version.java @@ -58,7 +58,8 @@ public enum Version { V1_17_1(756), V1_18(757), // 1.18.1 has same protocol number - V1_18_2(758); + V1_18_2(758), + V1_19(759); private static final Map VERSION_MAP; private static final Version MAX; From 32c95cc5cd4a80c279735e182a47f682267a3c6a Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Wed, 8 Jun 2022 11:50:00 +0300 Subject: [PATCH 06/19] Attempt fix PacketJoinGame --- .../protocol/packets/play/PacketJoinGame.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java index f6f9361..969c512 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java @@ -170,7 +170,7 @@ public class PacketJoinGame implements PacketOut { msg.writeBoolean(isFlat); } - if (version.moreOrEqual(Version.V1_18)) { + if (version.fromTo(Version.V1_18, Version.V1_18_2)) { msg.writeBoolean(isHardcore); msg.writeByte(gameMode); msg.writeByte(previousGameMode); @@ -193,6 +193,26 @@ public class PacketJoinGame implements PacketOut { msg.writeBoolean(isDebug); msg.writeBoolean(isFlat); } + + if (version.moreOrEqual(Version.V1_19)) { + msg.writeBoolean(isHardcore); + msg.writeByte(gameMode); + msg.writeByte(previousGameMode); + msg.writeStringsArray(worldNames); + msg.writeCompoundTag(dimensionRegistry.getCodec_1_18_2()); + msg.writeCompoundTag(dimensionRegistry.getDefaultDimension_1_18_2().getData()); + //msg.writeString("minecraft:overworld"); + msg.writeString(worldName); + msg.writeLong(hashedSeed); + msg.writeVarInt(maxPlayers); + msg.writeVarInt(viewDistance); + msg.writeVarInt(viewDistance); // Simulation Distance + msg.writeBoolean(reducedDebugInfo); + msg.writeBoolean(enableRespawnScreen); + msg.writeBoolean(isDebug); + msg.writeBoolean(isFlat); + msg.writeBoolean(false); + } } } From 788c9ba4f2f3b0cb4b8a093c019a6f46bb249de5 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Wed, 8 Jun 2022 12:08:38 +0300 Subject: [PATCH 07/19] Improve debugging --- .../ru/nanit/limbo/connection/pipeline/PacketDecoder.java | 2 +- .../ru/nanit/limbo/connection/pipeline/PacketEncoder.java | 4 ++-- src/main/java/ru/nanit/limbo/protocol/registry/State.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/ru/nanit/limbo/connection/pipeline/PacketDecoder.java b/src/main/java/ru/nanit/limbo/connection/pipeline/PacketDecoder.java index c259133..8f8ba49 100644 --- a/src/main/java/ru/nanit/limbo/connection/pipeline/PacketDecoder.java +++ b/src/main/java/ru/nanit/limbo/connection/pipeline/PacketDecoder.java @@ -47,7 +47,7 @@ public class PacketDecoder extends MessageToMessageDecoder { Packet packet = mappings.getPacket(packetId); if (packet != null) { - Logger.debug("Received packet %s", packet.toString()); + Logger.debug("Received packet %s[0x%s]", packet.toString(), Integer.toHexString(packetId)); try { packet.decode(msg, version); } catch (Exception e) { diff --git a/src/main/java/ru/nanit/limbo/connection/pipeline/PacketEncoder.java b/src/main/java/ru/nanit/limbo/connection/pipeline/PacketEncoder.java index ab8289f..26e9282 100644 --- a/src/main/java/ru/nanit/limbo/connection/pipeline/PacketEncoder.java +++ b/src/main/java/ru/nanit/limbo/connection/pipeline/PacketEncoder.java @@ -51,7 +51,7 @@ public class PacketEncoder extends MessageToByteEncoder { } if (packetId == -1) { - Logger.warning("Undefined packet class: %s", packet.getClass().getName()); + Logger.warning("Undefined packet class: %s[0x%s]", packet.getClass().getName(), Integer.toHexString(packetId)); return; } @@ -61,7 +61,7 @@ public class PacketEncoder extends MessageToByteEncoder { packet.encode(msg, version); if (Logger.getLevel() >= 3) { - Logger.debug("Sending %s packet (%d bytes)", packet.toString(), msg.readableBytes()); + Logger.debug("Sending %s[0x%s] packet (%d bytes)", packet.toString(), Integer.toHexString(packetId), msg.readableBytes()); } } catch (Exception e) { Logger.error("Cannot encode packet 0x%s: %s", Integer.toHexString(packetId), e.getMessage()); diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/State.java b/src/main/java/ru/nanit/limbo/protocol/registry/State.java index eaa8c4d..3304638 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/State.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/State.java @@ -210,7 +210,7 @@ public enum State { map(0x54, V1_15, V1_15_2), map(0x53, V1_16, V1_16_4), map(0x5E, V1_17, V1_17_1), - map(0x60, V1_18, V1_18_2) + map(0x60, V1_18, V1_19) ); } }; From ac8eda05addeebf7fec926662ad17d3ae4983832 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Wed, 8 Jun 2022 13:50:32 +0300 Subject: [PATCH 08/19] Fix PacketLoginSuccess --- .../ru/nanit/limbo/protocol/ByteMessage.java | 24 ++++++++++-- .../ru/nanit/limbo/protocol/Property.java | 38 +++++++++++++++++++ .../packets/login/PacketLoginSuccess.java | 4 ++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 src/main/java/ru/nanit/limbo/protocol/Property.java diff --git a/src/main/java/ru/nanit/limbo/protocol/ByteMessage.java b/src/main/java/ru/nanit/limbo/protocol/ByteMessage.java index 49facd1..464da16 100644 --- a/src/main/java/ru/nanit/limbo/protocol/ByteMessage.java +++ b/src/main/java/ru/nanit/limbo/protocol/ByteMessage.java @@ -166,7 +166,8 @@ public class ByteMessage extends ByteBuf { for (CompoundBinaryTag tag : compoundTags) { BinaryTagIO.writer().write(tag, (OutputStream) stream); } - } catch (IOException e) { + } + catch (IOException e) { throw new EncoderException("Cannot write NBT CompoundTag"); } } @@ -174,7 +175,8 @@ public class ByteMessage extends ByteBuf { public CompoundBinaryTag readCompoundTag() { try (ByteBufInputStream stream = new ByteBufInputStream(buf)) { return BinaryTagIO.reader().read((InputStream) stream); - } catch (IOException thrown) { + } + catch (IOException thrown) { throw new DecoderException("Cannot read NBT CompoundTag"); } } @@ -182,11 +184,27 @@ public class ByteMessage extends ByteBuf { public void writeCompoundTag(CompoundBinaryTag compoundTag) { try (ByteBufOutputStream stream = new ByteBufOutputStream(buf)) { BinaryTagIO.writer().write(compoundTag, (OutputStream) stream); - } catch (IOException e) { + } + catch (IOException e) { throw new EncoderException("Cannot write NBT CompoundTag"); } } + public void writeProperties(Property[] properties) { + writeVarInt(properties.length); + for (Property prop : properties) { + writeString(prop.getName()); + writeString(prop.getValue()); + if (prop.getSignature() != null) { + buf.writeBoolean(true); + writeString(prop.getSignature()); + } + else { + buf.writeBoolean(false); + } + } + } + /* Delegated methods */ @Override diff --git a/src/main/java/ru/nanit/limbo/protocol/Property.java b/src/main/java/ru/nanit/limbo/protocol/Property.java new file mode 100644 index 0000000..5c11256 --- /dev/null +++ b/src/main/java/ru/nanit/limbo/protocol/Property.java @@ -0,0 +1,38 @@ +package ru.nanit.limbo.protocol; + +public class Property { + + private String name; + private String value; + private String signature; + + public Property(String name, String value, String signature) { + this.name = name; + this.value = value; + this.signature = signature; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } +} diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginSuccess.java b/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginSuccess.java index 61999ba..1b317f7 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginSuccess.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginSuccess.java @@ -19,6 +19,7 @@ package ru.nanit.limbo.protocol.packets.login; import ru.nanit.limbo.protocol.ByteMessage; import ru.nanit.limbo.protocol.PacketOut; +import ru.nanit.limbo.protocol.Property; import ru.nanit.limbo.protocol.registry.Version; import java.util.UUID; @@ -44,6 +45,9 @@ public class PacketLoginSuccess implements PacketOut { msg.writeString(uuid.toString()); } msg.writeString(username); + if (version.moreOrEqual(Version.V1_19)) { + msg.writeProperties(new Property[0]); + } } @Override From 272c37bb79e01986c5189cd67324e29e77c9315c Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Thu, 9 Jun 2022 11:47:12 +0300 Subject: [PATCH 09/19] Fix Join Game packet and Login packet, add new codec for 1.19 --- .../limbo/connection/PacketSnapshots.java | 4 +- .../ru/nanit/limbo/protocol/ByteMessage.java | 15 - .../ru/nanit/limbo/protocol/Property.java | 38 - .../packets/login/PacketLoginSuccess.java | 3 +- .../protocol/packets/play/PacketJoinGame.java | 9 +- .../world/dimension/DimensionRegistry.java | 7 + src/main/resources/dimension/codec_1_19.snbt | 2101 +++++++++++++++++ 7 files changed, 2117 insertions(+), 60 deletions(-) delete mode 100644 src/main/java/ru/nanit/limbo/protocol/Property.java create mode 100644 src/main/resources/dimension/codec_1_19.snbt diff --git a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java index 68e0916..62e1937 100644 --- a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java +++ b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java @@ -74,8 +74,8 @@ public final class PacketSnapshots { joinGame.setReducedDebugInfo(true); joinGame.setDebug(false); joinGame.setViewDistance(0); - joinGame.setWorldName("minecraft:world"); - joinGame.setWorldNames("minecraft:world"); + joinGame.setWorldName("minecraft:overworld"); + joinGame.setWorldNames("minecraft:overworld"); joinGame.setHashedSeed(0); joinGame.setDimensionRegistry(server.getDimensionRegistry()); diff --git a/src/main/java/ru/nanit/limbo/protocol/ByteMessage.java b/src/main/java/ru/nanit/limbo/protocol/ByteMessage.java index 464da16..be4ef13 100644 --- a/src/main/java/ru/nanit/limbo/protocol/ByteMessage.java +++ b/src/main/java/ru/nanit/limbo/protocol/ByteMessage.java @@ -190,21 +190,6 @@ public class ByteMessage extends ByteBuf { } } - public void writeProperties(Property[] properties) { - writeVarInt(properties.length); - for (Property prop : properties) { - writeString(prop.getName()); - writeString(prop.getValue()); - if (prop.getSignature() != null) { - buf.writeBoolean(true); - writeString(prop.getSignature()); - } - else { - buf.writeBoolean(false); - } - } - } - /* Delegated methods */ @Override diff --git a/src/main/java/ru/nanit/limbo/protocol/Property.java b/src/main/java/ru/nanit/limbo/protocol/Property.java deleted file mode 100644 index 5c11256..0000000 --- a/src/main/java/ru/nanit/limbo/protocol/Property.java +++ /dev/null @@ -1,38 +0,0 @@ -package ru.nanit.limbo.protocol; - -public class Property { - - private String name; - private String value; - private String signature; - - public Property(String name, String value, String signature) { - this.name = name; - this.value = value; - this.signature = signature; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } -} diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginSuccess.java b/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginSuccess.java index 1b317f7..b06d2e0 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginSuccess.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginSuccess.java @@ -19,7 +19,6 @@ package ru.nanit.limbo.protocol.packets.login; import ru.nanit.limbo.protocol.ByteMessage; import ru.nanit.limbo.protocol.PacketOut; -import ru.nanit.limbo.protocol.Property; import ru.nanit.limbo.protocol.registry.Version; import java.util.UUID; @@ -46,7 +45,7 @@ public class PacketLoginSuccess implements PacketOut { } msg.writeString(username); if (version.moreOrEqual(Version.V1_19)) { - msg.writeProperties(new Property[0]); + msg.writeVarInt(0); } } diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java index 969c512..403a1c1 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java @@ -17,11 +17,15 @@ package ru.nanit.limbo.protocol.packets.play; +import net.kyori.adventure.nbt.TagStringIO; import ru.nanit.limbo.protocol.ByteMessage; import ru.nanit.limbo.protocol.PacketOut; import ru.nanit.limbo.protocol.registry.Version; +import ru.nanit.limbo.server.Logger; import ru.nanit.limbo.world.dimension.DimensionRegistry; +import java.io.IOException; + public class PacketJoinGame implements PacketOut { private int entityId; @@ -199,9 +203,8 @@ public class PacketJoinGame implements PacketOut { msg.writeByte(gameMode); msg.writeByte(previousGameMode); msg.writeStringsArray(worldNames); - msg.writeCompoundTag(dimensionRegistry.getCodec_1_18_2()); - msg.writeCompoundTag(dimensionRegistry.getDefaultDimension_1_18_2().getData()); - //msg.writeString("minecraft:overworld"); + msg.writeCompoundTag(dimensionRegistry.getCodec_1_19()); + msg.writeString(worldName); // World type msg.writeString(worldName); msg.writeLong(hashedSeed); msg.writeVarInt(maxPlayers); diff --git a/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java b/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java index 29eac0b..78418db 100644 --- a/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java +++ b/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java @@ -36,6 +36,7 @@ public final class DimensionRegistry { private CompoundBinaryTag codec_1_16; private CompoundBinaryTag codec_1_18_2; + private CompoundBinaryTag codec_1_19; private CompoundBinaryTag oldCodec; public DimensionRegistry(LimboServer server) { @@ -50,6 +51,10 @@ public final class DimensionRegistry { return codec_1_18_2; } + public CompoundBinaryTag getCodec_1_19() { + return codec_1_19; + } + public CompoundBinaryTag getOldCodec() { return oldCodec; } @@ -65,6 +70,8 @@ public final class DimensionRegistry { public void load(String def) throws IOException { codec_1_16 = readCodecFile("/dimension/codec_1_16.snbt"); codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt"); + codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt"); + codec_1_19 = readCodecFile("/dimension/codec_1_19.snbt"); // On 1.16-1.16.1 different codec format oldCodec = readCodecFile("/dimension/codec_old.snbt"); diff --git a/src/main/resources/dimension/codec_1_19.snbt b/src/main/resources/dimension/codec_1_19.snbt new file mode 100644 index 0000000..30d01ce --- /dev/null +++ b/src/main/resources/dimension/codec_1_19.snbt @@ -0,0 +1,2101 @@ +{ + "minecraft:dimension_type": { + type: "minecraft:dimension_type", + value: [ + { + name: "minecraft:overworld", + id: 0, + element: { + piglin_safe: 0b, + natural: 1b, + ambient_light: 0.0f, + infiniburn: "#minecraft:infiniburn_overworld", + respawn_anchor_works: 0b, + has_skylight: 1b, + bed_works: 1b, + effects: "minecraft:overworld", + has_raids: 1b, + monster_spawn_light_level: 0, + monster_spawn_block_light_limit: 0, + min_y: 0, + height: 256, + logical_height: 256, + coordinate_scale: 1.0d, + ultrawarm: 0b, + has_ceiling: 0b + } + }, + { + name: "minecraft:overworld_caves", + id: 1, + element: { + piglin_safe: 0b, + natural: 1b, + ambient_light: 0.0f, + infiniburn: "#minecraft:infiniburn_overworld", + respawn_anchor_works: 0b, + has_skylight: 1b, + bed_works: 1b, + effects: "minecraft:overworld", + has_raids: 1b, + monster_spawn_light_level: 0, + monster_spawn_block_light_limit: 0, + min_y: 0, + height: 256, + logical_height: 256, + coordinate_scale: 1.0d, + ultrawarm: 0b, + has_ceiling: 1b + } + }, + { + name: "minecraft:the_nether", + id: 2, + element: { + piglin_safe: 1b, + natural: 0b, + ambient_light: 0.1f, + infiniburn: "#minecraft:infiniburn_nether", + respawn_anchor_works: 1b, + has_skylight: 0b, + bed_works: 0b, + effects: "minecraft:the_nether", + fixed_time: 18000L, + has_raids: 0b, + monster_spawn_light_level: 0, + monster_spawn_block_light_limit: 0, + min_y: 0, + height: 256, + logical_height: 128, + coordinate_scale: 8.0d, + ultrawarm: 1b, + has_ceiling: 1b + } + }, + { + name: "minecraft:the_end", + id: 3, + element: { + piglin_safe: 0b, + natural: 0b, + ambient_light: 0.0f, + infiniburn: "#minecraft:infiniburn_end", + respawn_anchor_works: 0b, + has_skylight: 0b, + bed_works: 0b, + effects: "minecraft:the_end", + fixed_time: 6000L, + has_raids: 1b, + monster_spawn_light_level: 0, + monster_spawn_block_light_limit: 0, + min_y: 0, + height: 256, + logical_height: 256, + coordinate_scale: 1.0d, + ultrawarm: 0b, + has_ceiling: 0b + } + } + ] + }, + "minecraft:worldgen/biome": { + type: "minecraft:worldgen/biome", + value: [ + { + name: "minecraft:ocean", + id: 0, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:plains", + id: 1, + element: { + precipitation: "rain", + effects: { + sky_color: 7907327, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 0.8f, + scale: 0.05f, + downfall: 0.4f, + category: "plains" + } + }, + { + name: "minecraft:desert", + id: 2, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 2.0f, + scale: 0.05f, + downfall: 0.0f, + category: "desert" + } + }, + { + name: "minecraft:mountains", + id: 3, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.0f, + temperature: 0.2f, + scale: 0.5f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:forest", + id: 4, + element: { + precipitation: "rain", + effects: { + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.7f, + scale: 0.2f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:taiga", + id: 5, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.25f, + scale: 0.2f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:swamp", + id: 6, + element: { + precipitation: "rain", + effects: { + grass_color_modifier: "swamp", + sky_color: 7907327, + foliage_color: 6975545, + water_fog_color: 2302743, + fog_color: 12638463, + water_color: 6388580, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -0.2f, + temperature: 0.8f, + scale: 0.1f, + downfall: 0.9f, + category: "swamp" + } + }, + { + name: "minecraft:river", + id: 7, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -0.5f, + temperature: 0.5f, + scale: 0.0f, + downfall: 0.5f, + category: "river" + } + }, + { + name: "minecraft:nether_wastes", + id: 8, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.nether_wastes", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.nether_wastes.loop", + additions_sound: { + sound: "minecraft:ambient.nether_wastes.additions", + tick_chance: 0.0111d + }, + water_fog_color: 329011, + fog_color: 3344392, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.nether_wastes.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + }, + { + name: "minecraft:the_end", + id: 9, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:frozen_ocean", + id: 10, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 3750089, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.0f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean", + temperature_modifier: "frozen" + } + }, + { + name: "minecraft:frozen_river", + id: 11, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 3750089, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -0.5f, + temperature: 0.0f, + scale: 0.0f, + downfall: 0.5f, + category: "river" + } + }, + { + name: "minecraft:snowy_tundra", + id: 12, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 0.0f, + scale: 0.05f, + downfall: 0.5f, + category: "icy" + } + }, + { + name: "minecraft:snowy_mountains", + id: 13, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.0f, + scale: 0.3f, + downfall: 0.5f, + category: "icy" + } + }, + { + name: "minecraft:mushroom_fields", + id: 14, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.9f, + scale: 0.3f, + downfall: 1.0f, + category: "mushroom" + } + }, + { + name: "minecraft:mushroom_field_shore", + id: 15, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.0f, + temperature: 0.9f, + scale: 0.025f, + downfall: 1.0f, + category: "mushroom" + } + }, + { + name: "minecraft:beach", + id: 16, + element: { + precipitation: "rain", + effects: { + sky_color: 7907327, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.0f, + temperature: 0.8f, + scale: 0.025f, + downfall: 0.4f, + category: "beach" + } + }, + { + name: "minecraft:desert_hills", + id: 17, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 2.0f, + scale: 0.3f, + downfall: 0.0f, + category: "desert" + } + }, + { + name: "minecraft:wooded_hills", + id: 18, + element: { + precipitation: "rain", + effects: { + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.7f, + scale: 0.3f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:taiga_hills", + id: 19, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.25f, + scale: 0.3f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:mountain_edge", + id: 20, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.8f, + temperature: 0.2f, + scale: 0.3f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:jungle", + id: 21, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.95f, + scale: 0.2f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:jungle_hills", + id: 22, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.95f, + scale: 0.3f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:jungle_edge", + id: 23, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.95f, + scale: 0.2f, + downfall: 0.8f, + category: "jungle" + } + }, + { + name: "minecraft:deep_ocean", + id: 24, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:stone_shore", + id: 25, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.2f, + scale: 0.8f, + downfall: 0.3f, + category: "none" + } + }, + { + name: "minecraft:snowy_beach", + id: 26, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.0f, + temperature: 0.05f, + scale: 0.025f, + downfall: 0.3f, + category: "beach" + } + }, + { + name: "minecraft:birch_forest", + id: 27, + element: { + precipitation: "rain", + effects: { + sky_color: 8037887, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.6f, + scale: 0.2f, + downfall: 0.6f, + category: "forest" + } + }, + { + name: "minecraft:birch_forest_hills", + id: 28, + element: { + precipitation: "rain", + effects: { + sky_color: 8037887, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.6f, + scale: 0.3f, + downfall: 0.6f, + category: "forest" + } + }, + { + name: "minecraft:dark_forest", + id: 29, + element: { + precipitation: "rain", + effects: { + grass_color_modifier: "dark_forest", + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.7f, + scale: 0.2f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:snowy_taiga", + id: 30, + element: { + precipitation: "snow", + effects: { + sky_color: 8625919, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: -0.5f, + scale: 0.2f, + downfall: 0.4f, + category: "taiga" + } + }, + { + name: "minecraft:snowy_taiga_hills", + id: 31, + element: { + precipitation: "snow", + effects: { + sky_color: 8625919, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: -0.5f, + scale: 0.3f, + downfall: 0.4f, + category: "taiga" + } + }, + { + name: "minecraft:giant_tree_taiga", + id: 32, + element: { + precipitation: "rain", + effects: { + sky_color: 8168447, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.3f, + scale: 0.2f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:giant_tree_taiga_hills", + id: 33, + element: { + precipitation: "rain", + effects: { + sky_color: 8168447, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.3f, + scale: 0.3f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:wooded_mountains", + id: 34, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.0f, + temperature: 0.2f, + scale: 0.5f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:savanna", + id: 35, + element: { + precipitation: "none", + effects: { + sky_color: 7711487, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 1.2f, + scale: 0.05f, + downfall: 0.0f, + category: "savanna" + } + }, + { + name: "minecraft:savanna_plateau", + id: 36, + element: { + precipitation: "none", + effects: { + sky_color: 7776511, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.5f, + temperature: 1.0f, + scale: 0.025f, + downfall: 0.0f, + category: "savanna" + } + }, + { + name: "minecraft:badlands", + id: 37, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:wooded_badlands_plateau", + id: 38, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.5f, + temperature: 2.0f, + scale: 0.025f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:badlands_plateau", + id: 39, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.5f, + temperature: 2.0f, + scale: 0.025f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:small_end_islands", + id: 40, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:end_midlands", + id: 41, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:end_highlands", + id: 42, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:end_barrens", + id: 43, + element: { + precipitation: "none", + effects: { + sky_color: 0, + water_fog_color: 329011, + fog_color: 10518688, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "the_end" + } + }, + { + name: "minecraft:warm_ocean", + id: 44, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 270131, + fog_color: 12638463, + water_color: 4445678, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:lukewarm_ocean", + id: 45, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 267827, + fog_color: 12638463, + water_color: 4566514, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:cold_ocean", + id: 46, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.0f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:deep_warm_ocean", + id: 47, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 270131, + fog_color: 12638463, + water_color: 4445678, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:deep_lukewarm_ocean", + id: 48, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 267827, + fog_color: 12638463, + water_color: 4566514, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:deep_cold_ocean", + id: 49, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean" + } + }, + { + name: "minecraft:deep_frozen_ocean", + id: 50, + element: { + precipitation: "rain", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 3750089, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -1.8f, + temperature: 0.5f, + scale: 0.1f, + downfall: 0.5f, + category: "ocean", + temperature_modifier: "frozen" + } + }, + { + name: "minecraft:the_void", + id: 127, + element: { + precipitation: "none", + effects: { + sky_color: 8103167, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.5f, + scale: 0.2f, + downfall: 0.5f, + category: "none" + } + }, + { + name: "minecraft:sunflower_plains", + id: 129, + element: { + precipitation: "rain", + effects: { + sky_color: 7907327, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.125f, + temperature: 0.8f, + scale: 0.05f, + downfall: 0.4f, + category: "plains" + } + }, + { + name: "minecraft:desert_lakes", + id: 130, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.225f, + temperature: 2.0f, + scale: 0.25f, + downfall: 0.0f, + category: "desert" + } + }, + { + name: "minecraft:gravelly_mountains", + id: 131, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.0f, + temperature: 0.2f, + scale: 0.5f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:flower_forest", + id: 132, + element: { + precipitation: "rain", + effects: { + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.7f, + scale: 0.4f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:taiga_mountains", + id: 133, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.3f, + temperature: 0.25f, + scale: 0.4f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:swamp_hills", + id: 134, + element: { + precipitation: "rain", + effects: { + grass_color_modifier: "swamp", + sky_color: 7907327, + foliage_color: 6975545, + water_fog_color: 2302743, + fog_color: 12638463, + water_color: 6388580, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: -0.1f, + temperature: 0.8f, + scale: 0.3f, + downfall: 0.9f, + category: "swamp" + } + }, + { + name: "minecraft:ice_spikes", + id: 140, + element: { + precipitation: "snow", + effects: { + sky_color: 8364543, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.425f, + temperature: 0.0f, + scale: 0.45000002f, + downfall: 0.5f, + category: "icy" + } + }, + { + name: "minecraft:modified_jungle", + id: 149, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.95f, + scale: 0.4f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:modified_jungle_edge", + id: 151, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.95f, + scale: 0.4f, + downfall: 0.8f, + category: "jungle" + } + }, + { + name: "minecraft:tall_birch_forest", + id: 155, + element: { + precipitation: "rain", + effects: { + sky_color: 8037887, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.6f, + scale: 0.4f, + downfall: 0.6f, + category: "forest" + } + }, + { + name: "minecraft:tall_birch_hills", + id: 156, + element: { + precipitation: "rain", + effects: { + sky_color: 8037887, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.55f, + temperature: 0.6f, + scale: 0.5f, + downfall: 0.6f, + category: "forest" + } + }, + { + name: "minecraft:dark_forest_hills", + id: 157, + element: { + precipitation: "rain", + effects: { + grass_color_modifier: "dark_forest", + sky_color: 7972607, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.7f, + scale: 0.4f, + downfall: 0.8f, + category: "forest" + } + }, + { + name: "minecraft:snowy_taiga_mountains", + id: 158, + element: { + precipitation: "snow", + effects: { + sky_color: 8625919, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4020182, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.3f, + temperature: -0.5f, + scale: 0.4f, + downfall: 0.4f, + category: "taiga" + } + }, + { + name: "minecraft:giant_spruce_taiga", + id: 160, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.25f, + scale: 0.2f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:giant_spruce_taiga_hills", + id: 161, + element: { + precipitation: "rain", + effects: { + sky_color: 8233983, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.2f, + temperature: 0.25f, + scale: 0.2f, + downfall: 0.8f, + category: "taiga" + } + }, + { + name: "minecraft:modified_gravelly_mountains", + id: 162, + element: { + precipitation: "rain", + effects: { + sky_color: 8233727, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.0f, + temperature: 0.2f, + scale: 0.5f, + downfall: 0.3f, + category: "extreme_hills" + } + }, + { + name: "minecraft:shattered_savanna", + id: 163, + element: { + precipitation: "none", + effects: { + sky_color: 7776767, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.3625f, + temperature: 1.1f, + scale: 1.225f, + downfall: 0.0f, + category: "savanna" + } + }, + { + name: "minecraft:shattered_savanna_plateau", + id: 164, + element: { + precipitation: "none", + effects: { + sky_color: 7776511, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 1.05f, + temperature: 1.0f, + scale: 1.2125001f, + downfall: 0.0f, + category: "savanna" + } + }, + { + name: "minecraft:eroded_badlands", + id: 165, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:modified_wooded_badlands_plateau", + id: 166, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 2.0f, + scale: 0.3f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:modified_badlands_plateau", + id: 167, + element: { + precipitation: "none", + effects: { + sky_color: 7254527, + grass_color: 9470285, + foliage_color: 10387789, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 2.0f, + scale: 0.3f, + downfall: 0.0f, + category: "mesa" + } + }, + { + name: "minecraft:bamboo_jungle", + id: 168, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 0.95f, + scale: 0.2f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:bamboo_jungle_hills", + id: 169, + element: { + precipitation: "rain", + effects: { + sky_color: 7842047, + water_fog_color: 329011, + fog_color: 12638463, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.cave", + block_search_extent: 8 + } + }, + depth: 0.45f, + temperature: 0.95f, + scale: 0.3f, + downfall: 0.9f, + category: "jungle" + } + }, + { + name: "minecraft:soul_sand_valley", + id: 170, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.soul_sand_valley", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.soul_sand_valley.loop", + additions_sound: { + sound: "minecraft:ambient.soul_sand_valley.additions", + tick_chance: 0.0111d + }, + particle: { + probability: 0.00625f, + options: { + type: "minecraft:ash" + } + }, + water_fog_color: 329011, + fog_color: 1787717, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.soul_sand_valley.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + }, + { + name: "minecraft:crimson_forest", + id: 171, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.crimson_forest", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.crimson_forest.loop", + additions_sound: { + sound: "minecraft:ambient.crimson_forest.additions", + tick_chance: 0.0111d + }, + particle: { + probability: 0.025f, + options: { + type: "minecraft:crimson_spore" + } + }, + water_fog_color: 329011, + fog_color: 3343107, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.crimson_forest.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + }, + { + name: "minecraft:warped_forest", + id: 172, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.warped_forest", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.warped_forest.loop", + additions_sound: { + sound: "minecraft:ambient.warped_forest.additions", + tick_chance: 0.0111d + }, + particle: { + probability: 0.01428f, + options: { + type: "minecraft:warped_spore" + } + }, + water_fog_color: 329011, + fog_color: 1705242, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.warped_forest.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + }, + { + name: "minecraft:basalt_deltas", + id: 173, + element: { + precipitation: "none", + effects: { + music: { + replace_current_music: 0b, + max_delay: 24000, + sound: "minecraft:music.nether.basalt_deltas", + min_delay: 12000 + }, + sky_color: 7254527, + ambient_sound: "minecraft:ambient.basalt_deltas.loop", + additions_sound: { + sound: "minecraft:ambient.basalt_deltas.additions", + tick_chance: 0.0111d + }, + particle: { + probability: 0.118093334f, + options: { + type: "minecraft:white_ash" + } + }, + water_fog_color: 4341314, + fog_color: 6840176, + water_color: 4159204, + mood_sound: { + tick_delay: 6000, + offset: 2.0d, + sound: "minecraft:ambient.basalt_deltas.mood", + block_search_extent: 8 + } + }, + depth: 0.1f, + temperature: 2.0f, + scale: 0.2f, + downfall: 0.0f, + category: "nether" + } + } + ] + } +} From 1db40eb6c426a9a8c0ffb99d0edf95f794475d7d Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Thu, 9 Jun 2022 12:00:42 +0300 Subject: [PATCH 10/19] Fix Player Info packet --- .../ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java | 4 ---- .../nanit/limbo/protocol/packets/play/PacketPlayerInfo.java | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java index 403a1c1..12885b5 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketJoinGame.java @@ -17,15 +17,11 @@ package ru.nanit.limbo.protocol.packets.play; -import net.kyori.adventure.nbt.TagStringIO; import ru.nanit.limbo.protocol.ByteMessage; import ru.nanit.limbo.protocol.PacketOut; import ru.nanit.limbo.protocol.registry.Version; -import ru.nanit.limbo.server.Logger; import ru.nanit.limbo.world.dimension.DimensionRegistry; -import java.io.IOException; - public class PacketJoinGame implements PacketOut { private int entityId; diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketPlayerInfo.java b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketPlayerInfo.java index 9b211bd..4bb5fb3 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketPlayerInfo.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketPlayerInfo.java @@ -54,6 +54,9 @@ public class PacketPlayerInfo implements PacketOut { msg.writeVarInt(gameMode); msg.writeVarInt(60); msg.writeBoolean(false); + if (version.moreOrEqual(Version.V1_19)) { + msg.writeBoolean(false); + } } } From 5d33193c651219303a6ee31737166a91591f3475 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Thu, 9 Jun 2022 12:02:48 +0300 Subject: [PATCH 11/19] Fix boss bar --- src/main/java/ru/nanit/limbo/protocol/registry/State.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/State.java b/src/main/java/ru/nanit/limbo/protocol/registry/State.java index 3304638..674aaf8 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/State.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/State.java @@ -164,7 +164,7 @@ public enum State { map(0x0D, V1_15, V1_15_2), map(0x0C, V1_16, V1_16_4), map(0x0D, V1_17, V1_18_2), - map(0x0F, V1_19, V1_19) + map(0x0A, V1_19, V1_19) ); clientBound.register(PacketPlayerInfo::new, map(0x38, V1_8, V1_8), From 09cc1db851e7608a304fad6251dff942cd50c7ce Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Thu, 9 Jun 2022 13:15:46 +0300 Subject: [PATCH 12/19] Fix Header and Footer packet for 1.18 clients --- src/main/java/ru/nanit/limbo/protocol/registry/State.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/State.java b/src/main/java/ru/nanit/limbo/protocol/registry/State.java index 674aaf8..98bae2b 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/State.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/State.java @@ -210,7 +210,8 @@ public enum State { map(0x54, V1_15, V1_15_2), map(0x53, V1_16, V1_16_4), map(0x5E, V1_17, V1_17_1), - map(0x60, V1_18, V1_19) + map(0x5F, V1_18, V1_18_2), + map(0x60, V1_19, V1_19) ); } }; From 8d1dca1334f548b473135f6ae0c4a7d301d1fc58 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:15:50 +0300 Subject: [PATCH 13/19] Fix chat packet --- .../limbo/connection/PacketSnapshots.java | 2 +- .../packets/play/PacketChatMessage.java | 17 +- src/main/resources/dimension/codec_1_19.snbt | 171 ++++++++++++++++++ 3 files changed, 183 insertions(+), 7 deletions(-) diff --git a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java index 62e1937..1715f60 100644 --- a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java +++ b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java @@ -126,7 +126,7 @@ public final class PacketSnapshots { if (server.getConfig().isUseJoinMessage()) { PacketChatMessage joinMessage = new PacketChatMessage(); joinMessage.setJsonData(server.getConfig().getJoinMessage()); - joinMessage.setPosition(PacketChatMessage.Position.CHAT); + joinMessage.setPosition(PacketChatMessage.PositionLegacy.SYSTEM_MESSAGE); joinMessage.setSender(UUID.randomUUID()); PACKET_JOIN_MESSAGE = PacketSnapshot.of(joinMessage); } diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketChatMessage.java b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketChatMessage.java index ce1756e..8655e99 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketChatMessage.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/play/PacketChatMessage.java @@ -26,14 +26,14 @@ import java.util.UUID; public class PacketChatMessage implements PacketOut { private String jsonData; - private Position position; + private PositionLegacy position; private UUID sender; public void setJsonData(String jsonData) { this.jsonData = jsonData; } - public void setPosition(Position position) { + public void setPosition(PositionLegacy position) { this.position = position; } @@ -44,13 +44,18 @@ public class PacketChatMessage implements PacketOut { @Override public void encode(ByteMessage msg, Version version) { msg.writeString(jsonData); - msg.writeByte(position.index); + if (version.moreOrEqual(Version.V1_19)) { + msg.writeVarInt(position.index); + } + else { + msg.writeByte(position.index); + } - if (version.moreOrEqual(Version.V1_16)) + if (version.moreOrEqual(Version.V1_16) && version.less(Version.V1_19)) msg.writeUuid(sender); } - public enum Position { + public enum PositionLegacy { CHAT(0), SYSTEM_MESSAGE(1), @@ -58,7 +63,7 @@ public class PacketChatMessage implements PacketOut { private final int index; - Position(int index) { + PositionLegacy(int index) { this.index = index; } diff --git a/src/main/resources/dimension/codec_1_19.snbt b/src/main/resources/dimension/codec_1_19.snbt index 30d01ce..9e05af7 100644 --- a/src/main/resources/dimension/codec_1_19.snbt +++ b/src/main/resources/dimension/codec_1_19.snbt @@ -1,4 +1,175 @@ { + "minecraft:chat_type": { + type: "minecraft:chat_type", + value: [ + { + name: "minecraft:chat", + id: 0, + element: { + chat: { + decoration: { + style: {}, + translation_key: "chat.type.text", + parameters: [ + "sender", + "content", + ], + }, + }, + narration: { + priority: "chat", + decoration: { + style: {}, + translation_key: "chat.type.text.narrate", + parameters: [ + "sender", + "content", + ], + }, + }, + }, + }, + { + name: "minecraft:system", + id: 1, + element: { + chat: {}, + narration: { + priority: "system", + }, + }, + }, + { + name: "minecraft:game_info", + id: 2, + element: { + overlay: {}, + }, + }, + { + name: "minecraft:say_command", + id: 3, + element: { + chat: { + decoration: { + style: {}, + translation_key: "chat.type.announcement", + parameters: [ + "sender", + "content", + ], + }, + }, + narration: { + priority: "chat", + decoration: { + style: {}, + translation_key: "chat.type.text.narrate", + parameters: [ + "sender", + "content", + ], + }, + }, + }, + }, + { + name: "minecraft:msg_command", + id: 4, + element: { + chat: { + decoration: { + style: { + color: "gray", + italic: 1, + }, + translation_key: "commands.message.display.incoming", + parameters: [ + "sender", + "content", + ], + }, + }, + narration: { + priority: "chat", + decoration: { + style: {}, + translation_key: "chat.type.text.narrate", + parameters: [ + "sender", + "content", + ], + }, + }, + }, + }, + { + name: "minecraft:team_msg_command", + id: 5, + element: { + chat: { + decoration: { + style: {}, + translation_key: "chat.type.team.text", + parameters: [ + "team_name", + "sender", + "content", + ], + }, + }, + narration: { + priority: "chat", + decoration: { + style: {}, + translation_key: "chat.type.text.narrate", + parameters: [ + "sender", + "content", + ], + }, + }, + }, + }, + { + name: "minecraft:emote_command", + id: 6, + element: { + chat: { + decoration: { + style: {}, + translation_key: "chat.type.emote", + parameters: [ + "sender", + "content", + ], + }, + }, + narration: { + priority: "chat", + decoration: { + style: {}, + translation_key: "chat.type.emote", + parameters: [ + "sender", + "content", + ], + }, + }, + }, + }, + { + name: "minecraft:tellraw_command", + id: 7, + element: { + chat: {}, + narration: { + priority: "chat", + }, + }, + }, + ] + }, "minecraft:dimension_type": { type: "minecraft:dimension_type", value: [ From a3d49661504b6442261f430dfa067312a3f030a9 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:16:35 +0300 Subject: [PATCH 14/19] Update dependencies --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index dd621f1..29e65bb 100644 --- a/build.gradle +++ b/build.gradle @@ -15,8 +15,8 @@ dependencies { testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0' implementation 'org.spongepowered:configurate-yaml:4.1.2' - implementation 'io.netty:netty-all:4.1.73.Final' - implementation 'net.kyori:adventure-nbt:4.9.2' + implementation 'io.netty:netty-all:4.1.77.Final' + implementation 'net.kyori:adventure-nbt:4.10.1' implementation 'com.grack:nanojson:1.7' } From 226fd32c6ddbd09f170bd1992566222067faf199 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Thu, 9 Jun 2022 18:56:45 +0300 Subject: [PATCH 15/19] Remove unnecessary double reading 1.18.2 codec --- .../java/ru/nanit/limbo/world/dimension/DimensionRegistry.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java b/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java index 78418db..b043d7b 100644 --- a/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java +++ b/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java @@ -70,7 +70,6 @@ public final class DimensionRegistry { public void load(String def) throws IOException { codec_1_16 = readCodecFile("/dimension/codec_1_16.snbt"); codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt"); - codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt"); codec_1_19 = readCodecFile("/dimension/codec_1_19.snbt"); // On 1.16-1.16.1 different codec format oldCodec = readCodecFile("/dimension/codec_old.snbt"); From 32ea23591f767b01ce3893ad959e9fa75064750f Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Thu, 9 Jun 2022 19:12:53 +0300 Subject: [PATCH 16/19] Fix dimension for 1.19 --- src/main/java/ru/nanit/limbo/configuration/LimboConfig.java | 6 ++++++ .../java/ru/nanit/limbo/connection/PacketSnapshots.java | 5 +++-- .../ru/nanit/limbo/world/dimension/DimensionRegistry.java | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/ru/nanit/limbo/configuration/LimboConfig.java b/src/main/java/ru/nanit/limbo/configuration/LimboConfig.java index ae0ecbf..ac27ff1 100644 --- a/src/main/java/ru/nanit/limbo/configuration/LimboConfig.java +++ b/src/main/java/ru/nanit/limbo/configuration/LimboConfig.java @@ -87,6 +87,12 @@ public final class LimboConfig { maxPlayers = conf.node("maxPlayers").getInt(); pingData = conf.node("ping").get(PingData.class); dimensionType = conf.node("dimension").getString(); + if (dimensionType.equalsIgnoreCase("nether")) { + dimensionType = "the_nether"; + } + if (dimensionType.equalsIgnoreCase("end")) { + dimensionType = "the_end"; + } spawnPosition = conf.node("spawnPosition").get(Location.class); gameMode = conf.node("gameMode").getInt(); useBrandName = conf.node("brandName", "enable").getBoolean(); diff --git a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java index 1715f60..0ab5567 100644 --- a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java +++ b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java @@ -74,8 +74,9 @@ public final class PacketSnapshots { joinGame.setReducedDebugInfo(true); joinGame.setDebug(false); joinGame.setViewDistance(0); - joinGame.setWorldName("minecraft:overworld"); - joinGame.setWorldNames("minecraft:overworld"); + String worldName = "minecraft:" + server.getConfig().getDimensionType().toLowerCase(); + joinGame.setWorldName(worldName); + joinGame.setWorldNames(worldName); joinGame.setHashedSeed(0); joinGame.setDimensionRegistry(server.getDimensionRegistry()); diff --git a/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java b/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java index b043d7b..c5ae4cf 100644 --- a/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java +++ b/src/main/java/ru/nanit/limbo/world/dimension/DimensionRegistry.java @@ -88,7 +88,7 @@ public final class DimensionRegistry { switch (def.toLowerCase()) { case "overworld": return new Dimension(0, "minecraft:overworld", overWorld); - case "nether": + case "the_nether": return new Dimension(-1, "minecraft:nether", nether); case "the_end": return new Dimension(1, "minecraft:the_end", theEnd); From 1da0c8bc2c7d968231a0108029b01fd006b39f13 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Fri, 10 Jun 2022 13:00:01 +0300 Subject: [PATCH 17/19] Don't cache PacketStatusResponse --- src/main/java/ru/nanit/limbo/connection/PacketHandler.java | 3 ++- src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java | 3 --- src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/ru/nanit/limbo/connection/PacketHandler.java b/src/main/java/ru/nanit/limbo/connection/PacketHandler.java index f28ac27..48c6aa1 100644 --- a/src/main/java/ru/nanit/limbo/connection/PacketHandler.java +++ b/src/main/java/ru/nanit/limbo/connection/PacketHandler.java @@ -25,6 +25,7 @@ import ru.nanit.limbo.protocol.packets.login.PacketLoginPluginResponse; import ru.nanit.limbo.protocol.packets.login.PacketLoginStart; import ru.nanit.limbo.protocol.packets.status.PacketStatusPing; import ru.nanit.limbo.protocol.packets.status.PacketStatusRequest; +import ru.nanit.limbo.protocol.packets.status.PacketStatusResponse; import ru.nanit.limbo.server.LimboServer; import ru.nanit.limbo.server.Logger; import ru.nanit.limbo.util.UuidUtil; @@ -63,7 +64,7 @@ public class PacketHandler { } public void handle(ClientConnection conn, PacketStatusRequest packet) { - conn.sendPacket(PacketSnapshots.PACKET_STATUS_RESPONSE); + conn.sendPacket(new PacketStatusResponse(server)); } public void handle(ClientConnection conn, PacketStatusPing packet) { diff --git a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java index 0ab5567..6d1f929 100644 --- a/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java +++ b/src/main/java/ru/nanit/limbo/connection/PacketSnapshots.java @@ -21,7 +21,6 @@ import ru.nanit.limbo.LimboConstants; import ru.nanit.limbo.protocol.PacketSnapshot; import ru.nanit.limbo.protocol.packets.login.PacketLoginSuccess; import ru.nanit.limbo.protocol.packets.play.*; -import ru.nanit.limbo.protocol.packets.status.PacketStatusResponse; import ru.nanit.limbo.server.LimboServer; import ru.nanit.limbo.server.data.Title; import ru.nanit.limbo.util.UuidUtil; @@ -32,7 +31,6 @@ import java.util.concurrent.ThreadLocalRandom; public final class PacketSnapshots { - public static PacketSnapshot PACKET_STATUS_RESPONSE; public static PacketSnapshot PACKET_LOGIN_SUCCESS; public static PacketSnapshot PACKET_JOIN_GAME; public static PacketSnapshot PACKET_PLUGIN_MESSAGE; @@ -101,7 +99,6 @@ public final class PacketSnapshots { info.setGameMode(server.getConfig().getGameMode()); info.setUuid(uuid); - PACKET_STATUS_RESPONSE = PacketSnapshot.of(new PacketStatusResponse(server)); PACKET_LOGIN_SUCCESS = PacketSnapshot.of(loginSuccess); PACKET_JOIN_GAME = PacketSnapshot.of(joinGame); PACKET_PLAYER_ABILITIES = PacketSnapshot.of(playerAbilities); diff --git a/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java b/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java index 0dc2a65..8feaa91 100644 --- a/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java +++ b/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java @@ -45,6 +45,8 @@ public class PacketSnapshot implements PacketOut { Map hashes = new HashMap<>(); for (Version version : Version.values()) { + if (version.equals(Version.UNDEFINED)) continue; + ByteMessage encodedMessage = ByteMessage.create(); packet.encode(encodedMessage, version); From f8299d4e177c3ffaf0d1ca80c37eeb20afbe23f1 Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Sun, 26 Jun 2022 17:53:49 +0300 Subject: [PATCH 18/19] Fix accidental mapping change for PacketTitleLegacy --- src/main/java/ru/nanit/limbo/protocol/registry/State.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/State.java b/src/main/java/ru/nanit/limbo/protocol/registry/State.java index 98bae2b..8ebd2fc 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/State.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/State.java @@ -185,7 +185,7 @@ public enum State { map(0x4B, V1_13, V1_13_2), map(0x4F, V1_14, V1_14_4), map(0x50, V1_15, V1_15_2), - map(0x4F, V1_16, V1_19) + map(0x4F, V1_16, V1_16_4) ); clientBound.register(PacketTitleSetTitle::new, map(0x59, V1_17, V1_17_1), From c79b668a37c2150512d7e7fd165dc5f10f298c8c Mon Sep 17 00:00:00 2001 From: BoomEaro <21033866+BoomEaro@users.noreply.github.com> Date: Tue, 28 Jun 2022 13:09:58 +0300 Subject: [PATCH 19/19] Always compile project to java 8 with UTF-8 encoding --- build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.gradle b/build.gradle index 29e65bb..bcac8c3 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,15 @@ plugins { group 'ru.nanit' version '1.3.4' +compileJava { + options.encoding = "UTF-8" +} + +tasks.withType(JavaCompile) { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + repositories { mavenCentral() }