SPIGOT-7644: Fix ItemMeta#getAsString
This commit is contained in:
parent
4e77a81e1c
commit
91b1fc3f1c
@ -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…
x
Reference in New Issue
Block a user