fix item size always equal 1, add more mod support
This commit is contained in:
vfyjxf committed 2021-08-14 20:39:09 +08:00
1 parent 4c2469f864
commit 949343251e
12 files changed
+178 -2

No files matched your search

@@ -75,10 +75,11 @@ public class NEECraftingHandler implements IOverlayHandler {
}
for (PositionedStack positionedStack : tInputs) {
ItemStack currentStack = positionedStack.item;
ItemStack currentStack = positionedStack.items[0];
for (ItemStack stack : positionedStack.items) {
if (Platform.isRecipePrioritized(stack) || ItemUtils.isPreferItems(stack, recipeProcessorId, identifier)) {
currentStack = stack.copy();
currentStack.stackSize = positionedStack.items[0].stackSize;
break;
}
}
@@ -0,0 +1,48 @@
package com.github.vfyjxf.nee.processor;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
/**
* @author vfyjxf
*/
public class BloodMagicRecipeProcessor implements IRecipeProcessor {
@Override
public Set<String> getAllOverlayIdentifier() {
return new HashSet<>(Arrays.asList(
"altarrecipes",
"alchemicalwizardry.alchemy",
"alchemicalwizardry.bindingritual"
));
}
@Override
public String getRecipeProcessorId() {
return "BloodMagic";
}
@Override
public List<PositionedStack> getRecipeInput(IRecipeHandler recipe, int recipeIndex, String identifier) {
for (String ident : getAllOverlayIdentifier()) {
if (ident.equals(identifier)) {
return new ArrayList<>(recipe.getIngredientStacks(recipeIndex));
}
}
return null;
}
@Override
public List<PositionedStack> getRecipeOutput(IRecipeHandler recipe, int recipeIndex, String identifier) {
for (String ident : getAllOverlayIdentifier()) {
if (ident.equals(identifier)) {
List<PositionedStack> recipeOutputs = new ArrayList<>();
recipeOutputs.add(recipe.getResultStack(recipeIndex));
return recipeOutputs;
}
}
return null;
}
}
@@ -0,0 +1,57 @@
package com.github.vfyjxf.nee.processor;
import blusunrize.immersiveengineering.client.nei.NEICrusherHandler.CachedCrusherRecipe;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import codechicken.nei.recipe.TemplateRecipeHandler;
import java.util.*;
/**
* @author vfyjxf
*/
public class ImmersiveEngineeringRecipeProcessor implements IRecipeProcessor {
@Override
public Set<String> getAllOverlayIdentifier() {
return new HashSet<>(Arrays.asList(
"ieArcFurnace", "ieBlastFurnace", "ieBlueprintCrafting",
"ieBottlingMachine", "ieCokeOven", "ieCrusher",
"ieFermenter", "ieHammerCrushing", "ieMetalPress",
"ieRefinery", "ieShaderBag", "ieSqueezer"
));
}
@Override
public String getRecipeProcessorId() {
return "ImmersiveEngineering";
}
@Override
public List<PositionedStack> getRecipeInput(IRecipeHandler recipe, int recipeIndex, String identifier) {
for (String ident : getAllOverlayIdentifier()) {
if (ident.equals(identifier)) {
List<PositionedStack> recipeInputs = new ArrayList<>(recipe.getIngredientStacks(recipeIndex));
if (!("ieArcFurnace".equals(identifier) || "ieCrusher".equals(identifier) || "ieBlastFurnace".equals(identifier))) {
recipeInputs.addAll(recipe.getOtherStacks(recipeIndex));
}
return recipeInputs;
}
}
return null;
}
@Override
public List<PositionedStack> getRecipeOutput(IRecipeHandler recipe, int recipeIndex, String identifier) {
for (String ident : getAllOverlayIdentifier()) {
if (ident.equals(identifier)) {
List<PositionedStack> recipeOutputs = new ArrayList<>();
recipeOutputs.add(recipe.getResultStack(recipeIndex));
if ("ieArcFurnace".equals(identifier) || "ieCrusher".equals(identifier)) {
recipeOutputs.addAll(recipe.getOtherStacks(recipeIndex));
}
return recipeOutputs;
}
}
return null;
}
}
@@ -0,0 +1,52 @@
package com.github.vfyjxf.nee.processor;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.*;
/**
* @author vfyjxf
*/
public class MekanismRecipeProcessor implements IRecipeProcessor {
@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"
));
}
@Override
public String getRecipeProcessorId() {
return "Mekanism";
}
@Override
public List<PositionedStack> getRecipeInput(IRecipeHandler recipe, int recipeIndex, String identifier) {
for (String ident : getAllOverlayIdentifier()) {
if (ident.equals(identifier)) {
List<PositionedStack> recipeInputs = new ArrayList<>(recipe.getIngredientStacks(recipeIndex));
if (!recipe.getOtherStacks(recipeIndex).isEmpty()) {
recipeInputs.addAll(recipe.getOtherStacks(recipeIndex));
}
return recipeInputs;
}
}
return null;
}
@Override
public List<PositionedStack> getRecipeOutput(IRecipeHandler recipe, int recipeIndex, String identifier) {
for (String ident : getAllOverlayIdentifier()) {
if (ident.equals(identifier)) {
List<PositionedStack> recipeOutputs = new ArrayList<>();
recipeOutputs.add(recipe.getResultStack(recipeIndex));
return recipeOutputs;
}
}
return null;
}
}
@@ -46,6 +46,18 @@ public class RecipeProcessor {
NotEnoughEnergistics.logger.info("Found ThermalExpansion, install ThermalExpansion support");
recipeProcessors.add(new ThermalExpansionRecipeProcessor());
}
if(Loader.isModLoaded("ImmersiveEngineering")){
NotEnoughEnergistics.logger.info("Found ImmersiveEngineering, install ImmersiveEngineering support");
recipeProcessors.add(new ImmersiveEngineeringRecipeProcessor());
}
if(Loader.isModLoaded("Mekanism")){
NotEnoughEnergistics.logger.info("Found Mekanism, install Mekanism support");
recipeProcessors.add(new MekanismRecipeProcessor());
}
if(Loader.isModLoaded("AWWayofTime")){
NotEnoughEnergistics.logger.info("Found BloodMagic, install BloodMagic support");
recipeProcessors.add(new BloodMagicRecipeProcessor());
}
if (Loader.isModLoaded("appliedenergistics2")) {
NotEnoughEnergistics.logger.info("Applied Energistics 2 will not be supported");
}