Skip to content

Commit

Permalink
Revert "Janky thing with Items#getCustomItem"
Browse files Browse the repository at this point in the history
This reverts commit 7502355.
  • Loading branch information
WillFP committed Dec 6, 2024
1 parent 7502355 commit 810aa75
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions eco-api/src/main/java/com/willfp/eco/core/items/Items.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<TestableItem> copy = new ArrayList<>(REGISTRY.values());
Collections.reverse(copy);
List<TestableItem> 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;
Expand Down

0 comments on commit 810aa75

Please sign in to comment.