From 76b22d0235b0bbca23b46ee3e5beeda548a10170 Mon Sep 17 00:00:00 2001 From: aromaa Date: Sat, 4 May 2024 01:27:03 +0300 Subject: [PATCH] Remove static slot lens cache This breaks comparison between containers --- .../common/inventory/lens/impl/LensRegistrar.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/spongepowered/common/inventory/lens/impl/LensRegistrar.java b/src/main/java/org/spongepowered/common/inventory/lens/impl/LensRegistrar.java index 03921d8dbc1..6a9b485b44f 100644 --- a/src/main/java/org/spongepowered/common/inventory/lens/impl/LensRegistrar.java +++ b/src/main/java/org/spongepowered/common/inventory/lens/impl/LensRegistrar.java @@ -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; /** @@ -246,7 +245,7 @@ private static Lens lensPlayerContainer(Object inventory, int size, SlotLensProv public static class BasicSlotLensProvider implements SlotLensProvider { - private static Map basicSlotLenses = new ConcurrentHashMap<>(); + private Map basicSlotLenses = new HashMap<>(); public final int base; public final int size; @@ -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