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/30] 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/30] 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/30] 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/30] 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 2cec5b8208f3976f009213af187f12431eab4ae5 Mon Sep 17 00:00:00 2001 From: kyngs <38181667+kyngs@users.noreply.github.com> Date: Fri, 11 Mar 2022 11:15:05 +0100 Subject: [PATCH 05/30] Add stop command and shutdown messages, so that the user knows, that something is happening :) --- .../ru/nanit/limbo/server/LimboServer.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/java/ru/nanit/limbo/server/LimboServer.java b/src/main/java/ru/nanit/limbo/server/LimboServer.java index c2f06ce..4197a8e 100644 --- a/src/main/java/ru/nanit/limbo/server/LimboServer.java +++ b/src/main/java/ru/nanit/limbo/server/LimboServer.java @@ -35,6 +35,7 @@ import ru.nanit.limbo.connection.PacketSnapshots; import ru.nanit.limbo.world.dimension.DimensionRegistry; import java.nio.file.Paths; +import java.util.Scanner; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; @@ -89,6 +90,25 @@ public final class LimboServer { Logger.info("Server started on %s", config.getAddress()); Logger.setLevel(config.getDebugLevel()); + + listenForStop(); + + } + + /** + * Listener for stop command, very basic implementation, but should do the thing. + *

+ * Under normal circumstances, this method never returns. + * It may return when the server was stopped from an outside source. + */ + private void listenForStop() { + Scanner scanner = new Scanner(System.in); + while (true) { + String line = scanner.nextLine(); + + //Ikr, yikes... + if (line.startsWith("stop")) System.exit(0); + } } private void startBootstrap() { @@ -120,6 +140,8 @@ public final class LimboServer { } private void stop() { + Logger.info("Stopping server..."); + if (keepAliveTask != null) { keepAliveTask.cancel(true); } @@ -131,6 +153,8 @@ public final class LimboServer { if (workerGroup != null) { workerGroup.shutdownGracefully(); } + + Logger.info("Server stopped, Goodbye!"); } } 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 06/30] 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 07/30] 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 08/30] 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 09/30] 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 10/30] 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 11/30] 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 12/30] 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 13/30] 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 14/30] 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 15/30] 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 16/30] 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 17/30] 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 18/30] 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 19/30] 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 20/30] 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() } From f81a2359823bdab78661fde9a2d20619b8b3cd15 Mon Sep 17 00:00:00 2001 From: Nanit Date: Thu, 30 Jun 2022 22:11:35 +0300 Subject: [PATCH 21/30] Changed version string. Removed unused javadoc --- build.gradle | 2 +- src/main/java/ru/nanit/limbo/server/LimboServer.java | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index bcac8c3..b849d73 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group 'ru.nanit' -version '1.3.4' +version '1.4' compileJava { options.encoding = "UTF-8" diff --git a/src/main/java/ru/nanit/limbo/server/LimboServer.java b/src/main/java/ru/nanit/limbo/server/LimboServer.java index 4197a8e..046299d 100644 --- a/src/main/java/ru/nanit/limbo/server/LimboServer.java +++ b/src/main/java/ru/nanit/limbo/server/LimboServer.java @@ -92,22 +92,16 @@ public final class LimboServer { Logger.setLevel(config.getDebugLevel()); listenForStop(); - } - /** - * Listener for stop command, very basic implementation, but should do the thing. - *

- * Under normal circumstances, this method never returns. - * It may return when the server was stopped from an outside source. - */ private void listenForStop() { Scanner scanner = new Scanner(System.in); + while (true) { String line = scanner.nextLine(); - //Ikr, yikes... - if (line.startsWith("stop")) System.exit(0); + if (line.startsWith("stop")) + System.exit(0); } } From 66ec1404fdde0e8275cd26a1abb9a8caed4bd93f Mon Sep 17 00:00:00 2001 From: Nanit Date: Thu, 30 Jun 2022 22:28:53 +0300 Subject: [PATCH 22/30] Moved command listener into separated thread --- .../ru/nanit/limbo/server/CommandManager.java | 22 +++++++++++++++++++ .../ru/nanit/limbo/server/LimboServer.java | 14 +----------- 2 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 src/main/java/ru/nanit/limbo/server/CommandManager.java diff --git a/src/main/java/ru/nanit/limbo/server/CommandManager.java b/src/main/java/ru/nanit/limbo/server/CommandManager.java new file mode 100644 index 0000000..21d9d66 --- /dev/null +++ b/src/main/java/ru/nanit/limbo/server/CommandManager.java @@ -0,0 +1,22 @@ +package ru.nanit.limbo.server; + +import java.util.Scanner; + +public final class CommandManager extends Thread { + + @Override + public void run() { + Scanner scanner = new Scanner(System.in); + + while (true) { + String line = scanner.nextLine(); + + if (line.equalsIgnoreCase("stop")) { + System.exit(0); + continue; + } + + Logger.info("Unknown command"); + } + } +} diff --git a/src/main/java/ru/nanit/limbo/server/LimboServer.java b/src/main/java/ru/nanit/limbo/server/LimboServer.java index 046299d..74b3c5b 100644 --- a/src/main/java/ru/nanit/limbo/server/LimboServer.java +++ b/src/main/java/ru/nanit/limbo/server/LimboServer.java @@ -35,7 +35,6 @@ import ru.nanit.limbo.connection.PacketSnapshots; import ru.nanit.limbo.world.dimension.DimensionRegistry; import java.nio.file.Paths; -import java.util.Scanner; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; @@ -91,18 +90,7 @@ public final class LimboServer { Logger.setLevel(config.getDebugLevel()); - listenForStop(); - } - - private void listenForStop() { - Scanner scanner = new Scanner(System.in); - - while (true) { - String line = scanner.nextLine(); - - if (line.startsWith("stop")) - System.exit(0); - } + new CommandManager().start(); } private void startBootstrap() { From 577b7a239a3235a63b6112c16b26c890cd18d137 Mon Sep 17 00:00:00 2001 From: Nanit Date: Thu, 30 Jun 2022 22:31:36 +0300 Subject: [PATCH 23/30] Edit README --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9900190..ddd396d 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,15 @@ Symbol `X` means all minor versions. - [x] 1.15.X - [x] 1.16.X - [x] 1.17.X -- [x] 1.18 +- [x] 1.18.X +- [x] 1.19 The server **doesn't** support snapshots. ### Commands -There are no commands. To close server just run `Ctrl+C` in the terminal. It will be closed correctly. +Write `stop` in the terminal to stop the server. +Note, that it also will be closed correctly if you just press `Ctrl+C`. ### Installation From 70d3b58bbffa2c758056812e2ba0d57c4398d8fd Mon Sep 17 00:00:00 2001 From: Nanit Date: Fri, 1 Jul 2022 12:37:52 +0300 Subject: [PATCH 24/30] Fixed command manager shutdown error. Code style --- .../limbo/protocol/packets/play/PacketJoinGame.java | 3 +-- src/main/java/ru/nanit/limbo/server/CommandManager.java | 9 ++++++++- 2 files changed, 9 insertions(+), 3 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 12885b5..a51f527 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 @@ -178,8 +178,7 @@ public class PacketJoinGame implements PacketOut { if (version.moreOrEqual(Version.V1_18_2)) { msg.writeCompoundTag(dimensionRegistry.getCodec_1_18_2()); msg.writeCompoundTag(dimensionRegistry.getDefaultDimension_1_18_2().getData()); - } - else { + } else { msg.writeCompoundTag(dimensionRegistry.getCodec_1_16()); msg.writeCompoundTag(dimensionRegistry.getDefaultDimension_1_16().getData()); } diff --git a/src/main/java/ru/nanit/limbo/server/CommandManager.java b/src/main/java/ru/nanit/limbo/server/CommandManager.java index 21d9d66..fbb9192 100644 --- a/src/main/java/ru/nanit/limbo/server/CommandManager.java +++ b/src/main/java/ru/nanit/limbo/server/CommandManager.java @@ -1,5 +1,6 @@ package ru.nanit.limbo.server; +import java.util.NoSuchElementException; import java.util.Scanner; public final class CommandManager extends Thread { @@ -7,9 +8,14 @@ public final class CommandManager extends Thread { @Override public void run() { Scanner scanner = new Scanner(System.in); + String line; while (true) { - String line = scanner.nextLine(); + try { + line = scanner.nextLine(); + } catch (NoSuchElementException e) { + break; + } if (line.equalsIgnoreCase("stop")) { System.exit(0); @@ -19,4 +25,5 @@ public final class CommandManager extends Thread { Logger.info("Unknown command"); } } + } From 1f2558602cdfb4787f20d259d9d0fbc0ae45db69 Mon Sep 17 00:00:00 2001 From: Nanit Date: Fri, 1 Jul 2022 12:55:00 +0300 Subject: [PATCH 25/30] Edit javadoc --- src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java | 5 ++--- 1 file changed, 2 insertions(+), 3 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..2be6f01 100644 --- a/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java +++ b/src/main/java/ru/nanit/limbo/protocol/PacketSnapshot.java @@ -23,9 +23,8 @@ import java.util.HashMap; import java.util.Map; /** - * PacketSnapshot encodes packet to byt array for each MC version. - * Some versions have same snapshot, so there are mappings - * to avoid storing same bytes array for different versions + * PacketSnapshot encodes packet to byte array for each MC version. + * Some versions have same snapshot, so there are mappings to avoid data copying */ public class PacketSnapshot implements PacketOut { From e4f90b4de78af217e5b8be7489f84ff0eed4e79a Mon Sep 17 00:00:00 2001 From: Nan1t Date: Fri, 1 Jul 2022 16:35:47 -0500 Subject: [PATCH 26/30] Added additional commands --- .../connection/pipeline/PacketEncoder.java | 2 +- .../java/ru/nanit/limbo/server/Command.java | 9 ++++ .../ru/nanit/limbo/server/CommandManager.java | 44 ++++++++++++++++--- .../ru/nanit/limbo/server/LimboServer.java | 12 ++++- .../nanit/limbo/server/commands/CmdConn.java | 24 ++++++++++ .../nanit/limbo/server/commands/CmdHelp.java | 37 ++++++++++++++++ .../nanit/limbo/server/commands/CmdMem.java | 27 ++++++++++++ .../nanit/limbo/server/commands/CmdStop.java | 16 +++++++ 8 files changed, 162 insertions(+), 9 deletions(-) create mode 100644 src/main/java/ru/nanit/limbo/server/Command.java create mode 100644 src/main/java/ru/nanit/limbo/server/commands/CmdConn.java create mode 100644 src/main/java/ru/nanit/limbo/server/commands/CmdHelp.java create mode 100644 src/main/java/ru/nanit/limbo/server/commands/CmdMem.java create mode 100644 src/main/java/ru/nanit/limbo/server/commands/CmdStop.java 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 26e9282..4885aa8 100644 --- a/src/main/java/ru/nanit/limbo/connection/pipeline/PacketEncoder.java +++ b/src/main/java/ru/nanit/limbo/connection/pipeline/PacketEncoder.java @@ -60,7 +60,7 @@ public class PacketEncoder extends MessageToByteEncoder { try { packet.encode(msg, version); - if (Logger.getLevel() >= 3) { + if (Logger.getLevel() >= Logger.Level.DEBUG.getIndex()) { Logger.debug("Sending %s[0x%s] packet (%d bytes)", packet.toString(), Integer.toHexString(packetId), msg.readableBytes()); } } catch (Exception e) { diff --git a/src/main/java/ru/nanit/limbo/server/Command.java b/src/main/java/ru/nanit/limbo/server/Command.java new file mode 100644 index 0000000..c1c7419 --- /dev/null +++ b/src/main/java/ru/nanit/limbo/server/Command.java @@ -0,0 +1,9 @@ +package ru.nanit.limbo.server; + +public interface Command { + + void execute(); + + String description(); + +} diff --git a/src/main/java/ru/nanit/limbo/server/CommandManager.java b/src/main/java/ru/nanit/limbo/server/CommandManager.java index fbb9192..e05fc18 100644 --- a/src/main/java/ru/nanit/limbo/server/CommandManager.java +++ b/src/main/java/ru/nanit/limbo/server/CommandManager.java @@ -1,29 +1,59 @@ package ru.nanit.limbo.server; -import java.util.NoSuchElementException; -import java.util.Scanner; +import ru.nanit.limbo.server.commands.CmdConn; +import ru.nanit.limbo.server.commands.CmdHelp; +import ru.nanit.limbo.server.commands.CmdMem; +import ru.nanit.limbo.server.commands.CmdStop; + +import java.util.*; public final class CommandManager extends Thread { + private final Map commands = new HashMap<>(); + + public Map getCommands() { + return Collections.unmodifiableMap(commands); + } + + public Command getCommand(String name) { + return commands.get(name.toLowerCase()); + } + + public void register(String name, Command cmd) { + commands.put(name.toLowerCase(), cmd); + } + @Override public void run() { Scanner scanner = new Scanner(System.in); - String line; + String command; while (true) { try { - line = scanner.nextLine(); + command = scanner.nextLine().trim(); } catch (NoSuchElementException e) { break; } - if (line.equalsIgnoreCase("stop")) { - System.exit(0); + Command handler = getCommand(command); + + if (handler != null) { + try { + handler.execute(); + } catch (Throwable t) { + Logger.error("Cannot execute command:", t); + } continue; } - Logger.info("Unknown command"); + Logger.info("Unknown command. Type \"help\" to get commands list"); } } + public void registerAll(LimboServer server) { + register("help", new CmdHelp(server)); + register("conn", new CmdConn(server)); + register("mem", new CmdMem()); + register("stop", new CmdStop()); + } } diff --git a/src/main/java/ru/nanit/limbo/server/LimboServer.java b/src/main/java/ru/nanit/limbo/server/LimboServer.java index 74b3c5b..a9ada1c 100644 --- a/src/main/java/ru/nanit/limbo/server/LimboServer.java +++ b/src/main/java/ru/nanit/limbo/server/LimboServer.java @@ -49,6 +49,8 @@ public final class LimboServer { private EventLoopGroup bossGroup; private EventLoopGroup workerGroup; + private CommandManager commandManager; + public LimboConfig getConfig() { return config; } @@ -65,6 +67,10 @@ public final class LimboServer { return dimensionRegistry; } + public CommandManager getCommandManager() { + return commandManager; + } + public void start() throws Exception { Logger.info("Starting server..."); @@ -90,7 +96,11 @@ public final class LimboServer { Logger.setLevel(config.getDebugLevel()); - new CommandManager().start(); + commandManager = new CommandManager(); + commandManager.registerAll(this); + commandManager.start(); + + System.gc(); } private void startBootstrap() { diff --git a/src/main/java/ru/nanit/limbo/server/commands/CmdConn.java b/src/main/java/ru/nanit/limbo/server/commands/CmdConn.java new file mode 100644 index 0000000..b93e6f5 --- /dev/null +++ b/src/main/java/ru/nanit/limbo/server/commands/CmdConn.java @@ -0,0 +1,24 @@ +package ru.nanit.limbo.server.commands; + +import ru.nanit.limbo.server.Command; +import ru.nanit.limbo.server.LimboServer; +import ru.nanit.limbo.server.Logger; + +public class CmdConn implements Command { + + private final LimboServer server; + + public CmdConn(LimboServer server) { + this.server = server; + } + + @Override + public void execute() { + Logger.info("Connections: %d", server.getConnections().getCount()); + } + + @Override + public String description() { + return "Display connections count"; + } +} diff --git a/src/main/java/ru/nanit/limbo/server/commands/CmdHelp.java b/src/main/java/ru/nanit/limbo/server/commands/CmdHelp.java new file mode 100644 index 0000000..7adeb6f --- /dev/null +++ b/src/main/java/ru/nanit/limbo/server/commands/CmdHelp.java @@ -0,0 +1,37 @@ +package ru.nanit.limbo.server.commands; + +import ru.nanit.limbo.server.Command; +import ru.nanit.limbo.server.LimboServer; + +import java.util.Map; + +public class CmdHelp implements Command { + + private final LimboServer server; + + public CmdHelp(LimboServer server) { + this.server = server; + } + + @Override + public void execute() { + StringBuilder msg = new StringBuilder(); + Map commands = server.getCommandManager().getCommands(); + + for (Map.Entry entry : commands.entrySet()) { + msg.append("\n"); + msg.append(entry.getKey()); + msg.append(" - "); + msg.append(entry.getValue().description()); + } + + msg.append("\n"); + + System.out.println(msg); + } + + @Override + public String description() { + return "Show this message"; + } +} diff --git a/src/main/java/ru/nanit/limbo/server/commands/CmdMem.java b/src/main/java/ru/nanit/limbo/server/commands/CmdMem.java new file mode 100644 index 0000000..7809f81 --- /dev/null +++ b/src/main/java/ru/nanit/limbo/server/commands/CmdMem.java @@ -0,0 +1,27 @@ +package ru.nanit.limbo.server.commands; + +import ru.nanit.limbo.server.Command; +import ru.nanit.limbo.server.Logger; + +public class CmdMem implements Command { + + @Override + public void execute() { + Runtime runtime = Runtime.getRuntime(); + long mb = 1024 * 1024; + long used = (runtime.totalMemory() - runtime.freeMemory()) / mb; + long total = runtime.totalMemory() / mb; + long free = runtime.freeMemory() / mb; + long max = runtime.maxMemory() / mb; + + Logger.info("Used: %d MB", used); + Logger.info("Total: %d MB", total); + Logger.info("Free: %d MB", free); + Logger.info("Max: %d MB", max); + } + + @Override + public String description() { + return "Display memory usage"; + } +} diff --git a/src/main/java/ru/nanit/limbo/server/commands/CmdStop.java b/src/main/java/ru/nanit/limbo/server/commands/CmdStop.java new file mode 100644 index 0000000..4120211 --- /dev/null +++ b/src/main/java/ru/nanit/limbo/server/commands/CmdStop.java @@ -0,0 +1,16 @@ +package ru.nanit.limbo.server.commands; + +import ru.nanit.limbo.server.Command; + +public class CmdStop implements Command { + + @Override + public void execute() { + System.exit(0); + } + + @Override + public String description() { + return "Stop the server"; + } +} From c8a3284c047131001a82d68ff6c3f20985ce35c2 Mon Sep 17 00:00:00 2001 From: Nan1t Date: Fri, 1 Jul 2022 17:42:16 -0500 Subject: [PATCH 27/30] Added commands in README --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ddd396d..73566f0 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,11 @@ The server **doesn't** support snapshots. ### Commands -Write `stop` in the terminal to stop the server. +* `help` - Show help message +* `conn` - Display amount of connections +* `mem` - Display memory usage stats +* `stop` - Stop the server + Note, that it also will be closed correctly if you just press `Ctrl+C`. ### Installation From e0e5a4ae56135907762515ca9d256a7c90af3987 Mon Sep 17 00:00:00 2001 From: Nan1t Date: Fri, 1 Jul 2022 17:52:04 -0500 Subject: [PATCH 28/30] Added commands header --- .../ru/nanit/limbo/server/commands/CmdHelp.java | 13 ++++--------- .../java/ru/nanit/limbo/server/commands/CmdMem.java | 1 + 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/ru/nanit/limbo/server/commands/CmdHelp.java b/src/main/java/ru/nanit/limbo/server/commands/CmdHelp.java index 7adeb6f..6d25e4a 100644 --- a/src/main/java/ru/nanit/limbo/server/commands/CmdHelp.java +++ b/src/main/java/ru/nanit/limbo/server/commands/CmdHelp.java @@ -2,6 +2,7 @@ package ru.nanit.limbo.server.commands; import ru.nanit.limbo.server.Command; import ru.nanit.limbo.server.LimboServer; +import ru.nanit.limbo.server.Logger; import java.util.Map; @@ -15,19 +16,13 @@ public class CmdHelp implements Command { @Override public void execute() { - StringBuilder msg = new StringBuilder(); Map commands = server.getCommandManager().getCommands(); + Logger.info("Available commands:"); + for (Map.Entry entry : commands.entrySet()) { - msg.append("\n"); - msg.append(entry.getKey()); - msg.append(" - "); - msg.append(entry.getValue().description()); + Logger.info("%s - %s", entry.getKey(), entry.getValue().description()); } - - msg.append("\n"); - - System.out.println(msg); } @Override diff --git a/src/main/java/ru/nanit/limbo/server/commands/CmdMem.java b/src/main/java/ru/nanit/limbo/server/commands/CmdMem.java index 7809f81..bb5f65a 100644 --- a/src/main/java/ru/nanit/limbo/server/commands/CmdMem.java +++ b/src/main/java/ru/nanit/limbo/server/commands/CmdMem.java @@ -14,6 +14,7 @@ public class CmdMem implements Command { long free = runtime.freeMemory() / mb; long max = runtime.maxMemory() / mb; + Logger.info("Memory usage:"); Logger.info("Used: %d MB", used); Logger.info("Total: %d MB", total); Logger.info("Free: %d MB", free); From 613f6e75b2d3a5273e35955d4df46690e808d5a0 Mon Sep 17 00:00:00 2001 From: Nan1t Date: Sat, 2 Jul 2022 06:51:41 -0500 Subject: [PATCH 29/30] Trying to add .guthub folder --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..be367b9 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +ko_fi: nanit \ No newline at end of file From 87debafbadf0202c9ad7b4f3a4d5fa46749cf8cb Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sat, 2 Jul 2022 19:30:52 -0500 Subject: [PATCH 30/30] Update Gradle version to latest (7.4.2) --- gradle/wrapper/gradle-wrapper.jar | Bin 59536 -> 59821 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 269 ++++++++++++++--------- gradlew.bat | 178 +++++++-------- 4 files changed, 249 insertions(+), 200 deletions(-) mode change 100644 => 100755 gradlew diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae8848c63b8b4dea2cb829da983f2fa..41d9927a4d4fb3f96a785543079b8df6723c946b 100644 GIT binary patch delta 8958 zcmY+KWl$VIlZIh&f(Hri?gR<$?iyT!TL`X;1^2~W7YVSq1qtqM!JWlDxLm%}UESUM zndj}Uny%^UnjhVhFb!8V3s(a#fIy>`VW15{5nuy;_V&a5O#0S&!a4dSkUMz_VHu3S zGA@p9Q$T|Sj}tYGWdjH;Mpp8m&yu&YURcrt{K;R|kM~(*{v%QwrBJIUF+K1kX5ZmF zty3i{d`y0;DgE+de>vN@yYqFPe1Ud{!&G*Q?iUc^V=|H%4~2|N zW+DM)W!`b&V2mQ0Y4u_)uB=P@-2`v|Wm{>CxER1P^ z>c}ZPZ)xxdOCDu59{X^~2id7+6l6x)U}C4Em?H~F`uOxS1?}xMxTV|5@}PlN%Cg$( zwY6c}r60=z5ZA1L zTMe;84rLtYvcm?M(H~ZqU;6F7Evo{P7!LGcdwO|qf1w+)MsnvK5^c@Uzj<{ zUoej1>95tuSvDJ|5K6k%&UF*uE6kBn47QJw^yE&#G;u^Z9oYWrK(+oL97hBsUMc_^ z;-lmxebwlB`Er_kXp2$`&o+rPJAN<`WX3ws2K{q@qUp}XTfV{t%KrsZ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radle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 05679dc..aa991fc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index 744e882..1b6c787 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MSYS* | MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 107acd3..ac1b06f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega