Skip to content

Commit

Permalink
replace more deprecated stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
powercasgamer committed May 11, 2023
1 parent 96bbe98 commit f231bd2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
))),
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit f231bd2

Please sign in to comment.