SPIGOT-7644: Fix ItemMeta#getAsString
By: md_5 <git@md-5.net>
This commit is contained in:
parent
0222693862
commit
4ae8689c1b
1 changed files with 3 additions and 1 deletions
|
@ -1275,7 +1275,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
|||
public String getAsString() {
|
||||
CraftMetaItem.Applicator tag = new CraftMetaItem.Applicator();
|
||||
applyToItem(tag);
|
||||
return tag.build().toString();
|
||||
DataComponentPatch patch = tag.build();
|
||||
NBTBase nbt = DataComponentPatch.CODEC.encodeStart(MinecraftServer.getDefaultRegistryAccess().createSerializationContext(DynamicOpsNBT.INSTANCE), patch).getOrThrow();
|
||||
return nbt.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue