mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-22 21:19:51 +00:00
Fix asm crash in beacon gui
Fix rare ItemSorter crash
This commit is contained in:
1 parent
7a6a694ebd
commit
f101d36a5f
3 files changed
+8
-6
No files matched your search
@@ -37,10 +37,10 @@ public class ItemSorter implements Comparator<ItemStack>, ItemsLoadedCallback
|
||||
|
||||
public static ArrayList<SortEntry> entries = new ArrayList<SortEntry>();
|
||||
public static ArrayList<SortEntry> list = new ArrayList<SortEntry>();
|
||||
public static ItemSorter instance = new ItemSorter();
|
||||
public static final ItemSorter instance = new ItemSorter();
|
||||
|
||||
//optimisations
|
||||
public HashMap<ItemStack, Integer> ordering = new HashMap<ItemStack, Integer>();
|
||||
public HashMap<ItemStack, Integer> ordering = null;
|
||||
|
||||
public static void sort(ArrayList<ItemStack> items) {
|
||||
Collections.sort(items, instance);
|
||||
@@ -57,10 +57,11 @@ public class ItemSorter implements Comparator<ItemStack>, ItemsLoadedCallback
|
||||
|
||||
@Override
|
||||
public void itemsLoaded() {
|
||||
ordering.clear();
|
||||
HashMap<ItemStack, Integer> newMap = new HashMap<ItemStack, Integer>();
|
||||
int i = 0;
|
||||
for(ItemStack stack : ItemList.items)
|
||||
ordering.put(stack, i++);
|
||||
newMap.put(stack, i++);
|
||||
ordering = newMap;
|
||||
}
|
||||
|
||||
public static String getSaveString() {
|
||||
|
||||
Reference in new issue
Block a user