Skip to content

Commit

Permalink
Export works! The export size is hideous but I have the opportunity t…
Browse files Browse the repository at this point in the history
…o stop Java-ing and filter down using Python instead, and you best believe I'mma do that.
  • Loading branch information
Hermanoid committed Jan 14, 2024
1 parent c7ced80 commit 62de768
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/main/java/com/hermanoid/nerd/RecipeDumper.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,9 @@ private JsonObject extractJsonRecipeData(QueryResult queryResult){
}

public Stream<JsonObject> getQueryDumps(List<ItemStack> items) {
// TODO: Experiment with parallelization here
// Since the bulk of work here is the query, which is already parallel,
// I'm not sure how much performance gain (if any) this would cause.
return items.stream()
// .limit(500)
// Parallelization doesn't help a *lot* but it is like a 2x speedup so I'll take it
return items.parallelStream()
.map(this::performQuery)
// .parallel()
.map(this::extractJsonRecipeData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import codechicken.nei.util.NBTJson;
import com.google.gson.*;
import com.google.gson.reflect.TypeToken;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_Recipe;
import gregtech.common.fluid.GT_Fluid;
import gregtech.nei.GT_NEI_DefaultHandler;
Expand Down Expand Up @@ -45,7 +46,12 @@ private static class GTRecipeExclusionStrategy implements ExclusionStrategy {
"mOreDictAlt"

));
List<Type> badTypes = Arrays.asList(GT_NEI_DefaultHandler.class, ItemStack.class, FluidStack.class);
List<Type> badTypes = Arrays.asList(
GT_NEI_DefaultHandler.class,
ItemStack.class,
FluidStack.class,
Materials.class // Pops up in metadata (contains lots of images and such)
);
@Override
public boolean shouldSkipField(FieldAttributes f) {

Expand Down

0 comments on commit 62de768

Please sign in to comment.