mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 11:42:55 +01:00
SPIGOT-443: Synchronize access to HANDLED_TAGS as Spigot uses it async
This commit is contained in:
parent
59dd2ddb9d
commit
17962f66ec
1 changed files with 22 additions and 20 deletions
|
@ -691,26 +691,28 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
|||
}
|
||||
|
||||
public static Set<String> getHandledTags() {
|
||||
if (HANDLED_TAGS.isEmpty()) {
|
||||
HANDLED_TAGS.addAll(Arrays.asList(
|
||||
DISPLAY.NBT,
|
||||
REPAIR.NBT,
|
||||
ATTRIBUTES.NBT,
|
||||
ENCHANTMENTS.NBT,
|
||||
CraftMetaMap.MAP_SCALING.NBT,
|
||||
CraftMetaPotion.POTION_EFFECTS.NBT,
|
||||
CraftMetaSkull.SKULL_OWNER.NBT,
|
||||
CraftMetaTileEntity.BLOCK_ENTITY_TAG.NBT,
|
||||
CraftMetaBook.BOOK_TITLE.NBT,
|
||||
CraftMetaBook.BOOK_AUTHOR.NBT,
|
||||
CraftMetaBook.BOOK_PAGES.NBT,
|
||||
CraftMetaBook.RESOLVED.NBT,
|
||||
CraftMetaBook.GENERATION.NBT,
|
||||
CraftMetaFirework.FIREWORKS.NBT,
|
||||
CraftMetaEnchantedBook.STORED_ENCHANTMENTS.NBT,
|
||||
CraftMetaCharge.EXPLOSION.NBT
|
||||
));
|
||||
synchronized (HANDLED_TAGS) {
|
||||
if (HANDLED_TAGS.isEmpty()) {
|
||||
HANDLED_TAGS.addAll(Arrays.asList(
|
||||
DISPLAY.NBT,
|
||||
REPAIR.NBT,
|
||||
ATTRIBUTES.NBT,
|
||||
ENCHANTMENTS.NBT,
|
||||
CraftMetaMap.MAP_SCALING.NBT,
|
||||
CraftMetaPotion.POTION_EFFECTS.NBT,
|
||||
CraftMetaSkull.SKULL_OWNER.NBT,
|
||||
CraftMetaTileEntity.BLOCK_ENTITY_TAG.NBT,
|
||||
CraftMetaBook.BOOK_TITLE.NBT,
|
||||
CraftMetaBook.BOOK_AUTHOR.NBT,
|
||||
CraftMetaBook.BOOK_PAGES.NBT,
|
||||
CraftMetaBook.RESOLVED.NBT,
|
||||
CraftMetaBook.GENERATION.NBT,
|
||||
CraftMetaFirework.FIREWORKS.NBT,
|
||||
CraftMetaEnchantedBook.STORED_ENCHANTMENTS.NBT,
|
||||
CraftMetaCharge.EXPLOSION.NBT
|
||||
));
|
||||
}
|
||||
return HANDLED_TAGS;
|
||||
}
|
||||
return HANDLED_TAGS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue