Removed unused code

This commit is contained in:
Nanit 2021-10-28 21:13:10 +03:00
parent 511ce43ada
commit ff5b605ee3
2 changed files with 8 additions and 22 deletions

View File

@ -234,10 +234,6 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
if (isConnected()) channel.write(packet, channel.voidPromise());
}
public void flushPackets() {
if (isConnected()) channel.flush();
}
public boolean isConnected() {
return channel.isActive();
}

View File

@ -6,6 +6,7 @@ import net.kyori.adventure.nbt.ListBinaryTag;
import ru.nanit.limbo.server.LimboServer;
import ru.nanit.limbo.util.Logger;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@ -14,9 +15,6 @@ public final class DimensionRegistry {
private CompoundBinaryTag defaultDimension;
private CompoundBinaryTag codec;
private CompoundBinaryTag overWorld;
private CompoundBinaryTag theEnd;
private CompoundBinaryTag nether;
public CompoundBinaryTag getCodec() {
return codec;
@ -26,26 +24,18 @@ public final class DimensionRegistry {
return defaultDimension;
}
public CompoundBinaryTag getOverWorld() {
return overWorld;
}
public CompoundBinaryTag getTheEnd() {
return theEnd;
}
public CompoundBinaryTag getNether() {
return nether;
}
public void load(LimboServer server, String def) throws IOException {
InputStream in = server.getClass().getResourceAsStream("/dimension_registry.nbt");
if(in == null)
throw new FileNotFoundException("Cannot find dimension registry file");
codec = BinaryTagIO.readCompressedInputStream(in);
ListBinaryTag dimensions = codec.getCompound("minecraft:dimension_type").getList("value");
overWorld = (CompoundBinaryTag) ((CompoundBinaryTag) dimensions.get(0)).get("element");
nether = (CompoundBinaryTag) ((CompoundBinaryTag) dimensions.get(2)).get("element");
theEnd = (CompoundBinaryTag) ((CompoundBinaryTag) dimensions.get(3)).get("element");
CompoundBinaryTag overWorld = (CompoundBinaryTag) ((CompoundBinaryTag) dimensions.get(0)).get("element");
CompoundBinaryTag nether = (CompoundBinaryTag) ((CompoundBinaryTag) dimensions.get(2)).get("element");
CompoundBinaryTag theEnd = (CompoundBinaryTag) ((CompoundBinaryTag) dimensions.get(3)).get("element");
switch (def.toLowerCase()) {
case "overworld":