[ci skip] spotlessApply with the new settings

This commit is contained in:
Raven Szewczyk committed 2023-01-29 10:16:50 +00:00
1 parent 9bdeaa9708
commit 42e704a5d8
66 files changed
+1059 -828

No files matched your search

@@ -1,11 +1,14 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
import javax.annotation.Nonnull;
public class AppengRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
@@ -1,11 +1,14 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
import javax.annotation.Nonnull;
public class AvaritiaRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
@@ -1,14 +1,17 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
import javax.annotation.Nonnull;
/**
* @author vfyjxf
*/
public class BloodMagicRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
@@ -1,15 +1,18 @@
package com.github.vfyjxf.nee.processor;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerLexicaBotania;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
public class BotaniaRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
@@ -1,13 +1,15 @@
package com.github.vfyjxf.nee.processor;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import buildcraft.compat.nei.RecipeHandlerAssemblyTable;
import buildcraft.compat.nei.RecipeHandlerIntegrationTable;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
/**
* @author vfyjxf
@@ -42,17 +44,15 @@ public class BuildCraftRecipeProcessor implements IRecipeProcessor {
return new ArrayList<>();
}
private List<PositionedStack> handlerAssemblyTableRecipe(
RecipeHandlerAssemblyTable recipe, int recipeIndex, boolean getInput) {
return getInput
? recipe.getIngredientStacks(recipeIndex)
private List<PositionedStack> handlerAssemblyTableRecipe(RecipeHandlerAssemblyTable recipe, int recipeIndex,
boolean getInput) {
return getInput ? recipe.getIngredientStacks(recipeIndex)
: Collections.singletonList(recipe.getResultStack(recipeIndex));
}
private List<PositionedStack> handlerIntegrationTableRecipe(
RecipeHandlerIntegrationTable recipe, int recipeIndex, boolean getInput) {
return getInput
? recipe.getIngredientStacks(recipeIndex)
private List<PositionedStack> handlerIntegrationTableRecipe(RecipeHandlerIntegrationTable recipe, int recipeIndex,
boolean getInput) {
return getInput ? recipe.getIngredientStacks(recipeIndex)
: Collections.singletonList(recipe.getResultStack(recipeIndex));
}
}
@@ -1,22 +1,26 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import crazypants.enderio.nei.SagMillRecipeHandler;
import java.util.*;
import javax.annotation.Nonnull;
public class EnderIORecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
return new HashSet<>(Arrays.asList(
"EnderIOAlloySmelter",
"EIOEnchanter",
"EnderIOSagMill",
"EnderIOSliceAndSplice",
"EnderIOSoulBinder",
"EnderIOVat"));
return new HashSet<>(
Arrays.asList(
"EnderIOAlloySmelter",
"EIOEnchanter",
"EnderIOSagMill",
"EnderIOSliceAndSplice",
"EnderIOSoulBinder",
"EnderIOVat"));
}
@Nonnull
@@ -46,10 +50,10 @@ public class EnderIORecipeProcessor implements IRecipeProcessor {
recipeOutputs.addAll(recipe.getOtherStacks(recipeIndex));
// remove output if it's chance != 1
if (recipe instanceof SagMillRecipeHandler) {
SagMillRecipeHandler.MillRecipe millRecipe =
(SagMillRecipeHandler.MillRecipe) ((SagMillRecipeHandler) recipe).arecipes.get(recipeIndex);
recipeOutputs.removeIf(
positionedStack -> millRecipe.getChanceForOutput(positionedStack.item) != 1.0F);
SagMillRecipeHandler.MillRecipe millRecipe = (SagMillRecipeHandler.MillRecipe) ((SagMillRecipeHandler) recipe).arecipes
.get(recipeIndex);
recipeOutputs
.removeIf(positionedStack -> millRecipe.getChanceForOutput(positionedStack.item) != 1.0F);
}
return recipeOutputs;
}
@@ -1,25 +1,28 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
import javax.annotation.Nonnull;
public class ForestryRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
return new HashSet<>(Arrays.asList(
"forestry.bottler",
"forestry.carpenter",
"forestry.centrifuge",
"forestry.fabricator",
"forestry.fermenter",
"forestry.moistener",
"forestry.squeezer",
"forestry.still",
RecipeProcessor.NULL_IDENTIFIER));
return new HashSet<>(
Arrays.asList(
"forestry.bottler",
"forestry.carpenter",
"forestry.centrifuge",
"forestry.fabricator",
"forestry.fermenter",
"forestry.moistener",
"forestry.squeezer",
"forestry.still",
RecipeProcessor.NULL_IDENTIFIER));
}
@Nonnull
@@ -1,15 +1,18 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import gregtech.api.util.GTPP_Recipe;
import java.util.*;
import javax.annotation.Nonnull;
/**
* @author vfyjxf
*/
public class GTPPRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
@@ -36,9 +39,9 @@ public class GTPPRecipeProcessor implements IRecipeProcessor {
List<PositionedStack> recipeInputs = new ArrayList<>();
if (this.getAllOverlayIdentifier().contains(identifier)) {
recipeInputs.addAll(recipe.getIngredientStacks(recipeIndex));
recipeInputs.removeIf(positionedStack ->
GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0]) != null
|| positionedStack.item.stackSize == 0);
recipeInputs.removeIf(
positionedStack -> GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0])
!= null || positionedStack.item.stackSize == 0);
return recipeInputs;
}
return recipeInputs;
@@ -50,8 +53,9 @@ public class GTPPRecipeProcessor implements IRecipeProcessor {
List<PositionedStack> recipeOutputs = new ArrayList<>();
if (this.getAllOverlayIdentifier().contains(identifier)) {
recipeOutputs.addAll(recipe.getOtherStacks(recipeIndex));
recipeOutputs.removeIf(positionedStack ->
GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0]) != null);
recipeOutputs.removeIf(
positionedStack -> GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0])
!= null);
return recipeOutputs;
}
return recipeOutputs;
@@ -1,14 +1,16 @@
package com.github.vfyjxf.nee.processor;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
public class GoodGeneratorRecipeProcessor implements IRecipeProcessor {
@Nonnull
@@ -29,9 +31,9 @@ public class GoodGeneratorRecipeProcessor implements IRecipeProcessor {
List<PositionedStack> recipeInputs = new ArrayList<>();
if (this.getAllOverlayIdentifier().contains(identifier)) {
recipeInputs.addAll(recipe.getIngredientStacks(recipeIndex));
recipeInputs.removeIf(positionedStack ->
GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0]) != null
|| positionedStack.item.stackSize == 0);
recipeInputs.removeIf(
positionedStack -> GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0])
!= null || positionedStack.item.stackSize == 0);
return recipeInputs;
}
return recipeInputs;
@@ -43,8 +45,9 @@ public class GoodGeneratorRecipeProcessor implements IRecipeProcessor {
List<PositionedStack> recipeOutputs = new ArrayList<>();
if (this.getAllOverlayIdentifier().contains(identifier)) {
recipeOutputs.addAll(recipe.getOtherStacks(recipeIndex));
recipeOutputs.removeIf(positionedStack ->
GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0]) != null);
recipeOutputs.removeIf(
positionedStack -> GregTech5RecipeProcessor.getFluidFromDisplayStack(positionedStack.items[0])
!= null);
return recipeOutputs;
}
return recipeOutputs;
@@ -1,23 +1,28 @@
package com.github.vfyjxf.nee.processor;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import com.github.vfyjxf.nee.utils.GuiUtils;
import com.glodblock.github.client.gui.GuiFluidPatternTerminalEx;
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_Recipe;
import gregtech.nei.GT_NEI_DefaultHandler.FixedPositionedStack;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import com.github.vfyjxf.nee.utils.GuiUtils;
import com.glodblock.github.client.gui.GuiFluidPatternTerminalEx;
import gregtech.api.enums.ItemList;
import gregtech.api.util.GT_Recipe;
import gregtech.nei.GT_NEI_DefaultHandler.FixedPositionedStack;
/**
* @author vfyjxf
*/
@@ -39,12 +44,10 @@ public class GregTech5RecipeProcessor implements IRecipeProcessor {
}
/**
* For resolving NoSuchMethodError
* Copied from GTNewHorizons/GT5-Unofficial.
* For resolving NoSuchMethodError Copied from GTNewHorizons/GT5-Unofficial.
*/
public static FluidStack getFluidFromDisplayStack(ItemStack aDisplayStack) {
if (!isStackValid(aDisplayStack)
|| aDisplayStack.getItem() != ItemList.Display_Fluid.getItem()
if (!isStackValid(aDisplayStack) || aDisplayStack.getItem() != ItemList.Display_Fluid.getItem()
|| !aDisplayStack.hasTagCompound()) {
return null;
}
@@ -53,8 +56,7 @@ public class GregTech5RecipeProcessor implements IRecipeProcessor {
}
public static boolean isStackValid(Object aStack) {
return (aStack instanceof ItemStack)
&& ((ItemStack) aStack).getItem() != null
return (aStack instanceof ItemStack) && ((ItemStack) aStack).getItem() != null
&& ((ItemStack) aStack).stackSize >= 0;
}
@@ -84,8 +86,8 @@ public class GregTech5RecipeProcessor implements IRecipeProcessor {
List<PositionedStack> recipeInputs = new ArrayList<>();
if (gtDefaultClz.isInstance(recipe) || gtAssLineClz.isInstance(recipe)) {
if (GuiUtils.isFluidCraftPatternTermEx(Minecraft.getMinecraft().currentScreen)) {
boolean priority =
((GuiFluidPatternTerminalEx) Minecraft.getMinecraft().currentScreen).container.prioritize;
boolean priority = ((GuiFluidPatternTerminalEx) Minecraft
.getMinecraft().currentScreen).container.prioritize;
if (priority) {
for (PositionedStack ps : recipe.getIngredientStacks(recipeIndex)) {
if (ps != null && getFluidFromDisplayStack(ps.item) != null) {
@@ -102,8 +104,9 @@ public class GregTech5RecipeProcessor implements IRecipeProcessor {
}
} else {
recipeInputs.addAll(recipe.getIngredientStacks(recipeIndex));
recipeInputs.removeIf(positionedStack -> getFluidFromDisplayStack(positionedStack.items[0]) != null
|| positionedStack.item.stackSize == 0);
recipeInputs.removeIf(
positionedStack -> getFluidFromDisplayStack(positionedStack.items[0]) != null
|| positionedStack.item.stackSize == 0);
}
if (!recipeInputs.isEmpty()) {
ItemStack specialItem = recipeInputs.get(recipeInputs.size() - 1).items[0];
@@ -126,8 +129,8 @@ public class GregTech5RecipeProcessor implements IRecipeProcessor {
recipeOutputs.addAll(recipe.getOtherStacks(recipeIndex));
recipeOutputs.removeIf(positionedStack -> getFluidFromDisplayStack(positionedStack.items[0]) != null);
// remove output if it's chance != 10000
recipeOutputs.removeIf(stack -> stack instanceof FixedPositionedStack
&& !(((FixedPositionedStack) stack).mChance == 10000
recipeOutputs.removeIf(
stack -> stack instanceof FixedPositionedStack && !(((FixedPositionedStack) stack).mChance == 10000
|| ((FixedPositionedStack) stack).mChance <= 0));
return recipeOutputs;
}
@@ -1,5 +1,15 @@
package com.github.vfyjxf.nee.processor;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import cpw.mods.fml.relauncher.ReflectionHelper;
@@ -7,18 +17,12 @@ import gregapi.NEI_RecipeMap;
import gregapi.NEI_RecipeMap.FixedPositionedStack;
import gregapi.data.FL;
import gregapi.recipes.Recipe;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
/**
* @author vfyjxf
*/
public class GregTech6RecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
@@ -44,8 +48,9 @@ public class GregTech6RecipeProcessor implements IRecipeProcessor {
if (this.getAllOverlayIdentifier().contains(identifier)) {
recipeInputs.addAll(recipe.getIngredientStacks(recipeIndex));
// remove fluid
recipeInputs.removeIf(positionedStack ->
FL.getFluid(positionedStack.item, true) != null || positionedStack.item.stackSize == 0);
recipeInputs.removeIf(
positionedStack -> FL.getFluid(positionedStack.item, true) != null
|| positionedStack.item.stackSize == 0);
// try to remove machine
if (recipe instanceof NEI_RecipeMap) {
Field mRecipeMapField = ReflectionHelper.findField(NEI_RecipeMap.class, "mRecipeMap");
@@ -76,13 +81,15 @@ public class GregTech6RecipeProcessor implements IRecipeProcessor {
List<PositionedStack> recipeOutput = new ArrayList<>();
if (this.getAllOverlayIdentifier().contains(identifier)) {
recipeOutput.addAll(recipe.getOtherStacks(recipeIndex));
recipeOutput.removeIf(positionedStack ->
FL.getFluid(positionedStack.item, true) != null || positionedStack.item.stackSize == 0);
recipeOutput.removeIf(
positionedStack -> FL.getFluid(positionedStack.item, true) != null
|| positionedStack.item.stackSize == 0);
// try to remove item output if it's chance != 100%
recipeOutput.removeIf(positionedStack -> positionedStack instanceof FixedPositionedStack
&& ((FixedPositionedStack) positionedStack).mChance > 0
&& ((FixedPositionedStack) positionedStack).mChance
!= ((FixedPositionedStack) positionedStack).mMaxChance);
recipeOutput.removeIf(
positionedStack -> positionedStack instanceof FixedPositionedStack
&& ((FixedPositionedStack) positionedStack).mChance > 0
&& ((FixedPositionedStack) positionedStack).mChance
!= ((FixedPositionedStack) positionedStack).mMaxChance);
return recipeOutput;
}
return recipeOutput;
@@ -1,28 +1,32 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
import javax.annotation.Nonnull;
/**
* @author vfyjxf
*/
public class ICRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
return new HashSet<>(Arrays.asList(
"blastfurnace",
"BlockCutter",
"centrifuge",
"compressor",
"extractor",
"fluidcanner",
"macerator",
"metalformer",
"oreWashing",
"solidcanner"));
return new HashSet<>(
Arrays.asList(
"blastfurnace",
"BlockCutter",
"centrifuge",
"compressor",
"extractor",
"fluidcanner",
"macerator",
"metalformer",
"oreWashing",
"solidcanner"));
}
@Nonnull
@@ -1,12 +1,14 @@
package com.github.vfyjxf.nee.processor;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
/**
* @author vfyjxf
*/
@@ -1,30 +1,34 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
import javax.annotation.Nonnull;
/**
* @author vfyjxf
*/
public class ImmersiveEngineeringRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
return new HashSet<>(Arrays.asList(
"ieArcFurnace",
"ieBlastFurnace",
"ieBlueprintCrafting",
"ieBottlingMachine",
"ieCokeOven",
"ieCrusher",
"ieFermenter",
"ieHammerCrushing",
"ieMetalPress",
"ieRefinery",
"ieShaderBag",
"ieSqueezer"));
return new HashSet<>(
Arrays.asList(
"ieArcFurnace",
"ieBlastFurnace",
"ieBlueprintCrafting",
"ieBottlingMachine",
"ieCokeOven",
"ieCrusher",
"ieFermenter",
"ieHammerCrushing",
"ieMetalPress",
"ieRefinery",
"ieShaderBag",
"ieSqueezer"));
}
@Nonnull
@@ -39,8 +43,7 @@ public class ImmersiveEngineeringRecipeProcessor implements IRecipeProcessor {
List<PositionedStack> recipeInputs = new ArrayList<>();
if (this.getAllOverlayIdentifier().contains(identifier)) {
recipeInputs.addAll(recipe.getIngredientStacks(recipeIndex));
if (!("ieArcFurnace".equals(identifier)
|| "ieCrusher".equals(identifier)
if (!("ieArcFurnace".equals(identifier) || "ieCrusher".equals(identifier)
|| "ieBlastFurnace".equals(identifier))) {
recipeInputs.addAll(recipe.getOtherStacks(recipeIndex));
}
@@ -1,34 +1,38 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
import javax.annotation.Nonnull;
/**
* @author vfyjxf
*/
public class MekanismRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
return new HashSet<>(Arrays.asList(
"chemicalinfuser",
"chemicalinjectionchamber",
"chemicaloxidizer",
"chemicalwasher",
"combiner",
"crusher",
"electrolyticseparator",
"chamber",
"infuser",
"compressor",
"prc",
"precisionsawmill",
"purificationchamber",
"rotarycondensentrator",
"solarneutron",
"thermalevaporation"));
return new HashSet<>(
Arrays.asList(
"chemicalinfuser",
"chemicalinjectionchamber",
"chemicaloxidizer",
"chemicalwasher",
"combiner",
"crusher",
"electrolyticseparator",
"chamber",
"infuser",
"compressor",
"prc",
"precisionsawmill",
"purificationchamber",
"rotarycondensentrator",
"solarneutron",
"thermalevaporation"));
}
@Nonnull
@@ -1,9 +1,10 @@
package com.github.vfyjxf.nee.processor;
import java.util.ArrayList;
import java.util.List;
import com.github.vfyjxf.nee.NotEnoughEnergistics;
import cpw.mods.fml.common.Loader;
import java.util.ArrayList;
import java.util.List;
public class RecipeProcessor {
@@ -1,10 +1,13 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import com.djgiannuzz.thaumcraftneiplugin.items.ItemAspect;
import java.util.*;
import javax.annotation.Nonnull;
/**
* @author vfyjxf
@@ -14,12 +17,13 @@ public class TCNEIPluginRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
return new HashSet<>(Arrays.asList(
"arcaneshapedrecipes",
"arcaneshapelessrecipes",
"aspectsRecipe",
"cruciblerecipe",
"infusionCrafting"));
return new HashSet<>(
Arrays.asList(
"arcaneshapedrecipes",
"arcaneshapelessrecipes",
"aspectsRecipe",
"cruciblerecipe",
"infusionCrafting"));
}
@Nonnull
@@ -1,12 +1,14 @@
package com.github.vfyjxf.nee.processor;
import java.lang.reflect.Field;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerBase;
import cpw.mods.fml.relauncher.ReflectionHelper;
import java.lang.reflect.Field;
import java.util.*;
import javax.annotation.Nonnull;
public class ThermalExpansionRecipeProcessor implements IRecipeProcessor {
@@ -14,8 +16,8 @@ public class ThermalExpansionRecipeProcessor implements IRecipeProcessor {
static {
try {
thermalNeiRecipeBaseClass =
Class.forName("cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerBase$NEIRecipeBase");
thermalNeiRecipeBaseClass = Class
.forName("cofh.thermalexpansion.plugins.nei.handlers.RecipeHandlerBase$NEIRecipeBase");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
@@ -24,15 +26,16 @@ public class ThermalExpansionRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {
return new HashSet<>(Arrays.asList(
"thermalexpansion.charger",
"thermalexpansion.crucible",
"thermalexpansion.furnace",
"thermalexpansion.insolator",
"thermalexpansion.pulverizer",
"thermalexpansion.sawmill",
"thermalexpansion.smelter",
"thermalexpansion.transposer"));
return new HashSet<>(
Arrays.asList(
"thermalexpansion.charger",
"thermalexpansion.crucible",
"thermalexpansion.furnace",
"thermalexpansion.insolator",
"thermalexpansion.pulverizer",
"thermalexpansion.sawmill",
"thermalexpansion.smelter",
"thermalexpansion.transposer"));
}
@Nonnull
@@ -52,8 +55,8 @@ public class ThermalExpansionRecipeProcessor implements IRecipeProcessor {
Field secondaryInputField = ReflectionHelper.findField(thermalNeiRecipeBaseClass, "secondaryInput");
PositionedStack secondaryInput = null;
try {
secondaryInput = (PositionedStack)
secondaryInputField.get(((RecipeHandlerBase) recipe).arecipes.get(recipeIndex));
secondaryInput = (PositionedStack) secondaryInputField
.get(((RecipeHandlerBase) recipe).arecipes.get(recipeIndex));
} catch (IllegalAccessException e) {
e.printStackTrace();
}
@@ -76,17 +79,17 @@ public class ThermalExpansionRecipeProcessor implements IRecipeProcessor {
recipeOutputs.add(recipe.getResultStack(recipeIndex));
if (recipe instanceof RecipeHandlerBase) {
if (thermalNeiRecipeBaseClass != null) {
Field secondaryOutputField =
ReflectionHelper.findField(thermalNeiRecipeBaseClass, "secondaryOutput");
Field secondaryOutputChanceField =
ReflectionHelper.findField(thermalNeiRecipeBaseClass, "secondaryOutputChance");
Field secondaryOutputField = ReflectionHelper
.findField(thermalNeiRecipeBaseClass, "secondaryOutput");
Field secondaryOutputChanceField = ReflectionHelper
.findField(thermalNeiRecipeBaseClass, "secondaryOutputChance");
PositionedStack secondaryOutput = null;
int secondaryOutputChance = 0;
try {
secondaryOutput = (PositionedStack)
secondaryOutputField.get(((RecipeHandlerBase) recipe).arecipes.get(recipeIndex));
secondaryOutputChance = (int)
secondaryOutputChanceField.get(((RecipeHandlerBase) recipe).arecipes.get(recipeIndex));
secondaryOutput = (PositionedStack) secondaryOutputField
.get(((RecipeHandlerBase) recipe).arecipes.get(recipeIndex));
secondaryOutputChance = (int) secondaryOutputChanceField
.get(((RecipeHandlerBase) recipe).arecipes.get(recipeIndex));
} catch (IllegalAccessException e) {
e.printStackTrace();
}
@@ -1,14 +1,17 @@
package com.github.vfyjxf.nee.processor;
import java.util.*;
import javax.annotation.Nonnull;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
import javax.annotation.Nonnull;
/**
* @author vfyjxf
*/
public class VanillaRecipeProcessor implements IRecipeProcessor {
@Nonnull
@Override
public Set<String> getAllOverlayIdentifier() {