Add wildcard support to more recipes

Added wildcard for:
- AdvancedmachineInput
- InfusionInput
- PressurizedInput
This commit is contained in:
Tom Elfring committed 2017-08-23 19:25:39 +02:00
1 parent 077d6fe34e
commit 9efd716ea0
4 files changed
+36

No files matched your search

@@ -287,6 +287,12 @@ public final class RecipeHandler
HashMap<InfusionInput, MetallurgicInfuserRecipe> recipes = Recipe.METALLURGIC_INFUSER.get();
MetallurgicInfuserRecipe recipe = recipes.get(input);
if(recipe == null)
{
recipe = recipes.get(input.wildCopy());
}
return recipe == null ? null : recipe.copy();
}
@@ -427,6 +433,12 @@ public final class RecipeHandler
if(input.isValid())
{
RECIPE recipe = recipes.get(input);
if(recipe == null)
{
recipe = recipes.get(input.wildCopy());
}
return recipe == null ? null : recipe.copy();
}
@@ -484,6 +496,12 @@ public final class RecipeHandler
HashMap<PressurizedInput, PressurizedRecipe> recipes = Recipe.PRESSURIZED_REACTION_CHAMBER.get();
PressurizedRecipe recipe = recipes.get(input);
if(recipe == null)
{
recipe = recipes.get(input.wildCopy());
}
return recipe == null ? null : recipe.copy();
}
@@ -7,6 +7,7 @@ import mekanism.common.util.StackUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraftforge.oredict.OreDictionary;
public class AdvancedMachineInput extends MachineInput<AdvancedMachineInput>
{
@@ -94,4 +95,9 @@ public class AdvancedMachineInput extends MachineInput<AdvancedMachineInput>
{
return other instanceof AdvancedMachineInput;
}
public AdvancedMachineInput wildCopy()
{
return new AdvancedMachineInput(new ItemStack(itemStack.getItem(), itemStack.getCount(), OreDictionary.WILDCARD_VALUE), gasType);
}
}
@@ -8,6 +8,7 @@ import mekanism.common.util.StackUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraftforge.oredict.OreDictionary;
/**
* An infusion input, containing the type of and amount of infuse the operation requires, as well as the input ItemStack.
@@ -94,4 +95,9 @@ public class InfusionInput extends MachineInput<InfusionInput>
{
return other instanceof InfusionInput;
}
public InfusionInput wildCopy()
{
return new InfusionInput(infuse, new ItemStack(inputStack.getItem(), inputStack.getCount(), OreDictionary.WILDCARD_VALUE));
}
}
@@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.oredict.OreDictionary;
/**
* An input of a gas, a fluid and an item for the pressurized reaction chamber
@@ -165,4 +166,9 @@ public class PressurizedInput extends MachineInput<PressurizedInput>
{
return other instanceof PressurizedInput;
}
public PressurizedInput wildCopy()
{
return new PressurizedInput(new ItemStack(theSolid.getItem(), theSolid.getCount(), OreDictionary.WILDCARD_VALUE), theFluid, theGas);
}
}