summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
diff options
context:
space:
mode:
authorBuildTools <unconfigured@null.spigotmc.org>2015-01-18 17:33:13 +0000
committerBuildTools <unconfigured@null.spigotmc.org>2015-01-18 17:33:13 +0000
commit17962f66ec0a65adf666863fa05f32f528bd529e (patch)
tree257c2e774553b248cc2cdc04156d0b5b9b58a99b /src/main/java/org/bukkit
parent59dd2ddb9deb5b38cbfedf8b982a1f99b073262d (diff)
downloadcraftbukkit-17962f66ec0a65adf666863fa05f32f528bd529e.tar
craftbukkit-17962f66ec0a65adf666863fa05f32f528bd529e.tar.gz
craftbukkit-17962f66ec0a65adf666863fa05f32f528bd529e.tar.lz
craftbukkit-17962f66ec0a65adf666863fa05f32f528bd529e.tar.xz
craftbukkit-17962f66ec0a65adf666863fa05f32f528bd529e.zip
SPIGOT-443: Synchronize access to HANDLED_TAGS as Spigot uses it async
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 7ebb70bf..4681262a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -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
- ));
- }
- return HANDLED_TAGS;
+ 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;
+ }
}
}