From 7a85663ded132ba3376f75676906040f396c845e Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Mon, 9 Dec 2024 21:17:17 +0100 Subject: [PATCH] Update to 1.21.4 (#3319) --- build.gradle.kts | 2 +- .../com/comphenix/protocol/PacketType.java | 54 +++++++++-------- .../protocol/utility/MinecraftVersion.java | 7 ++- .../protocol/wrappers/EnumWrappers.java | 1 + .../protocol/wrappers/PlayerInfoData.java | 59 ++++++++++++++++++- .../protocol/BukkitInitialization.java | 24 ++++---- .../injector/EntityUtilitiesTest.java | 4 +- .../utility/MinecraftReflectionTest.java | 2 +- .../utility/MinecraftReflectionTestUtil.java | 4 +- .../utility/MinecraftVersionTest.java | 2 +- .../wrappers/WrappedBlockDataTest.java | 6 +- .../wrappers/WrappedComponentStyleTest.java | 2 +- .../wrappers/WrappedDataWatcherTest.java | 2 +- .../wrappers/WrappedStreamCodecTests.java | 4 +- 14 files changed, 117 insertions(+), 56 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a5f25b46..7e14ec8c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,7 +13,7 @@ group = "com.comphenix.protocol" version = "5.4.0-SNAPSHOT" description = "Provides access to the Minecraft protocol" -val mcVersion = "1.21.3" +val mcVersion = "1.21.4" val isSnapshot = version.toString().endsWith("-SNAPSHOT") val buildNumber = System.getenv("BUILD_NUMBER") ?: "" val isJenkins = buildNumber.isNotEmpty() diff --git a/src/main/java/com/comphenix/protocol/PacketType.java b/src/main/java/com/comphenix/protocol/PacketType.java index 0ba3bba4..9972fe23 100644 --- a/src/main/java/com/comphenix/protocol/PacketType.java +++ b/src/main/java/com/comphenix/protocol/PacketType.java @@ -462,32 +462,34 @@ public static class Client extends PacketTypeEnum { public static final PacketType GROUND = new PacketType(PROTOCOL, SENDER, 0x1F, "net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$StatusOnly", "Flying$d"); public static final PacketType VEHICLE_MOVE = new PacketType(PROTOCOL, SENDER, 0x20, "MoveVehicle", "VehicleMove", "CPacketVehicleMove"); public static final PacketType BOAT_MOVE = new PacketType(PROTOCOL, SENDER, 0x21, "PaddleBoat", "BoatMove", "CPacketSteerBoat"); - public static final PacketType PICK_ITEM = new PacketType(PROTOCOL, SENDER, 0x22, "PickItem"); - public static final PacketType PING_REQUEST = new PacketType(PROTOCOL, SENDER, 0x23, "PingRequest"); - public static final PacketType AUTO_RECIPE = new PacketType(PROTOCOL, SENDER, 0x24, "PlaceRecipe", "AutoRecipe", "CPacketPlaceRecipe"); - public static final PacketType ABILITIES = new PacketType(PROTOCOL, SENDER, 0x25, "PlayerAbilities", "Abilities", "CPacketPlayerAbilities"); - public static final PacketType BLOCK_DIG = new PacketType(PROTOCOL, SENDER, 0x26, "PlayerAction", "BlockDig", "CPacketPlayerDigging"); - public static final PacketType ENTITY_ACTION = new PacketType(PROTOCOL, SENDER, 0x27, "PlayerCommand", "EntityAction", "CPacketEntityAction"); - public static final PacketType STEER_VEHICLE = new PacketType(PROTOCOL, SENDER, 0x28, "PlayerInput", "SteerVehicle", "CPacketInput"); - public static final PacketType PONG = new PacketType(PROTOCOL, SENDER, 0x29, "Pong"); - public static final PacketType RECIPE_SETTINGS = new PacketType(PROTOCOL, SENDER, 0x2A, "RecipeBookChangeSettings", "RecipeSettings"); - public static final PacketType RECIPE_DISPLAYED = new PacketType(PROTOCOL, SENDER, 0x2B, "RecipeBookSeenRecipe", "RecipeDisplayed", "CPacketRecipeInfo"); - public static final PacketType ITEM_NAME = new PacketType(PROTOCOL, SENDER, 0x2C, "RenameItem", "ItemName"); - public static final PacketType RESOURCE_PACK_STATUS = new PacketType(PROTOCOL, SENDER, 0x2D, "ResourcePack", "ResourcePackStatus", "CPacketResourcePackStatus"); - public static final PacketType ADVANCEMENTS = new PacketType(PROTOCOL, SENDER, 0x2E, "SeenAdvancements", "Advancements", "CPacketSeenAdvancements"); - public static final PacketType TR_SEL = new PacketType(PROTOCOL, SENDER, 0x2F, "SelectTrade", "TrSel"); - public static final PacketType BEACON = new PacketType(PROTOCOL, SENDER, 0x30, "SetBeacon", "Beacon"); - public static final PacketType HELD_ITEM_SLOT = new PacketType(PROTOCOL, SENDER, 0x31, "SetCarriedItem", "HeldItemSlot", "CPacketHeldItemChange"); - public static final PacketType SET_COMMAND_BLOCK = new PacketType(PROTOCOL, SENDER, 0x32, "SetCommandBlock"); - public static final PacketType SET_COMMAND_MINECART = new PacketType(PROTOCOL, SENDER, 0x33, "SetCommandMinecart"); - public static final PacketType SET_CREATIVE_SLOT = new PacketType(PROTOCOL, SENDER, 0x34, "SetCreativeModeSlot", "SetCreativeSlot", "CPacketCreativeInventoryAction"); - public static final PacketType SET_JIGSAW = new PacketType(PROTOCOL, SENDER, 0x35, "SetJigsawBlock", "SetJigsaw"); - public static final PacketType STRUCT = new PacketType(PROTOCOL, SENDER, 0x36, "SetStructureBlock", "Struct"); - public static final PacketType UPDATE_SIGN = new PacketType(PROTOCOL, SENDER, 0x37, "SignUpdate", "UpdateSign", "CPacketUpdateSign"); - public static final PacketType ARM_ANIMATION = new PacketType(PROTOCOL, SENDER, 0x38, "Swing", "ArmAnimation", "CPacketAnimation"); - public static final PacketType SPECTATE = new PacketType(PROTOCOL, SENDER, 0x39, "TeleportToEntity", "Spectate", "CPacketSpectate"); - public static final PacketType USE_ITEM_ON = new PacketType(PROTOCOL, SENDER, 0x3B, "UseItemOn", "BlockPlace", "CPacketPlayerTryUseItemOnBlock"); - public static final PacketType USE_ITEM = new PacketType(PROTOCOL, SENDER, 0x3A, "UseItem", "CPacketPlayerTryUseItem"); + public static final PacketType PICK_ITEM_FROM_BLOCK = new PacketType(PROTOCOL, SENDER, 0x22, "PickItemFromBlock"); + public static final PacketType PICK_ITEM = new PacketType(PROTOCOL, SENDER, 0x23, "PickItemFromEntity", "PickItem"); + public static final PacketType PING_REQUEST = new PacketType(PROTOCOL, SENDER, 0x24, "PingRequest"); + public static final PacketType AUTO_RECIPE = new PacketType(PROTOCOL, SENDER, 0x25, "PlaceRecipe", "AutoRecipe", "CPacketPlaceRecipe"); + public static final PacketType ABILITIES = new PacketType(PROTOCOL, SENDER, 0x26, "PlayerAbilities", "Abilities", "CPacketPlayerAbilities"); + public static final PacketType BLOCK_DIG = new PacketType(PROTOCOL, SENDER, 0x27, "PlayerAction", "BlockDig", "CPacketPlayerDigging"); + public static final PacketType ENTITY_ACTION = new PacketType(PROTOCOL, SENDER, 0x28, "PlayerCommand", "EntityAction", "CPacketEntityAction"); + public static final PacketType STEER_VEHICLE = new PacketType(PROTOCOL, SENDER, 0x29, "PlayerInput", "SteerVehicle", "CPacketInput"); + public static final PacketType PLAYER_LOADED = new PacketType(PROTOCOL, SENDER, 0x2A, "PlayerLoaded"); + public static final PacketType PONG = new PacketType(PROTOCOL, SENDER, 0x2B, "Pong"); + public static final PacketType RECIPE_SETTINGS = new PacketType(PROTOCOL, SENDER, 0x2C, "RecipeBookChangeSettings", "RecipeSettings"); + public static final PacketType RECIPE_DISPLAYED = new PacketType(PROTOCOL, SENDER, 0x2D, "RecipeBookSeenRecipe", "RecipeDisplayed", "CPacketRecipeInfo"); + public static final PacketType ITEM_NAME = new PacketType(PROTOCOL, SENDER, 0x2E, "RenameItem", "ItemName"); + public static final PacketType RESOURCE_PACK_STATUS = new PacketType(PROTOCOL, SENDER, 0x2F, "ResourcePack", "ResourcePackStatus", "CPacketResourcePackStatus"); + public static final PacketType ADVANCEMENTS = new PacketType(PROTOCOL, SENDER, 0x30, "SeenAdvancements", "Advancements", "CPacketSeenAdvancements"); + public static final PacketType TR_SEL = new PacketType(PROTOCOL, SENDER, 0x31, "SelectTrade", "TrSel"); + public static final PacketType BEACON = new PacketType(PROTOCOL, SENDER, 0x32, "SetBeacon", "Beacon"); + public static final PacketType HELD_ITEM_SLOT = new PacketType(PROTOCOL, SENDER, 0x33, "SetCarriedItem", "HeldItemSlot", "CPacketHeldItemChange"); + public static final PacketType SET_COMMAND_BLOCK = new PacketType(PROTOCOL, SENDER, 0x34, "SetCommandBlock"); + public static final PacketType SET_COMMAND_MINECART = new PacketType(PROTOCOL, SENDER, 0x35, "SetCommandMinecart"); + public static final PacketType SET_CREATIVE_SLOT = new PacketType(PROTOCOL, SENDER, 0x36, "SetCreativeModeSlot", "SetCreativeSlot", "CPacketCreativeInventoryAction"); + public static final PacketType SET_JIGSAW = new PacketType(PROTOCOL, SENDER, 0x37, "SetJigsawBlock", "SetJigsaw"); + public static final PacketType STRUCT = new PacketType(PROTOCOL, SENDER, 0x38, "SetStructureBlock", "Struct"); + public static final PacketType UPDATE_SIGN = new PacketType(PROTOCOL, SENDER, 0x39, "SignUpdate", "UpdateSign", "CPacketUpdateSign"); + public static final PacketType ARM_ANIMATION = new PacketType(PROTOCOL, SENDER, 0x3A, "Swing", "ArmAnimation", "CPacketAnimation"); + public static final PacketType SPECTATE = new PacketType(PROTOCOL, SENDER, 0x3B, "TeleportToEntity", "Spectate", "CPacketSpectate"); + public static final PacketType USE_ITEM_ON = new PacketType(PROTOCOL, SENDER, 0x3D, "UseItemOn", "BlockPlace", "CPacketPlayerTryUseItemOnBlock"); + public static final PacketType USE_ITEM = new PacketType(PROTOCOL, SENDER, 0x3C, "UseItem", "CPacketPlayerTryUseItem"); /** * @deprecated Removed in 1.17 diff --git a/src/main/java/com/comphenix/protocol/utility/MinecraftVersion.java b/src/main/java/com/comphenix/protocol/utility/MinecraftVersion.java index 58c9516f..7564a0f5 100644 --- a/src/main/java/com/comphenix/protocol/utility/MinecraftVersion.java +++ b/src/main/java/com/comphenix/protocol/utility/MinecraftVersion.java @@ -36,6 +36,11 @@ * @author Kristian */ public final class MinecraftVersion implements Comparable, Serializable { + /** + * Version 1.21.4 - the garden awakens drop + */ + public static final MinecraftVersion v1_21_4 = new MinecraftVersion("1.21.4"); + /** * Version 1.21.2 - the bundles of bravery drop */ @@ -154,7 +159,7 @@ public final class MinecraftVersion implements Comparable, Ser /** * The latest release version of minecraft. */ - public static final MinecraftVersion LATEST = v1_21_2; + public static final MinecraftVersion LATEST = v1_21_4; // used when serializing private static final long serialVersionUID = -8695133558996459770L; diff --git a/src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java b/src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java index 8096dac5..1a1fe705 100644 --- a/src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java +++ b/src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java @@ -141,6 +141,7 @@ public enum PlayerInfoAction { UPDATE_LATENCY, UPDATE_DISPLAY_NAME, UPDATE_LIST_ORDER, + UPDATE_HAT, /** * @deprecated Removed in 1.19.3 */ diff --git a/src/main/java/com/comphenix/protocol/wrappers/PlayerInfoData.java b/src/main/java/com/comphenix/protocol/wrappers/PlayerInfoData.java index d0ed0991..91dea742 100644 --- a/src/main/java/com/comphenix/protocol/wrappers/PlayerInfoData.java +++ b/src/main/java/com/comphenix/protocol/wrappers/PlayerInfoData.java @@ -42,6 +42,7 @@ public class PlayerInfoData { private final int latency; private final int listOrder = 0; private final boolean listed; + private final boolean showHat; private final NativeGameMode gameMode; private final WrappedGameProfile profile; private final WrappedChatComponent displayName; @@ -74,6 +75,21 @@ public PlayerInfoData(UUID profileId, int latency, boolean listed, NativeGameMod this(profileId, latency, listed, gameMode, profile, displayName, (WrappedRemoteChatSessionData) null); } + /** + * Constructs a new PlayerInfoData for Minecraft 1.19.3 or later. + * + * @param profileId the id of the profile (has to be non-null) + * @param latency the latency in milliseconds + * @param listed whether the player is listed in the tab list + * @param gameMode the game mode + * @param profile the game profile + * @param displayName display name in tab list (optional) + * @param remoteChatSession the remote chat session for this profile or null + */ + public PlayerInfoData(UUID profileId, int latency, boolean listed, NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, @Nullable WrappedRemoteChatSessionData remoteChatSession) { + this(profileId, latency, listed, gameMode, profile, displayName, false, remoteChatSession); + } + /** * Constructs a new PlayerInfoData for Minecraft 1.19. This is incompatible on 1.19.3. * @see PlayerInfoData#PlayerInfoData(UUID, int, boolean, NativeGameMode, WrappedGameProfile, WrappedChatComponent, WrappedRemoteChatSessionData) @@ -96,10 +112,11 @@ public PlayerInfoData(UUID profileId, int latency, boolean listed, NativeGameMod this.displayName = displayName; this.profileKeyData = profileKeyData; this.remoteChatSessionData = null; + this.showHat = false; } /** - * Constructs a new PlayerInfoData for Minecraft 1.19.3 or later. + * Constructs a new PlayerInfoData for Minecraft 1.21.4 or later. * * @param profileId the id of the profile (has to be non-null) * @param latency the latency in milliseconds @@ -107,9 +124,10 @@ public PlayerInfoData(UUID profileId, int latency, boolean listed, NativeGameMod * @param gameMode the game mode * @param profile the game profile * @param displayName display name in tab list (optional) + * @param showHat whether a hat should be shown * @param remoteChatSession the remote chat session for this profile or null */ - public PlayerInfoData(UUID profileId, int latency, boolean listed, NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, @Nullable WrappedRemoteChatSessionData remoteChatSession) { + public PlayerInfoData(UUID profileId, int latency, boolean listed, NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, boolean showHat, @Nullable WrappedRemoteChatSessionData remoteChatSession) { this.profileId = profileId; this.latency = latency; this.listed = listed; @@ -118,6 +136,7 @@ public PlayerInfoData(UUID profileId, int latency, boolean listed, NativeGameMod this.displayName = displayName; this.profileKeyData = null; this.remoteChatSessionData = remoteChatSession; + this.showHat = showHat; } /** @@ -179,6 +198,14 @@ public WrappedChatComponent getDisplayName() { return displayName; } + /** + * Gets if a hat is shown (since 1.21.4) + * @return if the hat is shown + */ + public boolean isShowHat() { + return showHat; + } + /** * Returns the public key of the profile (since 1.19). Returns the public key of the remote chat session since 1.19.3 * @return The public key of the profile. @@ -227,6 +254,9 @@ public Object getGeneric(PlayerInfoData specific) { args.add(EnumWrappers.getGameModeClass()); args.add(MinecraftReflection.getIChatBaseComponentClass()); + if (MinecraftVersion.v1_21_4.atOrAbove()) { + args.add(boolean.class); + } if (MinecraftVersion.v1_21_2.atOrAbove()) { args.add(int.class); } @@ -253,7 +283,19 @@ public Object getGeneric(PlayerInfoData specific) { Object[] args; - if (MinecraftVersion.v1_21_2.atOrAbove()) { + if (MinecraftVersion.v1_21_4.atOrAbove()) { + args = new Object[] { + specific.profileId, + profile, + specific.listed, + specific.latency, + gameMode, + displayName, + specific.showHat, + specific.listOrder, + remoteChatSessionData + }; + } else if (MinecraftVersion.v1_21_2.atOrAbove()) { args = new Object[] { specific.profileId, profile, @@ -326,6 +368,17 @@ public PlayerInfoData getSpecific(Object generic) { MinecraftReflection.getIChatBaseComponentClass(), BukkitConverters.getWrappedChatComponentConverter()); WrappedChatComponent displayName = displayNames.read(0); + if (MinecraftVersion.v1_21_4.atOrAbove()) { + return new PlayerInfoData(modifier.withType(UUID.class).read(0), + latency, + modifier.withType(boolean.class).read(0), + gameMode, + gameProfile, + displayName, + modifier.withType(boolean.class).read(1), + modifier.withType(MinecraftReflection.getRemoteChatSessionDataClass(), BukkitConverters.getWrappedRemoteChatSessionDataConverter()).read(0) + ); + } if (MinecraftVersion.FEATURE_PREVIEW_UPDATE.atOrAbove()) { return new PlayerInfoData(modifier.withType(UUID.class).read(0), latency, diff --git a/src/test/java/com/comphenix/protocol/BukkitInitialization.java b/src/test/java/com/comphenix/protocol/BukkitInitialization.java index 6e82d74a..4d4c0539 100644 --- a/src/test/java/com/comphenix/protocol/BukkitInitialization.java +++ b/src/test/java/com/comphenix/protocol/BukkitInitialization.java @@ -46,18 +46,18 @@ import org.bukkit.NamespacedKey; import org.bukkit.Registry; import org.bukkit.World; -import org.bukkit.craftbukkit.v1_21_R2.CraftLootTable; -import org.bukkit.craftbukkit.v1_21_R2.CraftRegistry; -import org.bukkit.craftbukkit.v1_21_R2.CraftServer; -import org.bukkit.craftbukkit.v1_21_R2.CraftWorld; -import org.bukkit.craftbukkit.v1_21_R2.inventory.CraftItemFactory; -import org.bukkit.craftbukkit.v1_21_R2.tag.CraftBlockTag; -import org.bukkit.craftbukkit.v1_21_R2.tag.CraftEntityTag; -import org.bukkit.craftbukkit.v1_21_R2.tag.CraftFluidTag; -import org.bukkit.craftbukkit.v1_21_R2.tag.CraftItemTag; -import org.bukkit.craftbukkit.v1_21_R2.util.CraftMagicNumbers; -import org.bukkit.craftbukkit.v1_21_R2.util.CraftNamespacedKey; -import org.bukkit.craftbukkit.v1_21_R2.util.Versioning; +import org.bukkit.craftbukkit.v1_21_R3.CraftLootTable; +import org.bukkit.craftbukkit.v1_21_R3.CraftRegistry; +import org.bukkit.craftbukkit.v1_21_R3.CraftServer; +import org.bukkit.craftbukkit.v1_21_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftItemFactory; +import org.bukkit.craftbukkit.v1_21_R3.tag.CraftBlockTag; +import org.bukkit.craftbukkit.v1_21_R3.tag.CraftEntityTag; +import org.bukkit.craftbukkit.v1_21_R3.tag.CraftFluidTag; +import org.bukkit.craftbukkit.v1_21_R3.tag.CraftItemTag; +import org.bukkit.craftbukkit.v1_21_R3.util.CraftMagicNumbers; +import org.bukkit.craftbukkit.v1_21_R3.util.CraftNamespacedKey; +import org.bukkit.craftbukkit.v1_21_R3.util.Versioning; import org.jetbrains.annotations.NotNull; import org.spigotmc.SpigotWorldConfig; diff --git a/src/test/java/com/comphenix/protocol/injector/EntityUtilitiesTest.java b/src/test/java/com/comphenix/protocol/injector/EntityUtilitiesTest.java index dfe32edc..943c5267 100644 --- a/src/test/java/com/comphenix/protocol/injector/EntityUtilitiesTest.java +++ b/src/test/java/com/comphenix/protocol/injector/EntityUtilitiesTest.java @@ -11,8 +11,8 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.ai.behavior.EntityTracker; -import org.bukkit.craftbukkit.v1_21_R2.CraftWorld; -import org.bukkit.craftbukkit.v1_21_R2.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_21_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_21_R3.entity.CraftEntity; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTest.java b/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTest.java index da502442..111e488e 100644 --- a/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTest.java +++ b/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTest.java @@ -14,7 +14,7 @@ import net.minecraft.world.level.block.state.BlockState; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_21_R2.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftItemStack; import org.bukkit.entity.Entity; import org.bukkit.inventory.ItemStack; import org.junit.jupiter.api.AfterAll; diff --git a/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTestUtil.java b/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTestUtil.java index d90fa9a8..0a540308 100644 --- a/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTestUtil.java +++ b/src/test/java/com/comphenix/protocol/utility/MinecraftReflectionTestUtil.java @@ -2,8 +2,8 @@ public class MinecraftReflectionTestUtil { - public static final String RELEASE_TARGET = "1.20.6"; - public static final String PACKAGE_VERSION = "v1_21_R2"; + public static final String RELEASE_TARGET = "1.21.4"; + public static final String PACKAGE_VERSION = "v1_21_R3"; public static final String NMS = "net.minecraft"; public static final String OBC = "org.bukkit.craftbukkit." + PACKAGE_VERSION; diff --git a/src/test/java/com/comphenix/protocol/utility/MinecraftVersionTest.java b/src/test/java/com/comphenix/protocol/utility/MinecraftVersionTest.java index c87bc4c5..0e79c9e9 100644 --- a/src/test/java/com/comphenix/protocol/utility/MinecraftVersionTest.java +++ b/src/test/java/com/comphenix/protocol/utility/MinecraftVersionTest.java @@ -48,7 +48,7 @@ void testComparison() { @Test void testCurrent() { - assertEquals(MinecraftVersion.v1_21_2, MinecraftVersion.getCurrentVersion()); + assertEquals(MinecraftVersion.v1_21_4, MinecraftVersion.getCurrentVersion()); } @Test diff --git a/src/test/java/com/comphenix/protocol/wrappers/WrappedBlockDataTest.java b/src/test/java/com/comphenix/protocol/wrappers/WrappedBlockDataTest.java index 3c3d75c3..d848299f 100644 --- a/src/test/java/com/comphenix/protocol/wrappers/WrappedBlockDataTest.java +++ b/src/test/java/com/comphenix/protocol/wrappers/WrappedBlockDataTest.java @@ -20,9 +20,9 @@ import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.type.GlassPane; -import org.bukkit.craftbukkit.v1_21_R2.block.data.CraftBlockData; -import org.bukkit.craftbukkit.v1_21_R2.block.impl.CraftStainedGlassPane; -import org.bukkit.craftbukkit.v1_21_R2.util.CraftMagicNumbers; +import org.bukkit.craftbukkit.v1_21_R3.block.data.CraftBlockData; +import org.bukkit.craftbukkit.v1_21_R3.block.impl.CraftStainedGlassPane; +import org.bukkit.craftbukkit.v1_21_R3.util.CraftMagicNumbers; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/comphenix/protocol/wrappers/WrappedComponentStyleTest.java b/src/test/java/com/comphenix/protocol/wrappers/WrappedComponentStyleTest.java index d4ff30c4..c7d8a131 100644 --- a/src/test/java/com/comphenix/protocol/wrappers/WrappedComponentStyleTest.java +++ b/src/test/java/com/comphenix/protocol/wrappers/WrappedComponentStyleTest.java @@ -25,7 +25,7 @@ public void testComponentStyle() { net.minecraft.network.chat.Style style = net.minecraft.network.chat.Style.EMPTY.withColor(ChatFormatting.RED).withBold(true); WrappedComponentStyle wrapped = new WrappedComponentStyle(style); JsonElement json = wrapped.getJson(); - assertEquals("{\"color\":\"red\",\"bold\":true}", json.toString()); + assertEquals("{\"bold\":true,\"color\":\"red\"}", json.toString()); assertEquals(style, WrappedComponentStyle.fromJson(json).getHandle()); } diff --git a/src/test/java/com/comphenix/protocol/wrappers/WrappedDataWatcherTest.java b/src/test/java/com/comphenix/protocol/wrappers/WrappedDataWatcherTest.java index 34f5449d..1b1f49a5 100644 --- a/src/test/java/com/comphenix/protocol/wrappers/WrappedDataWatcherTest.java +++ b/src/test/java/com/comphenix/protocol/wrappers/WrappedDataWatcherTest.java @@ -28,7 +28,7 @@ import net.minecraft.world.entity.projectile.ThrownEgg; import org.bukkit.Material; import org.bukkit.Particle; -import org.bukkit.craftbukkit.v1_21_R2.entity.CraftEgg; +import org.bukkit.craftbukkit.v1_21_R3.entity.CraftEgg; import org.bukkit.entity.Entity; import org.bukkit.inventory.ItemStack; import org.junit.jupiter.api.BeforeAll; diff --git a/src/test/java/com/comphenix/protocol/wrappers/WrappedStreamCodecTests.java b/src/test/java/com/comphenix/protocol/wrappers/WrappedStreamCodecTests.java index 2930188d..d42b3e44 100644 --- a/src/test/java/com/comphenix/protocol/wrappers/WrappedStreamCodecTests.java +++ b/src/test/java/com/comphenix/protocol/wrappers/WrappedStreamCodecTests.java @@ -10,8 +10,8 @@ import net.minecraft.network.protocol.game.ClientboundOpenBookPacket; import net.minecraft.world.InteractionHand; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_21_R2.CraftRegistry; -import org.bukkit.craftbukkit.v1_21_R2.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_21_R3.CraftRegistry; +import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftItemStack; import org.bukkit.inventory.ItemStack; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test;