use of minechem.item.element.ElementEnum in project Minechem by iopleke.
the class MinechemRecipes method registerFluidRecipes.
public void registerFluidRecipes() {
// Quick and dirty fix for the Thermal Expansion Resonant Ender 6x bug
int threeQuarterFluidPerIngot = 180;
DecomposerRecipe.add(new DecomposerFluidRecipe(new FluidStack(FluidRegistry.WATER, BUCKET_AMOUNT), new PotionChemical[] { this.element(ElementEnum.H, 2), this.element(ElementEnum.O) }));
// Lava
// This assumes lava is composed from cobblestone at a 4:1 ratio
// as well as having slightly higher purity
DecomposerRecipe.add(new DecomposerFluidRecipeSelect("lava", BUCKET_AMOUNT / 4, 0.2F, new DecomposerRecipe[] { new DecomposerRecipe(new PotionChemical[] { this.element(ElementEnum.Si), this.element(ElementEnum.O) }), new DecomposerRecipe(new PotionChemical[] { this.element(ElementEnum.Fe), this.element(ElementEnum.O) }), new DecomposerRecipe(new PotionChemical[] { this.element(ElementEnum.Mg), this.element(ElementEnum.O) }), new DecomposerRecipe(new PotionChemical[] { this.element(ElementEnum.Ti), this.element(ElementEnum.O) }), new DecomposerRecipe(new PotionChemical[] { this.element(ElementEnum.Pb), this.element(ElementEnum.O) }), new DecomposerRecipe(new PotionChemical[] { this.element(ElementEnum.Na), this.element(ElementEnum.Cl) }) }));
// Mod fluids
// Checks if the fluid exists
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("water", BUCKET_AMOUNT, new PotionChemical[] { this.element(ElementEnum.H, 2), this.element(ElementEnum.O) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("iron.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Fe, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("gold.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Au, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("copper.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Cu, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("tin.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Sn, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("aluminum.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Al, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("cobalt.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Co, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("ardite.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Fe, 2), this.element(ElementEnum.W, 2), this.element(ElementEnum.Si, 2) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("bronze.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Cu, 12), this.element(ElementEnum.Sn, 4) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("aluminumbrass.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Cu, 12), this.element(ElementEnum.Al, 4) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("manyullyn.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Co, 8), this.element(ElementEnum.Fe, 1), this.element(ElementEnum.W, 1), this.element(ElementEnum.Si, 1) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("alumite.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Al, 8), this.element(ElementEnum.Fe, 3), this.molecule(MoleculeEnum.siliconDioxide, 2), this.molecule(MoleculeEnum.magnesiumOxide, 1) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("obsidian.molten", INGOT_AMOUNT, new PotionChemical[] { this.molecule(MoleculeEnum.siliconDioxide, 16), this.molecule(MoleculeEnum.magnesiumOxide, 8) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("steel.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Fe, 14), this.element(ElementEnum.C, 2) });
// This ratio should be tested
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("stone.seared", INGOT_AMOUNT, new PotionChemical[] { this.molecule(MoleculeEnum.siliconOxide, 12), this.molecule(MoleculeEnum.ironOxide, 4) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("glass.molten", INGOT_AMOUNT, new PotionChemical[] { this.molecule(MoleculeEnum.siliconDioxide, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("emerald.molten", INGOT_AMOUNT, new PotionChemical[] { this.molecule(MoleculeEnum.beryl, 6), this.element(ElementEnum.Cr, 6), this.element(ElementEnum.V, 6) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("blood.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.O, 6), this.element(ElementEnum.Fe, 2), this.molecule(MoleculeEnum.ironOxide, 8) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("nickel.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Ni, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("lead.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Pb, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("silver.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Ag, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("platinum.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Pt, 16) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("invar.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Fe, 10), this.element(ElementEnum.Ni, 6) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("electrum.molten", INGOT_AMOUNT, new PotionChemical[] { this.element(ElementEnum.Ag, 8), this.element(ElementEnum.Au, 8) });
DecomposerFluidRecipe.createAndAddFluidRecipeSafely("ender", threeQuarterFluidPerIngot, new PotionChemical[] { this.molecule(MoleculeEnum.calciumCarbonate), this.molecule(MoleculeEnum.calciumCarbonate), this.molecule(MoleculeEnum.calciumCarbonate), this.molecule(MoleculeEnum.calciumCarbonate), this.element(ElementEnum.Es), this.molecule(MoleculeEnum.calciumCarbonate), this.molecule(MoleculeEnum.calciumCarbonate), this.molecule(MoleculeEnum.calciumCarbonate), this.molecule(MoleculeEnum.calciumCarbonate) });
registerMFRFluidRecipes();
if (Settings.decomposeChemicalFluids) {
for (ElementEnum element : FluidHelper.elements.keySet()) {
DecomposerFluidRecipe.add(new DecomposerFluidRecipe(new FluidStack(FluidHelper.elements.get(element), 125), new Element(element, 1)));
}
for (MoleculeEnum molecule : FluidHelper.molecules.keySet()) {
DecomposerFluidRecipe.add(new DecomposerFluidRecipe(new FluidStack(FluidHelper.molecules.get(molecule), 125), molecule.componentsArray()));
}
}
}
use of minechem.item.element.ElementEnum in project Minechem by iopleke.
the class MinechemItemsRegistration method registerFluidContainers.
public static void registerFluidContainers() {
for (ElementEnum element : ElementEnum.elements.values()) {
if (element != null) {
ItemStack tube = new ItemStack(MinechemItemsRegistration.element, 1, element.atomicNumber());
FluidContainerRegistry.registerFluidContainer(new FluidStack(FluidHelper.elements.get(element), 125), tube, emptyTube);
}
}
for (MoleculeEnum molecule : MoleculeEnum.molecules.values()) {
if (molecule != null) {
ItemStack tube = new ItemStack(MinechemItemsRegistration.molecule, 1, molecule.id());
FluidStack fluidStack = new FluidStack(FluidRegistry.WATER, 125);
if (!molecule.name().equals("water")) {
fluidStack = new FluidStack(FluidHelper.molecules.get(molecule), 125);
}
FluidContainerRegistry.registerFluidContainer(fluidStack, tube, emptyTube);
}
}
}
use of minechem.item.element.ElementEnum in project Minechem by iopleke.
the class MinechemItemsRegistration method registerToOreDictionary.
public static void registerToOreDictionary() {
for (ElementEnum element : ElementEnum.elements.values()) {
OreDictionary.registerOre("element_" + element.name(), new ItemStack(MinechemItemsRegistration.element, 1, element.atomicNumber()));
}
for (MoleculeEnum molecule : MoleculeEnum.molecules.values()) {
OreDictionary.registerOre("molecule_" + molecule.name(), new ItemStack(MinechemItemsRegistration.molecule, 1, molecule.id()));
}
OreDictionary.registerOre("dustSaltpeter", new ItemStack(MinechemItemsRegistration.molecule, 1, MoleculeEnum.potassiumNitrate.id()));
OreDictionary.registerOre("dustSalt", new ItemStack(MinechemItemsRegistration.molecule, 1, MoleculeEnum.salt.id()));
OreDictionary.registerOre("quicksilver", new ItemStack(MinechemItemsRegistration.element, 1, ElementEnum.Hg.atomicNumber()));
}
use of minechem.item.element.ElementEnum in project Minechem by iopleke.
the class RadiationHandler method decayElement.
private int decayElement(ItemStack element, RadiationInfo radiationInfo, long currentTime, World world, IInventory inventory, double x, double y, double z) {
if (element.stackSize == 0) {
radiationInfo.decayStarted += currentTime - radiationInfo.lastDecayUpdate;
radiationInfo.lastDecayUpdate = currentTime;
RadiationInfo.setRadiationInfo(radiationInfo, element);
return 0;
}
radiationInfo.lastDecayUpdate = currentTime;
long lifeTime = currentTime - radiationInfo.decayStarted - radiationInfo.radioactivity.getLife();
if (lifeTime > 0) {
int damage = radiationInfo.radioactivity.getDamage() * element.stackSize;
Item item = element.getItem();
if (item == MinechemItemsRegistration.element) {
radiationInfo = ElementItem.decay(element, world);
} else if (item == MinechemItemsRegistration.molecule) {
radiationInfo = RadiationMoleculeHandler.getInstance().handleRadiationMolecule(world, element, inventory, x, y, z);
} else if (item instanceof MinechemBucketItem) {
MinechemChemicalType type = ((MinechemBucketItem) item).chemical;
if (type instanceof ElementEnum) {
element.func_150996_a(MinechemBucketHandler.getInstance().buckets.get(FluidHelper.elementsBlocks.get(FluidHelper.elements.get(ElementEnum.getByID(((ElementEnum) type).atomicNumber())))));
radiationInfo = ElementItem.initiateRadioactivity(element, world);
} else {
radiationInfo = RadiationMoleculeHandler.getInstance().handleRadiationMoleculeBucket(world, element, inventory, x, y, z);
}
}
RadiationInfo.setRadiationInfo(radiationInfo, element);
return damage;
}
RadiationInfo.setRadiationInfo(radiationInfo, element);
return 0;
}
use of minechem.item.element.ElementEnum in project Minechem by iopleke.
the class RadiationInfo method getRadioactivity.
public static RadiationEnum getRadioactivity(ItemStack itemstack) {
int id = itemstack.getItemDamage();
Item item = itemstack.getItem();
if (item == MinechemItemsRegistration.element) {
ElementEnum element = ElementEnum.getByID(id);
return id != 0 && element != null ? element.radioactivity() : RadiationEnum.stable;
} else if (item == MinechemItemsRegistration.molecule) {
if (id >= MoleculeEnum.molecules.size() || MoleculeEnum.molecules.get(id) == null) {
return RadiationEnum.stable;
}
return MoleculeEnum.molecules.get(id).radioactivity();
} else if (item instanceof MinechemBucketItem) {
return ((MinechemBucketItem) item).chemical.radioactivity();
}
return RadiationEnum.stable;
}
Aggregations