From 810aa7514372d5e19e0d50563067ef23fd9ca2e2 Mon Sep 17 00:00:00 2001 From: Will FP Date: Fri, 6 Dec 2024 13:48:28 +0000 Subject: [PATCH] Revert "Janky thing with Items#getCustomItem" This reverts commit 7502355e150535bef70a8314370b61792ecd66eb. --- eco-api/src/main/java/com/willfp/eco/core/items/Items.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eco-api/src/main/java/com/willfp/eco/core/items/Items.java b/eco-api/src/main/java/com/willfp/eco/core/items/Items.java index 3fe7f199..c1ca0d8f 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/items/Items.java +++ b/eco-api/src/main/java/com/willfp/eco/core/items/Items.java @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -65,11 +64,10 @@ public final class Items { // this is a horribly janky fix to a problem that only exists in one third party // plugin that does things the wrong way around. - List copy = new ArrayList<>(REGISTRY.values()); - Collections.reverse(copy); + List reversed = ImmutableList.copyOf(REGISTRY.values()).reversed(); TestableItem match = null; - for (TestableItem item : copy) { + for (TestableItem item : reversed) { if (item.matches(key.getItem())) { match = item; break;