change to hashset to save about 30 second from server starting

This commit is contained in:
jiawei10 2018-01-19 18:51:17 +08:00
parent 36437b59c0
commit f97fe05b1e
4 changed files with 9 additions and 7 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View file

@ -45,18 +45,18 @@ repositories {
}
dependencies {
repositories {
/*repositories {
ivy {
name "BuildCraft"
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]"
}
}
}*/
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
compile name: "buildcraft", version: "7.1.16", classifier: "dev"
//compile name: "buildcraft", version: "7.1.16", classifier: "dev"
compile "codechicken:CodeChickenLib:1.7.10-1.1.3.138:dev"
compile "codechicken:CodeChickenCore:1.7.10-1.0.7.46:dev"
compile "codechicken:NotEnoughItems:1.7.10-1.0.5.110:dev"
@ -95,4 +95,4 @@ idea
{
inheritOutputDirs = true
}
}
}

BIN
libs/buildcraft-7.1.16.jar Executable file

Binary file not shown.

View file

@ -16,6 +16,7 @@ import train.common.core.managers.TierRecipeManager;
import java.awt.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
@ -263,19 +264,20 @@ public class NEIAssemblyTableRecipePlugin extends ShapedRecipeHandler {
}
public static List assemblyListCleaner(List recipeList) {
ArrayList outputList = new ArrayList();
HashSet outputList = new HashSet();
ArrayList cleanedList = new ArrayList();
for (int i = 0; i < recipeList.size(); i++) {
//ItemStack output = ((TierRecipe) recipeList.get(i)).getOutput();
int id=Item.getIdFromItem(((TierRecipe) recipeList.get(i)).getOutput().getItem());
if (outputList != null) {
if (!outputList.contains(Item.getIdFromItem(((TierRecipe) recipeList.get(i)).getOutput().getItem()))) {
if (!outputList.contains(id)) {
cleanedList.add(recipeList.get(i));
}
}
else {
cleanedList.add(recipeList.get(i));
}
outputList.add(Item.getIdFromItem(((TierRecipe) recipeList.get(i)).getOutput().getItem()));
outputList.add(id);
}
return cleanedList;
}