From fbe4b47f38e1c4a97c2890726ae4b8a52516fa4c Mon Sep 17 00:00:00 2001 From: Tim203 Date: Fri, 25 Oct 2024 11:13:09 +0200 Subject: [PATCH] Address review --- .../geyser/entity/type/living/ArmorStandEntity.java | 5 +++-- .../entity/player/JavaPlayerInfoUpdateTranslator.java | 9 +++++---- .../geyser/scoreboard/network/ScoreboardIssueTests.java | 9 +++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java index 6aa743c6c5..e1c82345fa 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/ArmorStandEntity.java @@ -25,8 +25,6 @@ package org.geysermc.geyser.entity.type.living; -import java.util.Optional; -import java.util.UUID; import lombok.Getter; import net.kyori.adventure.text.Component; import org.checkerframework.checker.nullness.qual.Nullable; @@ -49,6 +47,9 @@ import org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand; import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack; +import java.util.Optional; +import java.util.UUID; + public class ArmorStandEntity extends LivingEntity { // These are used to store the state of the armour stand for use when handling invisibility diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerInfoUpdateTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerInfoUpdateTranslator.java index 9e269296cc..d950d9d0e0 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerInfoUpdateTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/player/JavaPlayerInfoUpdateTranslator.java @@ -25,10 +25,6 @@ package org.geysermc.geyser.translator.protocol.java.entity.player; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.UUID; import org.checkerframework.checker.nullness.qual.Nullable; import org.cloudburstmc.math.vector.Vector3f; import org.cloudburstmc.protocol.bedrock.packet.PlayerListPacket; @@ -43,6 +39,11 @@ import org.geysermc.mcprotocollib.protocol.data.game.PlayerListEntryAction; import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundPlayerInfoUpdatePacket; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + @Translator(packet = ClientboundPlayerInfoUpdatePacket.class) public class JavaPlayerInfoUpdateTranslator extends PacketTranslator { @Override diff --git a/core/src/test/java/org/geysermc/geyser/scoreboard/network/ScoreboardIssueTests.java b/core/src/test/java/org/geysermc/geyser/scoreboard/network/ScoreboardIssueTests.java index 9fcd3978e0..17ad7f3d3f 100644 --- a/core/src/test/java/org/geysermc/geyser/scoreboard/network/ScoreboardIssueTests.java +++ b/core/src/test/java/org/geysermc/geyser/scoreboard/network/ScoreboardIssueTests.java @@ -33,9 +33,6 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; -import java.util.EnumSet; -import java.util.Optional; -import java.util.UUID; import net.kyori.adventure.text.Component; import org.cloudburstmc.protocol.bedrock.data.entity.EntityDataTypes; import org.cloudburstmc.protocol.bedrock.packet.AddEntityPacket; @@ -74,6 +71,10 @@ import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.scoreboard.ClientboundSetPlayerTeamPacket; import org.junit.jupiter.api.Test; +import java.util.EnumSet; +import java.util.Optional; +import java.util.UUID; + /** * Tests for issues reported on GitHub. */ @@ -213,7 +214,7 @@ void nameNotUpdating() { assertEquals("minecraft:armor_stand", packet.getIdentifier()); }); - // invisible, custom name, custom name visible + // metadata set: invisible, custom name, custom name visible context.translate(setEntityDataTranslator, new ClientboundSetEntityDataPacket(1298, new EntityMetadata[]{ new ByteEntityMetadata(0, MetadataType.BYTE, (byte) 0x20), new ObjectEntityMetadata<>(2, MetadataType.OPTIONAL_CHAT, Optional.of(Component.text("tesss"))),