Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some JEI plugin issues #2337

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading