Change to Infuser for final stage of the contact process
This commit is contained in:
parent
a5e33d0158
commit
a07ca18997
10 changed files with 48 additions and 9 deletions
common/mekanism
api/gas
client/render
common
resources/assets/mekanism
|
@ -150,15 +150,22 @@ public class Gas
|
|||
}
|
||||
|
||||
/**
|
||||
* Registers a new fluid out of this Gas.
|
||||
* Registers a new fluid out of this Gas or gets one from the FluidRegistry.
|
||||
* @return this Gas object
|
||||
*/
|
||||
public Gas registerFluid()
|
||||
{
|
||||
if(fluid == null)
|
||||
{
|
||||
fluid = new Fluid(getName()).setGaseous(true);
|
||||
FluidRegistry.registerFluid(fluid);
|
||||
if(FluidRegistry.getFluid(getName()) == null)
|
||||
{
|
||||
fluid = new Fluid(getName()).setGaseous(true);
|
||||
FluidRegistry.registerFluid(fluid);
|
||||
}
|
||||
else
|
||||
{
|
||||
fluid = FluidRegistry.getFluid(getName());
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
|
|
|
@ -9,6 +9,7 @@ import mekanism.common.ISpecialBounds;
|
|||
import mekanism.common.ObfuscatedNames;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFluid;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
|
@ -66,6 +67,7 @@ public class MekanismRenderer
|
|||
|
||||
GasRegistry.getGas("hydrogen").setIcon(event.map.registerIcon("mekanism:LiquidHydrogen"));
|
||||
GasRegistry.getGas("oxygen").setIcon(event.map.registerIcon("mekanism:LiquidOxygen"));
|
||||
GasRegistry.getGas("water").setIcon(event.map.registerIcon("mekanism:WaterVapor"));
|
||||
GasRegistry.getGas("sulfurDioxideGas").setIcon(event.map.registerIcon("mekanism:LiquidSulfurDioxide"));
|
||||
GasRegistry.getGas("sulfurTrioxideGas").setIcon(event.map.registerIcon("mekanism:LiquidSulfurTrioxide"));
|
||||
GasRegistry.getGas("sulfuricAcid").setIcon(event.map.registerIcon("mekanism:LiquidSulfuricAcid"));
|
||||
|
|
|
@ -634,10 +634,8 @@ public class Mekanism
|
|||
|
||||
//Chemical Infuser Recipes
|
||||
RecipeHandler.addChemicalInfuserRecipe(new ChemicalInput(new GasStack(GasRegistry.getGas("oxygen"), 1), new GasStack(GasRegistry.getGas("sulfurDioxideGas"), 2)), new GasStack(GasRegistry.getGas("sulfurTrioxideGas"), 2));
|
||||
RecipeHandler.addChemicalInfuserRecipe(new ChemicalInput(new GasStack(GasRegistry.getGas("sulfurTrioxideGas"), 1), new GasStack(GasRegistry.getGas("water"), 1)), new GasStack(GasRegistry.getGas("sulfuricAcid"), 1));
|
||||
|
||||
//Chemical Combiner Recipes
|
||||
RecipeHandler.addChemicalCombinerRecipe(new ChemicalCombinerInput(new GasStack(GasRegistry.getGas("sulfurTrioxideGas"), 1), new FluidStack(FluidRegistry.getFluid("water"), 1)), new GasStack(GasRegistry.getGas("sulfuricAcid"), 1));
|
||||
|
||||
//Infuse objects
|
||||
InfuseRegistry.registerInfuseObject(new ItemStack(Item.coal, 1, 0), new InfuseObject(InfuseRegistry.get("CARBON"), 10));
|
||||
InfuseRegistry.registerInfuseObject(new ItemStack(Item.coal, 1, 1), new InfuseObject(InfuseRegistry.get("CARBON"), 20));
|
||||
|
@ -963,6 +961,7 @@ public class Mekanism
|
|||
|
||||
GasRegistry.register(new Gas("hydrogen")).registerFluid();
|
||||
GasRegistry.register(new Gas("oxygen")).registerFluid();
|
||||
GasRegistry.register(new Gas("water")).registerFluid();
|
||||
GasRegistry.register(new Gas("sulfurDioxideGas")).registerFluid();
|
||||
GasRegistry.register(new Gas("sulfurTrioxideGas")).registerFluid();
|
||||
GasRegistry.register(new Gas("sulfuricAcid")).registerFluid();
|
||||
|
|
|
@ -287,6 +287,30 @@ public final class RecipeHandler
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the output ItemStack of the ItemStack in the parameters.
|
||||
* @param itemstack - input ItemStack
|
||||
* @param recipes - Map of recipes
|
||||
* @return whether the item can be used in a recipe
|
||||
*/
|
||||
public static boolean isInRecipe(ItemStack itemstack, Map<ItemStack, ItemStack> recipes)
|
||||
{
|
||||
if(itemstack != null)
|
||||
{
|
||||
for(Map.Entry entry : recipes.entrySet())
|
||||
{
|
||||
ItemStack stack = (ItemStack)entry.getKey();
|
||||
|
||||
if(StackUtils.equalsWildcard(stack, itemstack))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static enum Recipe
|
||||
{
|
||||
ENRICHMENT_CHAMBER(new HashMap<ItemStack, ItemStack>()),
|
||||
|
|
|
@ -22,7 +22,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
*
|
||||
* @param soundPath - location of the sound effect
|
||||
* @param name - full name of this machine
|
||||
* @param path - GUI texture path of this machine
|
||||
* @param location - GUI texture path of this machine
|
||||
* @param perTick - energy used per tick.
|
||||
* @param ticksRequired - ticks required to operate -- or smelt an item.
|
||||
* @param maxEnergy - maximum energy this machine can hold.
|
||||
|
@ -100,7 +100,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
}
|
||||
else if(slotID == 0)
|
||||
{
|
||||
return RecipeHandler.getOutput(itemstack, false, getRecipes()) != null;
|
||||
return RecipeHandler.isInRecipe(itemstack, getRecipes());
|
||||
}
|
||||
else if(slotID == 1)
|
||||
{
|
||||
|
|
|
@ -508,7 +508,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
|||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
return mode == 1 && from == MekanismUtils.getRight(facing) && (fluidTank.getFluid() == null && isValidFluid(new FluidStack(fluid, 1)) || fluidTank.getFluid().getFluid() == fluid);
|
||||
return mode == 1 && from == MekanismUtils.getRight(facing) && (fluidTank.getFluid() == null ? isValidFluid(new FluidStack(fluid, 1)) : fluidTank.getFluid().getFluid() == fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,6 +3,7 @@ tile.Transmitter.PressurizedTube.name=Pressurised Tube
|
|||
tile.MachineBlock2.ChemicalOxidizer=Chemical Oxidiser
|
||||
item.MultipartTransmitter.PressurizedTube.name=Pressurised Tube
|
||||
item.sulfurDust.name=Sulphur Dust
|
||||
gas.water=Water Vapour
|
||||
gas.sulfurDioxideGas=Sulphur Dioxide
|
||||
gas.sulfurTrioxideGas=Sulphur Trioxide
|
||||
gas.sulfuricAcid=Sulphuric Acid
|
||||
|
|
|
@ -152,6 +152,7 @@ item.tinIngot.name=Tin Ingot
|
|||
//Gasses
|
||||
gas.hydrogen=Hydrogen
|
||||
gas.oxygen=Oxygen
|
||||
gas.water=Water Vapor
|
||||
gas.sulfurDioxideGas=Sulfur Dioxide
|
||||
gas.sulfurTrioxideGas=Sulfur Trioxide
|
||||
gas.sulfuricAcid=Sulfuric Acid
|
||||
|
|
BIN
resources/assets/mekanism/textures/blocks/WaterVapor.png
Normal file
BIN
resources/assets/mekanism/textures/blocks/WaterVapor.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 9.6 KiB |
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"animation": {
|
||||
"frametime": 2
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue