From 0ca77233edfd85aff29dad28cea9001acdbc007a Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Thu, 10 Feb 2022 20:15:46 -0500 Subject: [PATCH] oh no my extensive debugging setup --- .../java/JavaUpdateTagsTranslator.java | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateTagsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateTagsTranslator.java index 9f1c24fd8..a899077f8 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateTagsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaUpdateTagsTranslator.java @@ -30,45 +30,11 @@ import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - @Translator(packet = ClientboundUpdateTagsPacket.class) public class JavaUpdateTagsTranslator extends PacketTranslator { - private final Map> previous = new HashMap<>(); @Override public void translate(GeyserSession session, ClientboundUpdateTagsPacket packet) { - for (Map.Entry> entry : packet.getTags().entrySet().stream().sorted(Map.Entry.comparingByKey()).toList()) { - StringBuilder builder = new StringBuilder(); - builder.append(entry.getKey()).append("={"); - for (Map.Entry tag : entry.getValue().entrySet().stream().sorted(Map.Entry.comparingByKey()).toList()) { - builder.append(tag.getKey()).append('=').append(Arrays.toString(tag.getValue())).append(", "); - } - System.out.println(builder.append("}").toString()); - } - - if (previous.isEmpty()) { - previous.putAll(packet.getTags()); - } else { - for (Map.Entry> entry : packet.getTags().entrySet()) { - Map oldTags = previous.get(entry.getKey()); - for (Map.Entry newTag : entry.getValue().entrySet()) { - int[] oldValue = oldTags.get(newTag.getKey()); - if (oldValue == null) { - System.out.println("Tag " + newTag.getKey() + " not found!!"); - continue; - } - if (!Arrays.equals(Arrays.stream(oldValue).sorted().toArray(), Arrays.stream(newTag.getValue()).sorted().toArray())) { - System.out.println(entry.getKey() + ": " + newTag.getKey() + " has different values! " + Arrays.toString(Arrays.stream(oldValue).sorted().toArray()) + " " + Arrays.toString(Arrays.stream(newTag.getValue()).sorted().toArray())); - } - } - } - } - session.getTagCache().loadPacket(session, packet); - - } }