Skip to content

Commit

Permalink
Fix some JEI plugin issues (GregTechCEu#2337)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 authored Jan 5, 2024
1 parent d9e3906 commit 37905ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
11 changes: 9 additions & 2 deletions src/main/java/gregtech/api/recipes/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* Class that represent machine recipe.
Expand Down Expand Up @@ -673,8 +679,9 @@ public boolean hasValidInputsForDisplay() {
.anyMatch(s -> !s.isEmpty())) {
return true;
}
} else if (Arrays.stream(ingredient.getInputStacks()).anyMatch(s -> !s.isEmpty())) {
return true;
}
return Arrays.stream(ingredient.getInputStacks()).anyMatch(s -> !s.isEmpty());
}
for (GTRecipeInput fluidInput : fluidInputs) {
FluidStack fluidIngredient = fluidInput.getInputFluidStack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
import org.jetbrains.annotations.NotNull;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand Down Expand Up @@ -214,15 +214,15 @@ public void register(IModRegistry registry) {
registry.addRecipeCatalyst(MetaTileEntities.LARGE_TITANIUM_BOILER.getStackForm(), semiFluidMapId);
registry.addRecipeCatalyst(MetaTileEntities.LARGE_TUNGSTENSTEEL_BOILER.getStackForm(), semiFluidMapId);

List<OreByProduct> oreByproductList = new CopyOnWriteArrayList<>();
List<OreByProduct> oreByproductList = new ArrayList<>();
for (Material material : GregTechAPI.materialManager.getRegisteredMaterials()) {
if (material.hasProperty(PropertyKey.ORE)) {
oreByproductList.add(new OreByProduct(material));
}
}
String oreByProductId = GTValues.MODID + ":" + "ore_by_product";
registry.addRecipes(oreByproductList, oreByProductId);
MetaTileEntity[][] machineLists = new MetaTileEntity[][] {
MetaTileEntity[][] machineLists = {
MetaTileEntities.MACERATOR,
MetaTileEntities.ORE_WASHER,
MetaTileEntities.CENTRIFUGE,
Expand All @@ -237,7 +237,7 @@ public void register(IModRegistry registry) {
}

// Material Tree
List<MaterialTree> materialTreeList = new CopyOnWriteArrayList<>();
List<MaterialTree> materialTreeList = new ArrayList<>();
for (Material material : GregTechAPI.materialManager.getRegisteredMaterials()) {
if (material.hasProperty(PropertyKey.DUST)) {
materialTreeList.add(new MaterialTree(material));
Expand All @@ -247,7 +247,7 @@ public void register(IModRegistry registry) {

// Ore Veins
List<OreDepositDefinition> oreVeins = WorldGenRegistry.getOreDeposits();
List<GTOreInfo> oreInfoList = new CopyOnWriteArrayList<>();
List<GTOreInfo> oreInfoList = new ArrayList<>();
for (OreDepositDefinition vein : oreVeins) {
oreInfoList.add(new GTOreInfo(vein));
}
Expand All @@ -261,7 +261,7 @@ public void register(IModRegistry registry) {

// Fluid Veins
List<BedrockFluidDepositDefinition> fluidVeins = WorldGenRegistry.getBedrockVeinDeposits();
List<GTFluidVeinInfo> fluidVeinInfos = new CopyOnWriteArrayList<>();
List<GTFluidVeinInfo> fluidVeinInfos = new ArrayList<>();
for (BedrockFluidDepositDefinition fluidVein : fluidVeins) {
fluidVeinInfos.add(new GTFluidVeinInfo(fluidVein));
}
Expand Down Expand Up @@ -307,7 +307,7 @@ private void setupInputHandler() {

showsRecipeFocuses.add(new MultiblockInfoRecipeFocusShower());

} catch (Exception e) {
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException | SecurityException e) {
getLogger().error("Could not reflect JEI Internal inputHandler", e);
}
}
Expand Down

0 comments on commit 37905ee

Please sign in to comment.