From f231bd241c31e57d10128b222a751b79e7628b37 Mon Sep 17 00:00:00 2001 From: powercas_gamer Date: Thu, 11 May 2023 23:03:38 +0200 Subject: [PATCH] replace more deprecated stuff --- .../text/serializer/gson/ShowEntitySerializer.java | 2 +- .../adventure/text/serializer/gson/ShowItemSerializer.java | 2 +- .../text/serializer/gson/ShowItemSerializerTest.java | 6 +++--- .../net/kyori/adventure/text/serializer/gson/StyleTest.java | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowEntitySerializer.java b/text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowEntitySerializer.java index e71677507..b8947beaa 100644 --- a/text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowEntitySerializer.java +++ b/text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowEntitySerializer.java @@ -76,7 +76,7 @@ public HoverEvent.ShowEntity read(final JsonReader in) throws IOException { } in.endObject(); - return HoverEvent.ShowEntity.of(type, id, name); + return HoverEvent.ShowEntity.showEntity(type, id, name); } @Override diff --git a/text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializer.java b/text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializer.java index d5ba08b55..f243c063a 100644 --- a/text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializer.java +++ b/text-serializer-gson/src/main/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializer.java @@ -85,7 +85,7 @@ public HoverEvent.ShowItem read(final JsonReader in) throws IOException { } in.endObject(); - return HoverEvent.ShowItem.of(key, count, nbt); + return HoverEvent.ShowItem.showItem(key, count, nbt); } @Override diff --git a/text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializerTest.java b/text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializerTest.java index 0cfaed63c..9a67fefc5 100644 --- a/text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializerTest.java +++ b/text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/ShowItemSerializerTest.java @@ -39,10 +39,10 @@ class ShowItemSerializerTest { @Test void testDeserializeWithPopulatedTag() throws IOException { assertEquals( - HoverEvent.ShowItem.of(Key.key("minecraft", "diamond"), 1, BinaryTagHolder.binaryTagHolder(TagStringIO.get().asString( + HoverEvent.ShowItem.showItem(Key.key("minecraft", "diamond"), 1, BinaryTagHolder.binaryTagHolder(TagStringIO.get().asString( CompoundBinaryTag.builder() .put("display", CompoundBinaryTag.builder() - .put("Name", StringBinaryTag.of("A test!")) + .put("Name", StringBinaryTag.stringBinaryTag("A test!")) .build()) .build() ))), @@ -60,7 +60,7 @@ void testDeserializeWithPopulatedTag() throws IOException { @Test void testDeserializeWithNullTag() { assertEquals( - HoverEvent.ShowItem.of(Key.key("minecraft", "diamond"), 1, null), + HoverEvent.ShowItem.showItem(Key.key("minecraft", "diamond"), 1, null), GsonComponentSerializer.gson().serializer().fromJson( GsonTest.object(json -> { json.addProperty(ShowItemSerializer.ID, "minecraft:diamond"); diff --git a/text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/StyleTest.java b/text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/StyleTest.java index 62335dcd8..1cbb42374 100644 --- a/text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/StyleTest.java +++ b/text-serializer-gson/src/test/java/net/kyori/adventure/text/serializer/gson/StyleTest.java @@ -145,7 +145,7 @@ void testShowEntityHoverEvent() { final UUID dolores = UUID.randomUUID(); this.test( Style.style() - .hoverEvent(HoverEvent.showEntity(HoverEvent.ShowEntity.of( + .hoverEvent(HoverEvent.showEntity(HoverEvent.ShowEntity.showEntity( Key.key(Key.MINECRAFT_NAMESPACE, "pig"), dolores, Component.text("Dolores", TextColor.color(0x0a1ab9)) @@ -175,7 +175,7 @@ void testShowItemHoverEvent() { private static Style showItemStyle(final int count) { return Style.style() - .hoverEvent(HoverEvent.showItem(HoverEvent.ShowItem.of( + .hoverEvent(HoverEvent.showItem(HoverEvent.ShowItem.showItem( Key.key(Key.MINECRAFT_NAMESPACE, "stone"), count, null // TODO: test for NBT?