Skip to content

Commit

Permalink
Remove static slot lens cache
Browse files Browse the repository at this point in the history
This breaks comparison between containers
  • Loading branch information
aromaa committed May 3, 2024
1 parent 1c92f98 commit 76b22d0
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;

/**
Expand Down Expand Up @@ -246,7 +245,7 @@ private static Lens lensPlayerContainer(Object inventory, int size, SlotLensProv

public static class BasicSlotLensProvider implements SlotLensProvider {

private static Map<Integer, BasicSlotLens> basicSlotLenses = new ConcurrentHashMap<>();
private Map<Integer, BasicSlotLens> basicSlotLenses = new HashMap<>();

public final int base;
public final int size;
Expand All @@ -262,7 +261,7 @@ public BasicSlotLensProvider(int base, int size) {

@Override
public SlotLens getSlotLens(int index) {
return BasicSlotLensProvider.basicSlotLenses.computeIfAbsent(index, BasicSlotLens::new);
return this.basicSlotLenses.computeIfAbsent(index, BasicSlotLens::new);
}

@Override
Expand Down

0 comments on commit 76b22d0

Please sign in to comment.