mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-14 01:14:07 +00:00
Fix concurrent modification crash in API.hideItem (#1030)
This commit is contained in:
1 parent
1fc824410b
commit
38dc14eca1
1 file changed
+2
-2
@@ -146,14 +146,14 @@ public class API {
|
|||||||
* Hide an item from the item panel Damage values of OreDictionary.WILDCARD_VALUE and ItemStackMap.WILDCARD_TAG tags
|
* Hide an item from the item panel Damage values of OreDictionary.WILDCARD_VALUE and ItemStackMap.WILDCARD_TAG tags
|
||||||
* function as wildcards for their respective variables
|
* function as wildcards for their respective variables
|
||||||
*/
|
*/
|
||||||
public static void hideItem(ItemStack item) {
|
public static synchronized void hideItem(ItemStack item) {
|
||||||
if (!ItemInfo.hiddenItems.contains(item)) {
|
if (!ItemInfo.hiddenItems.contains(item)) {
|
||||||
ItemInfo.hiddenItems.add(item);
|
ItemInfo.hiddenItems.add(item);
|
||||||
LayoutManager.markItemsDirty();
|
LayoutManager.markItemsDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void hideItem(String rule) {
|
public static synchronized void hideItem(String rule) {
|
||||||
ItemFilter filter = ItemStackFilterParser.parse(rule);
|
ItemFilter filter = ItemStackFilterParser.parse(rule);
|
||||||
if (filter != null) {
|
if (filter != null) {
|
||||||
ItemInfo.hiddenItemsRules.filters.add(filter);
|
ItemInfo.hiddenItemsRules.filters.add(filter);
|
||||||
|
|||||||
Reference in new issue
Block a user