Skip to content

Commit c8ca08f

Browse files
authored
Merge pull request #105 from sylviameows/main
fix: item tags showing up on action viewer
2 parents c5364d7 + 711cf7a commit c8ca08f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/main/java/dev/dfonline/codeclient/hypercube/ReferenceBook.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,19 @@ public ItemStack getItem() {
3131
return book;
3232
}
3333

34+
/**
35+
* This function exists to fix a compatibility issue with previewing items tags.
36+
* (e.g. the {@link dev.dfonline.codeclient.dev.overlay.ActionViewer}'s fallback tooltip)
37+
* @return the reference book without any tags applied to it.
38+
*/
39+
public ItemStack getTaglessItem() {
40+
var tagless = book.copy();
41+
tagless.setSubNbt("PublicBukkitValues", null);
42+
return tagless;
43+
}
44+
3445
public List<Text> getTooltip() {
35-
return book.getTooltip(null, TooltipContext.BASIC);
46+
return getTaglessItem().getTooltip(null, TooltipContext.BASIC);
3647
}
3748

3849
// todo: parse into action?

0 commit comments

Comments
 (0)