diff --git a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java index 45fbca0d..0007497c 100644 --- a/connector/src/main/java/org/geysermc/connector/GeyserConnector.java +++ b/connector/src/main/java/org/geysermc/connector/GeyserConnector.java @@ -54,11 +54,7 @@ import org.geysermc.connector.utils.Toolbox; import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; -import java.util.UUID; +import java.util.*; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -158,7 +154,7 @@ public class GeyserConnector implements Connector { } public Collection getConnectedPlayers() { - return players.values(); + return new ArrayList<>(players.values()); } public void shutdown() { @@ -185,7 +181,7 @@ public class GeyserConnector implements Connector { } private static void addMetrics(Metrics m) { - m.addCustomChart(new Metrics.SingleLineChart("servers", () -> 3 + new Random().nextInt(4))); - m.addCustomChart(new Metrics.SingleLineChart("players", () -> 5 + new Random().nextInt(7))); + m.addCustomChart(new Metrics.SingleLineChart("servers", () -> 1)); + m.addCustomChart(new Metrics.SingleLineChart("players", Geyser::getPlayerCount)); } } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaJoinGameTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaJoinGameTranslator.java index 29c4b4b2..2a6ef2fc 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaJoinGameTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaJoinGameTranslator.java @@ -51,8 +51,8 @@ public class JavaJoinGameTranslator extends PacketTranslator> 4; int chunkZ = pos.getFloorZ() >> 4; - for (int x = -3; x < 3; x++) { - for (int z = -3; z < 3; z++) { + for (int x = -1; x < 1; x++) { + for (int z = -1; z < 1; z++) { LevelChunkPacket data = new LevelChunkPacket(); data.setChunkX(chunkX + x); data.setChunkZ(chunkZ + z); diff --git a/connector/src/main/java/org/geysermc/connector/utils/RemapUtils.java b/connector/src/main/java/org/geysermc/connector/utils/RemapUtils.java index 34f155f1..57b348ea 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/RemapUtils.java +++ b/connector/src/main/java/org/geysermc/connector/utils/RemapUtils.java @@ -21,7 +21,7 @@ class RemapUtils { .equalsIgnoreCase(x.getIdentifier()) && x.getData() == 0) { for (DyeColor dyeColor : DyeColor.values()) { - JavaItem j = new JavaItem(y.getIdentifier().replaceAll("white", dyeColor.getName()), y.getId()); + JavaItem j = new JavaItem(y.getIdentifier().replaceAll("white", dyeColor.getName()), y.getId() + dyeColor.getId()); Remapper.convertions.computeIfAbsent(j, (q) -> new ArrayList<>()); Remapper.convertions.get(j).add(new BedrockItem(x.getIdentifier(), x.getId(), dyeColor.getId())); } @@ -62,7 +62,7 @@ class RemapUtils { .equalsIgnoreCase(x.getIdentifier()) && x.getData() == 0) { for (WoodType woodType : WoodType.values()) { - JavaItem j = new JavaItem(y.getIdentifier().replaceAll("oak", woodType.getName()), y.getId()); + JavaItem j = new JavaItem(y.getIdentifier().replaceAll("oak", woodType.getName()), y.getId() + woodType.getId()); Remapper.convertions.computeIfAbsent(j, (q) -> new ArrayList<>()); Remapper.convertions.get(j).add(new BedrockItem(x.getIdentifier(), x.getId(), woodType.getId())); } @@ -80,6 +80,7 @@ class RemapUtils { } private static boolean customWoodIfNeeded(JavaItem j) { + if(j.getIdentifier().contains("fence_gate")) return true; for(WoodType t : WoodType.values()) { if (j.getIdentifier().equalsIgnoreCase(MINECRAFT + "stripped_" + t.getName() +"_wood")) { Remapper.convertions.put(j, Arrays.asList(new BedrockItem(MINECRAFT + "wood", 467, t.getId() + 8)));