Skip to content

Commit

Permalink
Fix Concurrent Modification registerRectsToGuis When Plugins Loading
Browse files Browse the repository at this point in the history
  • Loading branch information
slprime committed Dec 7, 2024
1 parent 6049d0e commit 0e0e3c5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -311,7 +312,7 @@ public int hashCode() {

public static class RecipeTransferRectHandler implements IContainerInputHandler, IContainerTooltipHandler {

private static final HashMap<Class<? extends GuiContainer>, HashSet<RecipeTransferRect>> guiMap = new HashMap<>();
private static final Map<Class<? extends GuiContainer>, HashSet<RecipeTransferRect>> guiMap = new ConcurrentHashMap<>();

public static void registerRectsToGuis(List<Class<? extends GuiContainer>> classes,
List<RecipeTransferRect> rects) {
Expand Down

0 comments on commit 0e0e3c5

Please sign in to comment.