Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
SPIGOT-4049: Books lose NBT data
Dieser Commit ist enthalten in:
Ursprung
92dceb827c
Commit
595ec64726
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
+ // Called to run this stack through the data converter to handle older storage methods and serialized items
|
+ // Called to run this stack through the data converter to handle older storage methods and serialized items
|
||||||
+ public void convertStack() {
|
+ public void convertStack() {
|
||||||
+ if (MinecraftServer.getServer() != null) {
|
+ if (false && MinecraftServer.getServer() != null) { // Skip for now, causes more issues than it solves
|
||||||
+ // Don't convert some things - both the old and new data values are valid
|
+ // Don't convert some things - both the old and new data values are valid
|
||||||
+ // Conversion would make getting then impossible
|
+ // Conversion would make getting then impossible
|
||||||
+ if (this.item == Blocks.PUMPKIN.getItem() || this.item == Blocks.GRASS.getItem() || this.item == Blocks.SNOW.getItem()) {
|
+ if (this.item == Blocks.PUMPKIN.getItem() || this.item == Blocks.GRASS.getItem() || this.item == Blocks.SNOW.getItem()) {
|
||||||
|
@ -466,10 +466,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
|||||||
@Overridden
|
@Overridden
|
||||||
void applyToItem(NBTTagCompound itemTag) {
|
void applyToItem(NBTTagCompound itemTag) {
|
||||||
if (hasDisplayName()) {
|
if (hasDisplayName()) {
|
||||||
setDisplayTag(itemTag, NAME.NBT, new NBTTagString(CraftChatMessage.fromComponent(displayName))); // SPIGOT-4041: Should be JSON, but we're still aggressively converting stacks & old+new are both valid
|
setDisplayTag(itemTag, NAME.NBT, new NBTTagString(CraftChatMessage.toJSON(displayName)));
|
||||||
}
|
}
|
||||||
if (hasLocalizedName()){
|
if (hasLocalizedName()){
|
||||||
setDisplayTag(itemTag, LOCNAME.NBT, new NBTTagString(CraftChatMessage.fromComponent(locName))); // SPIGOT-4041: Should be JSON, but we're still aggressively converting stacks & old+new are both valid
|
setDisplayTag(itemTag, LOCNAME.NBT, new NBTTagString(CraftChatMessage.toJSON(locName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasLore()) {
|
if (hasLore()) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren