Compare commits

..

6 Commits
v1.8 ... main

Author SHA1 Message Date
Nan1t
a5b9e3510d Edit readme 2024-06-14 13:23:20 +03:00
Nan1t
155e6cc6c3 Renamed some keys in dimension codec. Increased version. 2024-06-14 13:21:58 +03:00
Nan1t
b99a533e1a Fixed spelling. Removed unnecessary var 2024-06-14 13:09:07 +03:00
Nan1t
94edb65dac Experimental support for 1.21 2024-06-14 12:51:09 +03:00
Nan1t
48346762bf Edit README.md 2024-05-02 17:36:57 +03:00
Max
402484c838
Update README.md 2024-05-02 17:31:57 +03:00
7 changed files with 2870 additions and 40 deletions

View File

@ -35,7 +35,8 @@ Symbol `X` means all minor versions.
- [x] 1.17.X
- [x] 1.18.X
- [x] 1.19.X
- [x] 1.20-1.20.6
- [x] 1.20.X
- [x] 1.21
The server **doesn't** support snapshots.
@ -50,6 +51,8 @@ Note that the server also will be closed correctly if you just press `Ctrl+C`.
### Installation
Required software: JRE 11+
The installation process is simple.
1. Download the latest version of the program [**here**](https://github.com/Nan1t/NanoLimbo/releases).
@ -82,7 +85,7 @@ to add some functionality that is suitable for a limbo server and won't signific
Required software:
* JDK 1.8+
* JDK 11+
* Gradle 7+ (optional)
To build a minimized jar, go to the project root directory and run in the terminal:

View File

@ -5,7 +5,7 @@ plugins {
}
group 'ua.nanit'
version '1.8'
version '1.8.1'
compileJava {
options.encoding = "UTF-8"

View File

@ -199,16 +199,16 @@ public final class PacketSnapshots {
PACKET_REGISTRY_DATA = PacketSnapshot.of(packetRegistryData);
Dimension dimension1_20_5 = server.getDimensionRegistry().getDimension_1_20_5();
Dimension dimension1_21 = server.getDimensionRegistry().getDimension_1_21();
List<PacketSnapshot> packetRegistries = new ArrayList<>();
CompoundBinaryTag dimensionTag = dimension1_20_5.getData();
CompoundBinaryTag dimensionTag = dimension1_21.getData();
for (String registryType : dimensionTag.keySet()) {
CompoundBinaryTag compundRegistryType = dimensionTag.getCompound(registryType);
CompoundBinaryTag compoundRegistryType = dimensionTag.getCompound(registryType);
PacketRegistryData registryData = new PacketRegistryData();
registryData.setDimensionRegistry(server.getDimensionRegistry());
ListBinaryTag values = compundRegistryType.getList("value");
ListBinaryTag values = compoundRegistryType.getList("value");
registryData.setMetadataWriter((message, version) -> {
message.writeString(registryType);

View File

@ -66,7 +66,7 @@ public enum State {
);
serverBound.register(
PacketLoginAcknowledged::new,
map(0x03, V1_20_2, V1_20_5)
map(0x03, V1_20_2, Version.getMax())
);
clientBound.register(PacketDisconnect::new,
map(0x00, Version.getMin(), Version.getMax())
@ -84,43 +84,43 @@ public enum State {
clientBound.register(
PacketPluginMessage::new,
map(0x00, V1_20_2, V1_20_3),
map(0x01, V1_20_5, V1_20_5)
map(0x01, V1_20_5, V1_21)
);
clientBound.register(
PacketDisconnect::new,
map(0x01, V1_20_2, V1_20_3),
map(0x02, V1_20_5, V1_20_5)
map(0x02, V1_20_5, V1_21)
);
clientBound.register(
PacketFinishConfiguration::new,
map(0x02, V1_20_2, V1_20_3),
map(0x03, V1_20_5, V1_20_5)
map(0x03, V1_20_5, V1_21)
);
clientBound.register(
PacketKeepAlive::new,
map(0x03, V1_20_2, V1_20_3),
map(0x04, V1_20_5, V1_20_5)
map(0x04, V1_20_5, V1_21)
);
clientBound.register(
PacketRegistryData::new,
map(0x05, V1_20_2, V1_20_3),
map(0x07, V1_20_5, V1_20_5)
map(0x07, V1_20_5, V1_21)
);
serverBound.register(
PacketPluginMessage::new,
map(0x01, V1_20_2, V1_20_3),
map(0x02, V1_20_2, V1_20_5)
map(0x02, V1_20_2, V1_21)
);
serverBound.register(
PacketFinishConfiguration::new,
map(0x02, V1_20_2, V1_20_3),
map(0x03, V1_20_5, V1_20_5)
map(0x03, V1_20_5, V1_21)
);
serverBound.register(
PacketKeepAlive::new,
map(0x03, V1_20_2, V1_20_3),
map(0x04, V1_20_5, V1_20_5)
map(0x04, V1_20_5, V1_21)
);
}
},
@ -141,7 +141,7 @@ public enum State {
map(0x12, V1_19_4, V1_20),
map(0x14, V1_20_2, V1_20_2),
map(0x15, V1_20_3, V1_20_3),
map(0x18, V1_20_5, V1_20_5)
map(0x18, V1_20_5, V1_21)
);
clientBound.register(PacketDeclareCommands::new,
@ -153,7 +153,7 @@ public enum State {
map(0x0F, V1_19, V1_19_1),
map(0x0E, V1_19_3, V1_19_3),
map(0x10, V1_19_4, V1_20),
map(0x11, V1_20_2, V1_20_5)
map(0x11, V1_20_2, V1_21)
);
clientBound.register(PacketJoinGame::new,
map(0x01, V1_7_2, V1_8),
@ -168,7 +168,7 @@ public enum State {
map(0x24, V1_19_3, V1_19_3),
map(0x28, V1_19_4, V1_20),
map(0x29, V1_20_2, V1_20_3),
map(0x2B, V1_20_5, V1_20_5)
map(0x2B, V1_20_5, V1_21)
);
clientBound.register(PacketPluginMessage::new,
map(0x19, V1_13, V1_13_2),
@ -182,7 +182,7 @@ public enum State {
map(0x15, V1_19_3, V1_19_3),
map(0x17, V1_19_4, V1_20),
map(0x18, V1_20_2, V1_20_3),
map(0x19, V1_20_5, V1_20_5)
map(0x19, V1_20_5, V1_21)
);
clientBound.register(PacketPlayerAbilities::new,
map(0x39, V1_7_2, V1_8),
@ -199,7 +199,7 @@ public enum State {
map(0x30, V1_19_3, V1_19_3),
map(0x34, V1_19_4, V1_20),
map(0x36, V1_20_2, V1_20_3),
map(0x38, V1_20_5, V1_20_5)
map(0x38, V1_20_5, V1_21)
);
clientBound.register(PacketPlayerPositionAndLook::new,
map(0x08, V1_7_2, V1_8),
@ -216,7 +216,7 @@ public enum State {
map(0x38, V1_19_3, V1_19_3),
map(0x3C, V1_19_4, V1_20),
map(0x3E, V1_20_2, V1_20_3),
map(0x40, V1_20_5, V1_20_5)
map(0x40, V1_20_5, V1_21)
);
clientBound.register(PacketKeepAlive::new,
map(0x00, V1_7_2, V1_8),
@ -232,7 +232,7 @@ public enum State {
map(0x1F, V1_19_3, V1_19_3),
map(0x23, V1_19_4, V1_20),
map(0x24, V1_20_2, V1_20_3),
map(0x26, V1_20_5, V1_20_5)
map(0x26, V1_20_5, V1_21)
);
clientBound.register(PacketChatMessage::new,
map(0x02, V1_7_2, V1_8),
@ -247,7 +247,7 @@ public enum State {
map(0x64, V1_19_4, V1_20),
map(0x67, V1_20_2, V1_20_2),
map(0x69, V1_20_3, V1_20_3),
map(0x6C, V1_20_5, V1_20_5)
map(0x6C, V1_20_5, V1_21)
);
clientBound.register(PacketBossBar::new,
map(0x0C, V1_9, V1_14_4),
@ -256,7 +256,7 @@ public enum State {
map(0x0D, V1_17, V1_18_2),
map(0x0A, V1_19, V1_19_3),
map(0x0B, V1_19_4, V1_20),
map(0x0A, V1_20_2, V1_20_5)
map(0x0A, V1_20_2, V1_21)
);
clientBound.register(PacketPlayerInfo::new,
map(0x38, V1_7_2, V1_8),
@ -273,7 +273,7 @@ public enum State {
map(0x36, V1_19_3, V1_19_3),
map(0x3A, V1_19_4, V1_20),
map(0x3C, V1_20_2, V1_20_3),
map(0x3E, V1_20_5, V1_20_5)
map(0x3E, V1_20_5, V1_21)
);
clientBound.register(PacketTitleLegacy::new,
map(0x45, V1_8, V1_11_1),
@ -292,7 +292,7 @@ public enum State {
map(0x5F, V1_19_4, V1_20),
map(0x61, V1_20_2, V1_20_2),
map(0x63, V1_20_3, V1_20_3),
map(0x65, V1_20_5, V1_20_5)
map(0x65, V1_20_5, V1_21)
);
clientBound.register(PacketTitleSetSubTitle::new,
map(0x57, V1_17, V1_17_1),
@ -302,7 +302,7 @@ public enum State {
map(0x5D, V1_19_4, V1_20),
map(0x5F, V1_20_2, V1_20_2),
map(0x61, V1_20_3, V1_20_3),
map(0x63, V1_20_5, V1_20_5)
map(0x63, V1_20_5, V1_21)
);
clientBound.register(PacketTitleTimes::new,
map(0x5A, V1_17, V1_17_1),
@ -312,7 +312,7 @@ public enum State {
map(0x60, V1_19_4, V1_20),
map(0x62, V1_20_2, V1_20_2),
map(0x64, V1_20_3, V1_20_3),
map(0x66, V1_20_5, V1_20_5)
map(0x66, V1_20_5, V1_21)
);
clientBound.register(PacketPlayerListHeader::new,
map(0x47, V1_8, V1_8),
@ -332,22 +332,22 @@ public enum State {
map(0x65, V1_19_4, V1_20),
map(0x68, V1_20_2, V1_20_2),
map(0x6A, V1_20_3, V1_20_3),
map(0x6D, V1_20_5, V1_20_5)
map(0x6D, V1_20_5, V1_21)
);
clientBound.register(PacketSpawnPosition::new,
map(0x4C, V1_19_3, V1_19_3),
map(0x50, V1_19_4, V1_20),
map(0x52, V1_20_2, V1_20_2),
map(0x54, V1_20_3, V1_20_3),
map(0x56, V1_20_5, V1_20_5)
map(0x56, V1_20_5, V1_21)
);
clientBound.register(PacketGameEvent::new,
map(0x20, V1_20_3, V1_20_3),
map(0x22, V1_20_5, V1_20_5)
map(0x22, V1_20_5, V1_21)
);
clientBound.register(PacketEmptyChunk::new,
map(0x25, V1_20_3, V1_20_3),
map(0x27, V1_20_5, V1_20_5)
map(0x27, V1_20_5, V1_21)
);
}
};

View File

@ -72,7 +72,9 @@ public enum Version {
// 1.20.1 has same protocol number
V1_20_2(764),
V1_20_3(765),
V1_20_5(766);
V1_20_5(766),
// 1.20.6 has same protocol number
V1_21(767);
private static final Map<Integer, Version> VERSION_MAP;
private static final Version MAX;

View File

@ -34,6 +34,7 @@ public final class DimensionRegistry {
private Dimension defaultDimension_1_16;
private Dimension defaultDimension_1_18_2;
private Dimension dimension_1_20_5;
private Dimension dimension_1_21;
private CompoundBinaryTag codec_1_16;
private CompoundBinaryTag codec_1_18_2;
@ -41,6 +42,7 @@ public final class DimensionRegistry {
private CompoundBinaryTag codec_1_19_1;
private CompoundBinaryTag codec_1_19_4;
private CompoundBinaryTag codec_1_20;
private CompoundBinaryTag codec_1_21;
private CompoundBinaryTag oldCodec;
public DimensionRegistry(LimboServer server) {
@ -71,6 +73,10 @@ public final class DimensionRegistry {
return codec_1_20;
}
public CompoundBinaryTag getCodec_1_21() {
return codec_1_21;
}
public CompoundBinaryTag getOldCodec() {
return oldCodec;
}
@ -87,20 +93,26 @@ public final class DimensionRegistry {
return dimension_1_20_5;
}
public Dimension getDimension_1_21() {
return dimension_1_21;
}
public void load(String def) throws IOException {
// On 1.16-1.16.1 different codec format
oldCodec = readCodecFile("/dimension/codec_old.snbt");
codec_1_16 = readCodecFile("/dimension/codec_1_16.snbt");
codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt");
codec_1_19 = readCodecFile("/dimension/codec_1_19.snbt");
codec_1_19_1 = readCodecFile("/dimension/codec_1_19_1.snbt");
codec_1_19_4 = readCodecFile("/dimension/codec_1_19_4.snbt");
codec_1_20 = readCodecFile("/dimension/codec_1_20.snbt");
// On 1.16-1.16.1 different codec format
oldCodec = readCodecFile("/dimension/codec_old.snbt");
codec_1_21 = readCodecFile("/dimension/codec_1_21.snbt");
defaultDimension_1_16 = getDefaultDimension(def, codec_1_16);
defaultDimension_1_18_2 = getDefaultDimension(def, codec_1_18_2);
dimension_1_20_5 = getModernDimension(def, codec_1_20);
dimension_1_21 = getModernDimension(def, codec_1_21);
}
private Dimension getDefaultDimension(String def, CompoundBinaryTag tag) {
@ -148,10 +160,7 @@ public final class DimensionRegistry {
private String streamToString(InputStream in) throws IOException {
try (BufferedReader bufReader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))) {
String content = bufReader.lines()
.collect(Collectors.joining("\n"));
return content;
return bufReader.lines().collect(Collectors.joining("\n"));
}
}
}

File diff suppressed because it is too large Load Diff