From 1a194dbce8f4a480d0db22318b3de237aab5b848 Mon Sep 17 00:00:00 2001 From: EOT3000 <43685885+EOT3000@users.noreply.github.com> Date: Wed, 15 Apr 2020 10:25:40 -0400 Subject: [PATCH] Remove unnecessary code/debugs --- .../src/main/java/org/geysermc/connector/GeyserConnector.java | 2 -- .../org/geysermc/connector/network/UpstreamPacketHandler.java | 3 +-- .../main/java/org/geysermc/connector/utils/ResourcePack.java | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java index a620acd88..b839c1af7 100644 --- a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -63,8 +63,6 @@ public class GeyserConnector { public static final String NAME = "Geyser"; public static final String VERSION = "1.0-SNAPSHOT"; - //Change this on every game version - public static final String GAME_VERSION = "1.14.0"; private final Map players = new HashMap<>(); diff --git a/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java b/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java index d02112bea..56f6f8e1a 100644 --- a/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java +++ b/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java @@ -74,7 +74,6 @@ public class UpstreamPacketHandler extends LoggingPacketHandler { @Override public boolean handle(ResourcePackClientResponsePacket packet) { - System.out.println(packet.getStatus()); switch (packet.getStatus()) { case COMPLETED: session.connect(connector.getRemoteServer()); @@ -102,7 +101,7 @@ public class UpstreamPacketHandler extends LoggingPacketHandler { stackPacket.setExperimental(false); stackPacket.setForcedToAccept(true); - stackPacket.setGameVersion(GeyserConnector.GAME_VERSION); + stackPacket.setGameVersion(GeyserConnector.BEDROCK_PACKET_CODEC.getMinecraftVersion()); for(ResourcePack pack : ResourcePack.PACKS.values()) { ResourcePackManifest.Header header = pack.getManifest().getHeader(); String version = header.getVersion()[0] + "." + header.getVersion()[1] + "." + header.getVersion()[2]; diff --git a/connector/src/main/java/org/geysermc/connector/utils/ResourcePack.java b/connector/src/main/java/org/geysermc/connector/utils/ResourcePack.java index 746975260..34a7cad4f 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/ResourcePack.java +++ b/connector/src/main/java/org/geysermc/connector/utils/ResourcePack.java @@ -77,6 +77,7 @@ public class ResourcePack { bytes.writeBytes(Files.readAllBytes(file.toPath())); hash.update(bytes); sha256 = hash.digest(); + hashed = true; } catch (Exception e) { throw new RuntimeException("Could not calculate pack hash", e); } finally {