fix some issues on the todo list
This commit is contained in:
parent
f6fae41cdf
commit
cc81668863
3 changed files with 31 additions and 5 deletions
|
@ -14,7 +14,7 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|||
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java b/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..afd658635d1243770ecd96d3f274e3c24175b1e1
|
||||
index 0000000000000000000000000000000000000000..8dcedc5f4d4453fd942787dbcb9c757274ec7715
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java
|
||||
@@ -0,0 +1,446 @@
|
||||
|
@ -143,7 +143,7 @@ index 0000000000000000000000000000000000000000..afd658635d1243770ecd96d3f274e3c2
|
|||
+
|
||||
+ static Codec<HoverEvent.ShowItem> showItemCodec(final Codec<Component> componentCodec) {
|
||||
+ return net.minecraft.network.chat.HoverEvent.ItemStackInfo.CODEC.xmap(isi -> {
|
||||
+ @Subst("key") final String typeKey = isi.item.unwrapKey().orElseThrow().toString();
|
||||
+ @Subst("key") final String typeKey = isi.item.unwrapKey().orElseThrow().location().toString();
|
||||
+ return HoverEvent.ShowItem.showItem(Key.key(typeKey), isi.count, PaperAdventure.asAdventure(isi.getItemStack().getComponentsPatch()));
|
||||
+ }, si -> {
|
||||
+ final Item itemType = BuiltInRegistries.ITEM.get(PaperAdventure.asVanilla(si.item()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue