diff options
author | Martin Robertz <dream-master@gmx.net> | 2021-06-29 15:49:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 15:49:00 +0200 |
commit | 52148c6dbcf036a82e7bdfe193be43ec865bd66a (patch) | |
tree | f3959f64413a85df78bd96e71f48197c3241f5b3 | |
parent | 49a44fb0499754580f46815b4ba835316f0826d4 (diff) | |
parent | 5d56e1448271c78c8aa3d319560da6d36001e633 (diff) | |
download | GT5-Unofficial-52148c6dbcf036a82e7bdfe193be43ec865bd66a.tar.gz GT5-Unofficial-52148c6dbcf036a82e7bdfe193be43ec865bd66a.tar.bz2 GT5-Unofficial-52148c6dbcf036a82e7bdfe193be43ec865bd66a.zip |
Merge pull request #580 from Prometheus0000/sort
-rw-r--r-- | src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java index 9afea436d0..6c315edb42 100644 --- a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java @@ -30,6 +30,7 @@ import org.lwjgl.opengl.GL11; import java.awt.*; import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -56,6 +57,12 @@ public class GT_NEI_AssLineHandler extends TemplateRecipeHandler { } } + public List<GT_Recipe> getSortedRecipes() { + List<GT_Recipe> result = new ArrayList<>(this.mRecipeMap.mRecipeList); + Collections.sort(result); + return result; + } + public static void drawText(int aX, int aY, String aString, int aColor) { Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); } @@ -69,7 +76,7 @@ public class GT_NEI_AssLineHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equals(getOverlayIdentifier())) { - for (GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) { + for (GT_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { this.arecipes.add(new CachedDefaultRecipe(tRecipe)); }else{ @@ -102,7 +109,7 @@ public class GT_NEI_AssLineHandler extends TemplateRecipeHandler { } } } - for (GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) { + for (GT_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); for (ItemStack tStack : tResults) { |