Skip to content

Commit

Permalink
Merge branch 'Nan1t_main' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	api/src/main/resources/dimension/codec_1_19_4.snbt
#	build.gradle
  • Loading branch information
bivashy committed Mar 20, 2023
2 parents 0b461e8 + dbeb7cc commit 226ad70
Show file tree
Hide file tree
Showing 8 changed files with 2,847 additions and 56 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is lightweight minecraft limbo server, written on Java with Netty.
The main goal of the project is maximum simplicity with a minimum number of sent and processed packets.
This limbo is empty, there are no ability to set schematic building since
This limbo is empty, there are no ability to set schematic building since
this is not necessary. You can send useful information in chat or BossBar.

No plugins, no logs. The server is fully clear. It only able keep a lot of players while the main server is down.
Expand Down Expand Up @@ -34,10 +34,7 @@ Symbol `X` means all minor versions.
- [x] 1.16.X
- [x] 1.17.X
- [x] 1.18.X
- [x] 1.19
- [x] 1.19.1
- [x] 1.19.2
- [x] 1.19.3
- [x] 1.19.X

The server **doesn't** support snapshots.

Expand All @@ -57,7 +54,7 @@ The installation process is simple.
1. Download the latest version of program **[here](https://github.com/Nan1t/NanoLimbo/releases)**
2. Put jar file in the folder you want.
3. Create a start script as you did it for Bukkit or BungeeCord with command like this:
`java -jar NanoLimbo-<version>.jar`
`java -jar NanoLimbo-<version>.jar`
4. The server will create `settings.yml` file. It's a server configuration.
5. Configure it as you want and restart server.

Expand All @@ -70,22 +67,24 @@ The server supports player info forwarding from the proxy. There are several typ
* `BUNGEE_GUARD` - **BungeeGuard** forwarding type.

If you use BungeeCord, or Velocity with `LEGACY` forwarding, just set this type in the config.
If you use Velocity with `MODERN` info forwarding, set this type and paste secret key from Velocity
If you use Velocity with `MODERN` info forwarding, set this type and paste secret key from Velocity
config into `secret` field.
If you installed BungeeGuard on your proxy, then use `BUNGEE_GUARD` forwarding type.
If you installed BungeeGuard on your proxy, then use `BUNGEE_GUARD` forwarding type.
Then add your tokens to `tokens` list.

### Contributing

You can create pull request, if you found some bug, optimization ability, or you want to add some functional,
You can create pull request, if you found some bug, optimization ability, or you want to add some functional,
which is suitable for limbo server and won't significantly load the server.

All PR's should be targeted to the `dev` branch to keep the `main` stable and clear.

### Building

Required software:

* JDK 1.8+
* Gradle 7+
* Gradle 7+ (optional)

To build minimized .jar, go to project root and write in terminal:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ public void encode(ByteMessage msg, Version version) {
msg.writeByte(previousGameMode);
msg.writeStringsArray(worldNames);
if (version.moreOrEqual(Version.V1_19_1)) {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_1());
if (version.moreOrEqual(Version.V1_19_4)) {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_4());
}
else {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_1());
}
}
else {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void encode(ByteMessage msg, Version version) {
msg.writeVarInt(teleportId);
}

if (version.moreOrEqual(Version.V1_17)) {
if (version.fromTo(Version.V1_17, Version.V1_19_3)) {
msg.writeBoolean(false); // Dismount vehicle
}
}
Expand Down
45 changes: 30 additions & 15 deletions api/src/main/java/ua/nanit/limbo/protocol/registry/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public enum State {
map(0x0F, V1_17, V1_18_2),
map(0x11, V1_19, V1_19),
map(0x12, V1_19_1, V1_19_1),
map(0x11, V1_19_3, V1_19_3)
map(0x11, V1_19_3, V1_19_3),
map(0x12, V1_19_4, V1_19_4)
);

clientBound.register(PacketDeclareCommands::new,
Expand All @@ -97,7 +98,8 @@ public enum State {
map(0x10, V1_16_2, V1_16_4),
map(0x12, V1_17, V1_18_2),
map(0x0F, V1_19, V1_19_1),
map(0x0E, V1_19_3, V1_19_3)
map(0x0E, V1_19_3, V1_19_3),
map(0x10, V1_19_4, V1_19_4)
);
clientBound.register(PacketJoinGame::new,
map(0x01, V1_7_2, V1_8),
Expand All @@ -109,7 +111,8 @@ public enum State {
map(0x26, V1_17, V1_18_2),
map(0x23, V1_19, V1_19),
map(0x25, V1_19_1, V1_19_1),
map(0x24, V1_19_3, V1_19_3)
map(0x24, V1_19_3, V1_19_3),
map(0x28, V1_19_4, V1_19_4)
);
clientBound.register(PacketPluginMessage::new,
map(0x19, V1_13, V1_13_2),
Expand All @@ -120,7 +123,8 @@ public enum State {
map(0x18, V1_17, V1_18_2),
map(0x15, V1_19, V1_19),
map(0x16, V1_19_1, V1_19_1),
map(0x15, V1_19_3, V1_19_3)
map(0x15, V1_19_3, V1_19_3),
map(0x17, V1_19_4, V1_19_4)
);
clientBound.register(PacketPlayerAbilities::new,
map(0x39, V1_7_2, V1_8),
Expand All @@ -134,7 +138,8 @@ public enum State {
map(0x32, V1_17, V1_18_2),
map(0x2F, V1_19, V1_19),
map(0x31, V1_19_1, V1_19_1),
map(0x30, V1_19_3, V1_19_3)
map(0x30, V1_19_3, V1_19_3),
map(0x34, V1_19_4, V1_19_4)
);
clientBound.register(PacketPlayerPositionAndLook::new,
map(0x08, V1_7_2, V1_8),
Expand All @@ -148,7 +153,8 @@ public enum State {
map(0x38, V1_17, V1_18_2),
map(0x36, V1_19, V1_19),
map(0x39, V1_19_1, V1_19_1),
map(0x38, V1_19_3, V1_19_3)
map(0x38, V1_19_3, V1_19_3),
map(0x3C, V1_19_4, V1_19_4)
);
clientBound.register(PacketKeepAlive::new,
map(0x00, V1_7_2, V1_8),
Expand All @@ -161,7 +167,8 @@ public enum State {
map(0x21, V1_17, V1_18_2),
map(0x1E, V1_19, V1_19),
map(0x20, V1_19_1, V1_19_1),
map(0x1F, V1_19_3, V1_19_3)
map(0x1F, V1_19_3, V1_19_3),
map(0x23, V1_19_4, V1_19_4)
);
clientBound.register(PacketChatMessage::new,
map(0x02, V1_7_2, V1_8),
Expand All @@ -172,14 +179,16 @@ public enum State {
map(0x0F, V1_17, V1_18_2),
map(0x5F, V1_19, V1_19),
map(0x62, V1_19_1, V1_19_1),
map(0x60, V1_19_3, V1_19_3)
map(0x60, V1_19_3, V1_19_3),
map(0x64, V1_19_4, V1_19_4)
);
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(0x0A, V1_19, V1_19_3)
map(0x0A, V1_19, V1_19_3),
map(0x0B, V1_19_4, V1_19_4)
);
clientBound.register(PacketPlayerInfo::new,
map(0x38, V1_7_2, V1_8),
Expand All @@ -193,7 +202,8 @@ public enum State {
map(0x36, V1_17, V1_18_2),
map(0x34, V1_19, V1_19),
map(0x37, V1_19_1, V1_19_1),
map(0x36, V1_19_3, V1_19_3)
map(0x36, V1_19_3, V1_19_3),
map(0x3A, V1_19_4, V1_19_4)
);
clientBound.register(PacketTitleLegacy::new,
map(0x45, V1_8, V1_11_1),
Expand All @@ -208,19 +218,22 @@ public enum State {
map(0x59, V1_17, V1_17_1),
map(0x5A, V1_18, V1_19),
map(0x5D, V1_19_1, V1_19_1),
map(0x5B, V1_19_3, V1_19_3)
map(0x5B, V1_19_3, V1_19_3),
map(0x5F, V1_19_4, V1_19_4)
);
clientBound.register(PacketTitleSetSubTitle::new,
map(0x57, V1_17, V1_17_1),
map(0x58, V1_18, V1_19),
map(0x5B, V1_19_1, V1_19_1),
map(0x59, V1_19_3, V1_19_3)
map(0x59, V1_19_3, V1_19_3),
map(0x5D, V1_19_4, V1_19_4)
);
clientBound.register(PacketTitleTimes::new,
map(0x5A, V1_17, V1_17_1),
map(0x5B, V1_18, V1_19),
map(0x5E, V1_19_1, V1_19_1),
map(0x5C, V1_19_3, V1_19_3)
map(0x5C, V1_19_3, V1_19_3),
map(0x60, V1_19_4, V1_19_4)
);
clientBound.register(PacketPlayerListHeader::new,
map(0x47, V1_8, V1_8),
Expand All @@ -236,10 +249,12 @@ public enum State {
map(0x5F, V1_18, V1_18_2),
map(0x60, V1_19, V1_19),
map(0x63, V1_19_1, V1_19_1),
map(0x61, V1_19_3, V1_19_3)
map(0x61, V1_19_3, V1_19_3),
map(0x65, V1_19_4, V1_19_4)
);
clientBound.register(PacketSpawnPosition::new,
map(0x4C, V1_19_3, V1_19_3)
map(0x4C, V1_19_3, V1_19_3),
map(0x50, V1_19_4, V1_19_4)
);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ public enum Version {
V1_18_2(758),
V1_19(759),
V1_19_1(760),
V1_19_3(761);
// 1.19.2 has same protocol number
V1_19_3(761),
V1_19_4(762);

private static final Map<Integer, Version> VERSION_MAP;
private static final Version MAX;
Expand Down
6 changes: 6 additions & 0 deletions api/src/main/java/ua/nanit/limbo/world/DimensionRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public final class DimensionRegistry {
private CompoundBinaryTag codec_1_18_2;
private CompoundBinaryTag codec_1_19;
private CompoundBinaryTag codec_1_19_1;
private CompoundBinaryTag codec_1_19_4;
private CompoundBinaryTag oldCodec;

public DimensionRegistry(ClassLoader classLoader) {
Expand All @@ -63,6 +64,10 @@ public CompoundBinaryTag getCodec_1_19_1() {
return codec_1_19_1;
}

public CompoundBinaryTag getCodec_1_19_4() {
return codec_1_19_4;
}

public CompoundBinaryTag getOldCodec() {
return oldCodec;
}
Expand All @@ -80,6 +85,7 @@ public void load(String def) throws IOException {
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");
// On 1.16-1.16.1 different codec format
oldCodec = readCodecFile("/dimension/codec_old.snbt");

Expand Down
Loading

0 comments on commit 226ad70

Please sign in to comment.