mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Merge branch 'v9' into 1.8.9
Forgot to complete the merge so some weird stuff might have ended up in the patch. Oops.
This commit is contained in:
commit
25d0b7441b
35 files changed
+439
-256
No files matched your search
@@ -5,15 +5,16 @@ import java.util.Map;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.util.StackUtils;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.InfuseStorage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.inputs.InfusionInput;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
import mekanism.common.recipe.machines.BasicMachineRecipe;
|
||||
import mekanism.common.recipe.machines.MachineRecipe;
|
||||
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
|
||||
import mekanism.common.tile.TileEntityAdvancedElectricMachine;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -21,6 +22,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import static mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
|
||||
/**
|
||||
* Internal interface for managing various Factory types.
|
||||
* @author AidanBrady
|
||||
@@ -44,13 +47,14 @@ public interface IFactory
|
||||
|
||||
public static enum RecipeType
|
||||
{
|
||||
SMELTING("Smelting", "smelter", BlockStateMachine.MachineType.ENERGIZED_SMELTER.getStack(), false, false, Recipe.ENERGIZED_SMELTER),
|
||||
ENRICHING("Enriching", "enrichment", BlockStateMachine.MachineType.ENRICHMENT_CHAMBER.getStack(), false, false, Recipe.ENRICHMENT_CHAMBER),
|
||||
CRUSHING("Crushing", "crusher", BlockStateMachine.MachineType.CRUSHER.getStack(), false, false, Recipe.CRUSHER),
|
||||
COMPRESSING("Compressing", "compressor", BlockStateMachine.MachineType.OSMIUM_COMPRESSOR.getStack(), true, false, Recipe.OSMIUM_COMPRESSOR),
|
||||
COMBINING("Combining", "combiner", BlockStateMachine.MachineType.COMBINER.getStack(), true, false, Recipe.COMBINER),
|
||||
PURIFYING("Purifying", "purifier", BlockStateMachine.MachineType.PURIFICATION_CHAMBER.getStack(), true, true, Recipe.PURIFICATION_CHAMBER),
|
||||
INJECTING("Injecting", "injection", BlockStateMachine.MachineType.CHEMICAL_INJECTION_CHAMBER.getStack(), true, true, Recipe.CHEMICAL_INJECTION_CHAMBER);
|
||||
SMELTING("Smelting", "smelter", MachineType.ENERGIZED_SMELTER.getStack(), false, false, Recipe.ENERGIZED_SMELTER),
|
||||
ENRICHING("Enriching", "enrichment", MachineType.ENRICHMENT_CHAMBER.getStack(), false, false, Recipe.ENRICHMENT_CHAMBER),
|
||||
CRUSHING("Crushing", "crusher", MachineType.CRUSHER.getStack(), false, false, Recipe.CRUSHER),
|
||||
COMPRESSING("Compressing", "compressor", MachineType.OSMIUM_COMPRESSOR.getStack(), true, false, Recipe.OSMIUM_COMPRESSOR),
|
||||
COMBINING("Combining", "combiner", MachineType.COMBINER.getStack(), true, false, Recipe.COMBINER),
|
||||
PURIFYING("Purifying", "purifier", MachineType.PURIFICATION_CHAMBER.getStack(), true, true, Recipe.PURIFICATION_CHAMBER),
|
||||
INJECTING("Injecting", "injection", MachineType.CHEMICAL_INJECTION_CHAMBER.getStack(), true, true, Recipe.CHEMICAL_INJECTION_CHAMBER),
|
||||
INFUSING("Infusing", "metalinfuser", MachineType.METALLURGIC_INFUSER.getStack(), false, false, Recipe.METALLURGIC_INFUSER);
|
||||
|
||||
private String name;
|
||||
private ResourceLocation sound;
|
||||
@@ -79,13 +83,27 @@ public interface IFactory
|
||||
{
|
||||
return getRecipe(new AdvancedMachineInput(input, gas));
|
||||
}
|
||||
|
||||
public MetallurgicInfuserRecipe getRecipe(InfusionInput input)
|
||||
{
|
||||
return RecipeHandler.getMetallurgicInfuserRecipe(input);
|
||||
}
|
||||
|
||||
public MetallurgicInfuserRecipe getRecipe(ItemStack input, InfuseStorage storage)
|
||||
{
|
||||
return getRecipe(new InfusionInput(storage, input));
|
||||
}
|
||||
|
||||
public MachineRecipe getAnyRecipe(ItemStack slotStack, Gas gasType)
|
||||
public MachineRecipe getAnyRecipe(ItemStack slotStack, Gas gasType, InfuseStorage infuse)
|
||||
{
|
||||
if(usesFuel())
|
||||
{
|
||||
return getRecipe(slotStack, gasType);
|
||||
}
|
||||
else if(this == INFUSING)
|
||||
{
|
||||
return getRecipe(slotStack, infuse);
|
||||
}
|
||||
|
||||
return getRecipe(slotStack);
|
||||
}
|
||||
@@ -169,7 +187,7 @@ public interface IFactory
|
||||
{
|
||||
if(cacheTile == null)
|
||||
{
|
||||
MachineType type = BlockStateMachine.MachineType.get(Block.getBlockFromItem(getStack().getItem()), getStack().getItemDamage());
|
||||
MachineType type = MachineType.get(Block.getBlockFromItem(getStack().getItem()), getStack().getItemDamage());
|
||||
cacheTile = (TileEntityAdvancedElectricMachine)type.create();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user