mirror of
https://github.com/Nan1t/NanoLimbo.git
synced 2025-07-12 12:40:14 +02:00
Revert "Optimize imports and update to java 17"
This reverts commit 3dfa56e1c53e770891ef07dd24bdcbfb8334b71e.
This commit is contained in:
parent
63ebb4e4af
commit
eea304767e
@ -2,6 +2,7 @@ package ru.nanit.limbo.configuration;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.spongepowered.configurate.ConfigurationNode;
|
||||
import org.spongepowered.configurate.serialize.SerializationException;
|
||||
import org.spongepowered.configurate.serialize.TypeSerializer;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
@ -112,7 +112,8 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
|
||||
public void handlePacket(Object packet) {
|
||||
if (packet instanceof PacketHandshake handshake) {
|
||||
if (packet instanceof PacketHandshake) {
|
||||
PacketHandshake handshake = (PacketHandshake) packet;
|
||||
clientVersion = handshake.getVersion();
|
||||
|
||||
updateStateAndVersion(handshake.getNextState(), clientVersion);
|
||||
@ -177,7 +178,8 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
|
||||
return;
|
||||
}
|
||||
|
||||
if (packet instanceof PacketLoginPluginResponse response) {
|
||||
if (packet instanceof PacketLoginPluginResponse) {
|
||||
PacketLoginPluginResponse response = (PacketLoginPluginResponse) packet;
|
||||
|
||||
if (server.getConfig().getInfoForwarding().isModern()
|
||||
&& response.getMessageId() == velocityLoginMessageId) {
|
||||
@ -319,7 +321,8 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
|
||||
String token = null;
|
||||
|
||||
for (Object obj : arr) {
|
||||
if (obj instanceof JsonObject prop) {
|
||||
if (obj instanceof JsonObject) {
|
||||
JsonObject prop = (JsonObject) obj;
|
||||
if (prop.getString("name").equals("bungeeguard-token")) {
|
||||
token = prop.getString("value");
|
||||
break;
|
||||
|
@ -35,9 +35,15 @@ public class PacketTitleLegacy implements PacketOut {
|
||||
msg.writeVarInt(action.getId(version));
|
||||
|
||||
switch (action) {
|
||||
case SET_TITLE -> title.encode(msg, version);
|
||||
case SET_SUBTITLE -> subtitle.encode(msg, version);
|
||||
case SET_TIMES_AND_DISPLAY -> times.encode(msg, version);
|
||||
case SET_TITLE:
|
||||
title.encode(msg, version);
|
||||
break;
|
||||
case SET_SUBTITLE:
|
||||
subtitle.encode(msg, version);
|
||||
break;
|
||||
case SET_TIMES_AND_DISPLAY:
|
||||
times.encode(msg, version);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public final class Logger {
|
||||
|
||||
public static void print(Level level, Object msg, Throwable t, Object... args) {
|
||||
if (debugLevel >= level.getIndex()) {
|
||||
System.out.printf("%s: %s%n", getPrefix(level), String.format(msg.toString(), args));
|
||||
System.out.println(String.format("%s: %s", getPrefix(level), String.format(msg.toString(), args)));
|
||||
if (t != null) t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -47,13 +47,19 @@ public final class DimensionRegistry {
|
||||
CompoundBinaryTag theEnd = (CompoundBinaryTag) ((CompoundBinaryTag) dimensions.get(3)).get("element");
|
||||
|
||||
switch (def.toLowerCase()) {
|
||||
case "overworld" -> defaultDimension = new Dimension(0, "minecraft:overworld", overWorld);
|
||||
case "nether" -> defaultDimension = new Dimension(-1, "minecraft:nether", nether);
|
||||
case "the_end" -> defaultDimension = new Dimension(1, "minecraft:the_end", theEnd);
|
||||
default -> {
|
||||
case "overworld":
|
||||
defaultDimension = new Dimension(0, "minecraft:overworld", overWorld);
|
||||
break;
|
||||
case "nether":
|
||||
defaultDimension = new Dimension(-1, "minecraft:nether", nether);
|
||||
break;
|
||||
case "the_end":
|
||||
defaultDimension = new Dimension(1, "minecraft:the_end", theEnd);
|
||||
break;
|
||||
default:
|
||||
defaultDimension = new Dimension(1, "minecraft:the_end", theEnd);
|
||||
Logger.warning("Undefined dimension type: '%s'. Using THE_END as default", def);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user