Work on stuff
This commit is contained in:
parent
11aa04a5df
commit
2d5b633168
9 changed files with 53 additions and 8 deletions
common/mekanism
api
client/render
common
resources/assets/mekanism/lang
|
@ -1,6 +1,5 @@
|
|||
package mekanism.common;
|
||||
package mekanism.api;
|
||||
|
||||
import mekanism.api.Object3D;
|
||||
import mekanism.api.gas.Gas;
|
||||
|
||||
public class ChemicalInput
|
|
@ -2,6 +2,7 @@ package mekanism.api;
|
|||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.infuse.InfusionInput;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
@ -92,6 +93,38 @@ public final class RecipeHelper
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Chemical Formulator recipe.
|
||||
* @param input - input ItemStack
|
||||
* @param output - output GasStack
|
||||
*/
|
||||
public static void addChemicalFormulatorRecipe(ItemStack input, GasStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addChemicalFormulatorRecipe", ItemStack.class, GasStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Chemical Infuser recipe.
|
||||
* @param input - input ChemicalInput
|
||||
* @param output - output GasStack
|
||||
*/
|
||||
public static void addChemicalInfuserRecipe(ChemicalInput input, GasStack output)
|
||||
{
|
||||
try {
|
||||
Class recipeClass = Class.forName("mekanism.common.RecipeHandler");
|
||||
Method m = recipeClass.getMethod("addChemicalInfuserRecipe", ChemicalInput.class, GasStack.class);
|
||||
m.invoke(null, input, output);
|
||||
} catch(Exception e) {
|
||||
System.err.println("[Mekanism] Error while adding recipe: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Metallurgic Infuser recipe.
|
||||
* @param input - input Infusion
|
||||
|
|
|
@ -58,7 +58,7 @@ public class GasRegistry
|
|||
{
|
||||
for(Gas gas : registeredGasses)
|
||||
{
|
||||
if(gas.getName().equals(name.toLowerCase()))
|
||||
if(gas.getName().toLowerCase().equals(name.toLowerCase()))
|
||||
{
|
||||
return gas;
|
||||
}
|
||||
|
|
|
@ -66,6 +66,8 @@ public class MekanismRenderer
|
|||
|
||||
GasRegistry.getGas("hydrogen").setIcon(event.map.registerIcon("mekanism:LiquidHydrogen"));
|
||||
GasRegistry.getGas("oxygen").setIcon(event.map.registerIcon("mekanism:LiquidOxygen"));
|
||||
GasRegistry.getGas("sulfuricGas").setIcon(event.map.registerIcon("mekanism:LiquidSulfuricGas"));
|
||||
GasRegistry.getGas("sulfuricAcid").setIcon(event.map.registerIcon("mekanism:LiquidSulfuricAcid"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,12 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import mekanism.api.ChemicalInput;
|
||||
import mekanism.api.Object3D;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasNetwork.GasTransferEvent;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.infuse.InfuseObject;
|
||||
import mekanism.api.infuse.InfuseRegistry;
|
||||
import mekanism.api.infuse.InfuseType;
|
||||
|
@ -559,6 +561,12 @@ public class Mekanism
|
|||
RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("BIO"), 10, new ItemStack(Block.stoneBrick, 1, 0)), new ItemStack(Block.stoneBrick, 1, 1));
|
||||
}
|
||||
|
||||
//Chemical Formulator Recipes
|
||||
RecipeHandler.addChemicalFormulatorRecipe(new ItemStack(Item.gunpowder), new GasStack(GasRegistry.getGas("sulfuricGas"), 100));
|
||||
|
||||
//Chemical Infuser Recipes
|
||||
RecipeHandler.addChemicalInfuserRecipe(new ChemicalInput(GasRegistry.getGas("hydrogen"), GasRegistry.getGas("sulfuricGas")), 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));
|
||||
|
@ -1169,6 +1177,8 @@ public class Mekanism
|
|||
|
||||
GasRegistry.register(new Gas("hydrogen")).registerFluid();
|
||||
GasRegistry.register(new Gas("oxygen")).registerFluid();
|
||||
GasRegistry.register(new Gas("sulfuricGas")).registerFluid();
|
||||
GasRegistry.register(new Gas("sulfuricAcid")).registerFluid();
|
||||
|
||||
Mekanism.proxy.preInit();
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package mekanism.common;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.ChemicalInput;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.infuse.InfusionInput;
|
||||
import mekanism.api.infuse.InfusionOutput;
|
||||
|
|
|
@ -2,6 +2,7 @@ package mekanism.common.tileentity;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.api.ChemicalInput;
|
||||
import mekanism.api.Object3D;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
|
@ -11,7 +12,6 @@ import mekanism.api.gas.GasTransmission;
|
|||
import mekanism.api.gas.IGasHandler;
|
||||
import mekanism.api.gas.IGasItem;
|
||||
import mekanism.api.gas.ITubeConnection;
|
||||
import mekanism.common.ChemicalInput;
|
||||
import mekanism.common.IActiveState;
|
||||
import mekanism.common.IRedstoneControl;
|
||||
import mekanism.common.Mekanism;
|
||||
|
|
|
@ -226,7 +226,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
|||
}
|
||||
}
|
||||
|
||||
if(getEnergy() >= ENERGY_USAGE && MekanismUtils.canFunction(this) && isValidFluid(fluidTank.getFluid()) && (gasTank == null || (gasTank.getStored() < MAX_GAS && gasEquals(gasTank.getGas(), fluidTank.getFluid()))))
|
||||
if(getEnergy() >= ENERGY_USAGE && MekanismUtils.canFunction(this) && isValidFluid(fluidTank.getFluid()) && (gasTank.getGas() == null || (gasTank.getStored() < MAX_GAS && gasEquals(gasTank.getGas(), fluidTank.getFluid()))))
|
||||
{
|
||||
setActive(true);
|
||||
gasTank.receive(new GasStack(GasRegistry.getGas(fluidTank.getFluid().getFluid()), 1), true);
|
||||
|
@ -507,7 +507,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
|||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
return mode == 1 && from == MekanismUtils.getRight(facing);
|
||||
return mode == 1 && from == MekanismUtils.getRight(facing) && (fluidTank.getFluid() == null && isValidFluid(new FluidStack(fluid, 1)) || fluidTank.getFluid().getFluid() == fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -138,8 +138,8 @@ gas.sulfuricAcid=Sulfuric Acid
|
|||
//Fluids
|
||||
fluid.hydrogen=Liquid Hydrogen
|
||||
fluid.oxygen=Liquid Oxygen
|
||||
fluid.sulfuricGas=Sulfuric Gas
|
||||
fluid.sulfuricAcid=Sulfuric Acid
|
||||
fluid.sulfuricGas=Liquid Sulfuric Gas
|
||||
fluid.sulfuricAcid=Liquid Sulfuric Acid
|
||||
|
||||
//Gui text
|
||||
gui.removeSpeedUpgrade=Remove speed upgrade
|
||||
|
|
Loading…
Add table
Reference in a new issue