From 05a88f7693993faec1b8a4b428a0194a881dbab4 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sat, 8 Apr 2023 16:19:42 -0400 Subject: [PATCH] Fix compiling probably --- .../registry/populator/CustomItemRegistryPopulator.java | 1 - .../main/java/org/geysermc/geyser/scoreboard/Scoreboard.java | 2 +- .../main/java/org/geysermc/geyser/session/GeyserSession.java | 4 +--- .../translator/protocol/java/JavaCommandsTranslator.java | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/CustomItemRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/CustomItemRegistryPopulator.java index 8a6c927fd..345a5b0d9 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/CustomItemRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/CustomItemRegistryPopulator.java @@ -134,7 +134,6 @@ public class CustomItemRegistryPopulator { .stackSize(customItemData.stackSize()) .maxDamage(customItemData.maxDamage()); Item item = new Item(customIdentifier, itemBuilder) { - // TODO ? @Override public boolean isValidRepairItem(Item other) { return repairMaterials != null && repairMaterials.contains(other.javaIdentifier()); diff --git a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java index 252fed0f4..5a70fddf5 100644 --- a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java +++ b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java @@ -368,7 +368,7 @@ public final class Scoreboard { } @Contract("-> new") - public LinkedHashMap> getTeamNames() { + public Map> getTeamNames() { return teams.keySet().stream() .collect(Collectors.toMap(Function.identity(), o -> EnumSet.noneOf(CommandEnumConstraint.class), (o1, o2) -> o1, LinkedHashMap::new)); diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index 786accb6f..a4b5358d3 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -84,7 +84,6 @@ import org.cloudburstmc.math.vector.*; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.protocol.bedrock.BedrockServerSession; import org.cloudburstmc.protocol.bedrock.data.*; -import org.cloudburstmc.protocol.bedrock.data.command.CommandEnumConstraint; import org.cloudburstmc.protocol.bedrock.data.command.CommandEnumData; import org.cloudburstmc.protocol.bedrock.data.command.CommandPermission; import org.cloudburstmc.protocol.bedrock.data.command.SoftEnumUpdateType; @@ -1932,8 +1931,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource { private void softEnumPacket(String name, SoftEnumUpdateType type, String enums) { UpdateSoftEnumPacket packet = new UpdateSoftEnumPacket(); packet.setType(type); - // TODO - packet.setSoftEnum(new CommandEnumData(name, new LinkedHashMap<>(Collections.singletonMap(enums, EnumSet.noneOf(CommandEnumConstraint.class))), true)); + packet.setSoftEnum(new CommandEnumData(name, Collections.singletonMap(enums, Collections.emptySet()), true)); sendUpstreamPacket(packet); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java index e5dc9c579..8b46b4350 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java @@ -390,7 +390,7 @@ public class JavaCommandsTranslator extends PacketTranslator> values = (LinkedHashMap>) enumParamInfo.getParamData().getEnumData().getValues().clone(); + Map> values = new LinkedHashMap<>(enumParamInfo.getParamData().getEnumData().getValues()); values.put(paramNode.getName(), Set.of()); // Re-create the command using the updated values