Fix concurrent modification crash in API.hideItem (#1030)

This commit is contained in:
slprime authored and GitHub committed 2026-09-11 08:30:49 +03:00
1 parent 1fc824410b
commit 38dc14eca1
1 file changed
+2 -2
+2 -2
View File
@@ -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
* 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)) {
ItemInfo.hiddenItems.add(item);
LayoutManager.markItemsDirty();
}
}
public static void hideItem(String rule) {
public static synchronized void hideItem(String rule) {
ItemFilter filter = ItemStackFilterParser.parse(rule);
if (filter != null) {
ItemInfo.hiddenItemsRules.filters.add(filter);