mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 03:25:07 +00:00
Add Isolator JEI recipes
This commit is contained in:
1 parent
b6191ab4b0
commit
f082500fc0
14 files changed
+258
-50
No files matched your search
@@ -83,7 +83,7 @@ public class FlowerRoot extends SpeciesRoot implements IFlowerRoot {
|
||||
|
||||
@Override
|
||||
public ISpeciesType getIconType() {
|
||||
return null;
|
||||
return EnumFlowerStage.FLOWER;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.core.integration.jei;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -17,21 +18,17 @@ public class Drawables {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static final ResourceLocation guiTank = new ResourceLocation("binniecore:textures/gui/craftgui-slots.png");
|
||||
@Nonnull
|
||||
public static final ResourceLocation guiArrow = new ResourceLocation("binniecore:textures/gui/craftgui-panels.png");
|
||||
|
||||
@Nonnull
|
||||
private final IGuiHelper guiHelper;
|
||||
private final IDrawable tank;
|
||||
@Nonnull
|
||||
private final IDrawable tankOverlay;
|
||||
@Nonnull
|
||||
private final IDrawable arrow;
|
||||
@Nonnull
|
||||
private final IDrawableStatic arrowWhite;
|
||||
|
||||
private Drawables(IGuiHelper guiHelper) {
|
||||
this.guiHelper = guiHelper;
|
||||
this.tank = guiHelper.createDrawable(guiTank, 8, 28, 18, 60);
|
||||
this.tankOverlay = guiHelper.createDrawable(guiTank, 33, 29, 16, 58);
|
||||
this.arrow = guiHelper.createDrawable(guiArrow, 191, 79, 14, 10);
|
||||
@@ -57,4 +54,8 @@ public class Drawables {
|
||||
public IDrawableStatic getArrowWhite() {
|
||||
return arrowWhite;
|
||||
}
|
||||
|
||||
public IDrawableAnimated createArrowAnimated(int ticksPerCycle) {
|
||||
return guiHelper.createAnimatedDrawable(arrowWhite, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package binnie.core.integration.jei;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
@@ -12,6 +12,7 @@ import binnie.genetics.core.GeneticsGUI;
|
||||
import binnie.genetics.core.GeneticsPacket;
|
||||
import binnie.genetics.item.ItemAnalyst;
|
||||
import binnie.genetics.item.ItemDatabase;
|
||||
import binnie.genetics.item.ItemSequence;
|
||||
import binnie.genetics.item.ItemSerumArray;
|
||||
import binnie.genetics.item.ModuleItem;
|
||||
import binnie.genetics.machine.ModuleMachine;
|
||||
@@ -35,7 +36,7 @@ public class Genetics extends AbstractMod {
|
||||
public static String channel = "GEN";
|
||||
public static Item itemGenetics;
|
||||
public static Item itemSerum;
|
||||
public static Item itemSequencer;
|
||||
public static ItemSequence itemSequencer;
|
||||
public static MachineGroup packageGenetic;
|
||||
public static MachineGroup packageAdvGenetic;
|
||||
public static MachineGroup packageLabMachine;
|
||||
|
||||
@@ -6,6 +6,10 @@ import binnie.genetics.integration.jei.incubator.IncubatorRecipeHandler;
|
||||
import binnie.genetics.integration.jei.incubator.LarvaeIncubatorRecipeCategory;
|
||||
import binnie.genetics.integration.jei.incubator.LarvaeIncubatorRecipeHandler;
|
||||
import binnie.genetics.integration.jei.incubator.LarvaeIncubatorRecipeMaker;
|
||||
import binnie.genetics.integration.jei.isolator.IsolatorRecipeCategory;
|
||||
import binnie.genetics.integration.jei.isolator.IsolatorRecipeHandler;
|
||||
import binnie.genetics.integration.jei.isolator.IsolatorRecipeMaker;
|
||||
import binnie.genetics.machine.GeneticMachine;
|
||||
import binnie.genetics.machine.LaboratoryMachine;
|
||||
import binnie.genetics.machine.incubator.Incubator;
|
||||
import mezz.jei.api.BlankModPlugin;
|
||||
@@ -28,17 +32,21 @@ public class GeneticsJeiPlugin extends BlankModPlugin {
|
||||
|
||||
registry.addRecipeCategories(
|
||||
new IncubatorRecipeCategory(),
|
||||
new LarvaeIncubatorRecipeCategory()
|
||||
new LarvaeIncubatorRecipeCategory(),
|
||||
new IsolatorRecipeCategory()
|
||||
);
|
||||
|
||||
registry.addRecipeHandlers(
|
||||
new IncubatorRecipeHandler(),
|
||||
new LarvaeIncubatorRecipeHandler()
|
||||
new LarvaeIncubatorRecipeHandler(),
|
||||
new IsolatorRecipeHandler()
|
||||
);
|
||||
|
||||
registry.addRecipeCategoryCraftingItem(LaboratoryMachine.Incubator.get(1), RecipeUids.INCUBATOR, RecipeUids.INCUBATOR_LARVAE);
|
||||
registry.addRecipeCategoryCraftingItem(GeneticMachine.Isolator.get(1), RecipeUids.ISOLATOR);
|
||||
|
||||
registry.addRecipes(Incubator.getRecipes());
|
||||
registry.addRecipes(LarvaeIncubatorRecipeMaker.create(Incubator.getLarvaeRecipe()));
|
||||
registry.addRecipes(IsolatorRecipeMaker.create());
|
||||
}
|
||||
}
|
||||
@@ -3,4 +3,5 @@ package binnie.genetics.integration.jei;
|
||||
public class RecipeUids {
|
||||
public static final String INCUBATOR = "binnie.genetics.incubator";
|
||||
public static final String INCUBATOR_LARVAE = "binnie.genetics.incubator.bees";
|
||||
public static final String ISOLATOR = "binnie.genetics.isolator";
|
||||
}
|
||||
+2
-11
@@ -3,11 +3,8 @@ package binnie.genetics.integration.jei.incubator;
|
||||
import binnie.genetics.integration.jei.GeneticsJeiPlugin;
|
||||
import binnie.genetics.integration.jei.RecipeUids;
|
||||
import binnie.genetics.machine.incubator.Incubator;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IDrawableAnimated.StartDirection;
|
||||
import mezz.jei.api.gui.IDrawableStatic;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
@@ -16,16 +13,11 @@ import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IncubatorRecipeCategory extends BlankRecipeCategory {
|
||||
@Nonnull
|
||||
private final IDrawableAnimated arrowAnimated;
|
||||
|
||||
public IncubatorRecipeCategory() {
|
||||
IGuiHelper guiHelper = GeneticsJeiPlugin.guiHelper;
|
||||
IDrawableStatic arrowWhite = GeneticsJeiPlugin.drawables.getArrowWhite();
|
||||
this.arrowAnimated = guiHelper.createAnimatedDrawable(arrowWhite, 56, StartDirection.LEFT, false);
|
||||
this.arrowAnimated = GeneticsJeiPlugin.drawables.createArrowAnimated(56);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,12 +32,11 @@ public class IncubatorRecipeCategory extends BlankRecipeCategory {
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return GeneticsJeiPlugin.guiHelper.createBlankDrawable(94 + 18, 60);
|
||||
return GeneticsJeiPlugin.guiHelper.createBlankDrawable(112, 60);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
super.drawExtras(minecraft);
|
||||
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
|
||||
tank.draw(minecraft, 0, 0);
|
||||
tank.draw(minecraft, 94, 0);
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package binnie.genetics.integration.jei.isolator;
|
||||
|
||||
import binnie.genetics.integration.jei.GeneticsJeiPlugin;
|
||||
import binnie.genetics.integration.jei.RecipeUids;
|
||||
import binnie.genetics.machine.incubator.Incubator;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IDrawableAnimated;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class IsolatorRecipeCategory extends BlankRecipeCategory<IsolatorRecipeWrapper> {
|
||||
private final IDrawableAnimated arrowAnimated;
|
||||
|
||||
public IsolatorRecipeCategory() {
|
||||
this.arrowAnimated = GeneticsJeiPlugin.drawables.createArrowAnimated(56);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeUids.ISOLATOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Gene Isolation";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return GeneticsJeiPlugin.guiHelper.createBlankDrawable(130, 60);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
|
||||
tank.draw(minecraft, 0, 0);
|
||||
|
||||
IDrawable arrow = GeneticsJeiPlugin.drawables.getArrow();
|
||||
arrow.draw(minecraft, 69, 25);
|
||||
arrowAnimated.draw(minecraft, 69, 25);
|
||||
|
||||
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
|
||||
slot.draw(minecraft, 22, 0);
|
||||
slot.draw(minecraft, 42, 21);
|
||||
slot.draw(minecraft, 22, 42);
|
||||
|
||||
slot.draw(minecraft, 92, 21);
|
||||
|
||||
String randomText = "(Random)";
|
||||
int textWidth = minecraft.fontRendererObj.getStringWidth(randomText);
|
||||
minecraft.fontRendererObj.drawString(randomText, 102 - (textWidth / 2), 45, Color.gray.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IsolatorRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IDrawable tankOverlay = GeneticsJeiPlugin.drawables.getTankOverlay();
|
||||
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
|
||||
fluidStacks.init(Incubator.TANK_INPUT, true, 1, 1, 16, 58, 100, false, tankOverlay);
|
||||
fluidStacks.set(ingredients);
|
||||
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(0, true, 22, 0);
|
||||
itemStacks.init(1, true, 42, 21);
|
||||
itemStacks.init(2, true, 22, 42);
|
||||
itemStacks.init(3, false, 92, 21);
|
||||
itemStacks.set(ingredients);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.genetics.integration.jei.isolator;
|
||||
|
||||
import binnie.genetics.integration.jei.RecipeUids;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
public class IsolatorRecipeHandler implements IRecipeHandler<IsolatorRecipeWrapper> {
|
||||
@Override
|
||||
public Class<IsolatorRecipeWrapper> getRecipeClass() {
|
||||
return IsolatorRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeUids.ISOLATOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(IsolatorRecipeWrapper recipe) {
|
||||
return RecipeUids.ISOLATOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(IsolatorRecipeWrapper recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(IsolatorRecipeWrapper recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package binnie.genetics.integration.jei.isolator;
|
||||
|
||||
import binnie.core.genetics.Gene;
|
||||
import binnie.genetics.item.ItemSequence;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.genetics.ISpeciesType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class IsolatorRecipeMaker {
|
||||
public static List<IsolatorRecipeWrapper> create() {
|
||||
List<IsolatorRecipeWrapper> recipes = new ArrayList<>();
|
||||
|
||||
Collection<ISpeciesRoot> roots = AlleleManager.alleleRegistry.getSpeciesRoot().values();
|
||||
for (ISpeciesRoot root : roots) {
|
||||
ISpeciesType[] speciesTypes = root.getIconType().getClass().getEnumConstants();
|
||||
IChromosomeType speciesChromosomeType = root.getSpeciesChromosomeType();
|
||||
IAllele[] defaultTemplate = root.getDefaultTemplate();
|
||||
IIndividual individual = root.templateAsIndividual(defaultTemplate);
|
||||
for (ISpeciesType speciesType : speciesTypes) {
|
||||
ItemStack memberStack = root.getMemberStack(individual, speciesType);
|
||||
memberStack.setItemDamage(OreDictionary.WILDCARD_VALUE);
|
||||
|
||||
IAllele species = defaultTemplate[speciesChromosomeType.ordinal()];
|
||||
ItemStack filledSequence = ItemSequence.create(new Gene(species, speciesChromosomeType, root), false);
|
||||
IsolatorRecipeWrapper recipeWrapper = new IsolatorRecipeWrapper(memberStack, filledSequence);
|
||||
recipes.add(recipeWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package binnie.genetics.integration.jei.isolator;
|
||||
|
||||
import binnie.genetics.item.GeneticsItems;
|
||||
import binnie.genetics.machine.isolator.IsolatorLogic;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class IsolatorRecipeWrapper extends BlankRecipeWrapper {
|
||||
private static final FluidStack ETHANOL = Fluids.BIO_ETHANOL.getFluid(IsolatorLogic.ETHANOL_PER_PROCESS);
|
||||
private static final ItemStack EMPTY_SEQUENCE = GeneticsItems.EmptySequencer.get(1);
|
||||
private static final ItemStack ENZYME = GeneticsItems.Enzyme.get(1);
|
||||
|
||||
private final ItemStack input;
|
||||
private final ItemStack output;
|
||||
|
||||
public IsolatorRecipeWrapper(ItemStack input, ItemStack output) {
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
List<ItemStack> inputs = new ArrayList<>();
|
||||
inputs.add(input);
|
||||
inputs.add(EMPTY_SEQUENCE);
|
||||
inputs.add(ENZYME);
|
||||
ingredients.setInputs(ItemStack.class, inputs);
|
||||
|
||||
ingredients.setOutput(ItemStack.class, output);
|
||||
|
||||
ingredients.setInput(FluidStack.class, ETHANOL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
float loss = IsolatorLogic.TARGET_LOSS_CHANCE;
|
||||
String lossString = String.format("Loss: %.0f%%", loss * 100);
|
||||
minecraft.fontRendererObj.drawString(lossString, 42, 0, Color.gray.getRGB());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package binnie.genetics.integration.jei.isolator;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
@@ -109,6 +109,6 @@ public class ItemSequence extends ItemCore implements IItemAnalysable, IItemChar
|
||||
|
||||
@Override
|
||||
public int getCharges(final ItemStack stack) {
|
||||
return stack.getItem().getMaxDamage() - stack.getItemDamage();
|
||||
return stack.getItem().getMaxDamage(stack) - stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
package binnie.genetics.machine.isolator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import binnie.core.genetics.Gene;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.MachineUtil;
|
||||
import binnie.core.machines.inventory.IChargedSlots;
|
||||
import binnie.core.machines.power.ComponentProcessSetCost;
|
||||
import binnie.core.machines.power.ErrorState;
|
||||
@@ -13,18 +12,20 @@ import binnie.genetics.item.ItemSequence;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class IsolatorLogic extends ComponentProcessSetCost implements IProcess {
|
||||
float enzymePerProcess;
|
||||
float ethanolPerProcess;
|
||||
public static final float ENZYME_PER_PROCESS = 0.5f;
|
||||
public static final int ETHANOL_PER_PROCESS = 10;
|
||||
public static final float TARGET_LOSS_CHANCE = 0.05f;
|
||||
|
||||
public IsolatorLogic(final Machine machine) {
|
||||
super(machine, 192000, 4800);
|
||||
this.enzymePerProcess = 0.5f;
|
||||
this.ethanolPerProcess = 10.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,7 +44,7 @@ public class IsolatorLogic extends ComponentProcessSetCost implements IProcess {
|
||||
|
||||
@Override
|
||||
public ErrorState canProgress() {
|
||||
if (!this.getUtil().liquidInTank(Isolator.TANK_ETHANOL, (int) this.ethanolPerProcess)) {
|
||||
if (!this.getUtil().liquidInTank(Isolator.TANK_ETHANOL, ETHANOL_PER_PROCESS)) {
|
||||
return new ErrorState.InsufficientLiquid(Genetics.proxy.localise("machine.machine.isolator.errors.insufficient.ethanol.desc"), Isolator.TANK_ETHANOL);
|
||||
}
|
||||
if (this.getUtil().getSlotCharge(Isolator.SLOT_ENZYME) == 0.0f) {
|
||||
@@ -56,38 +57,34 @@ public class IsolatorLogic extends ComponentProcessSetCost implements IProcess {
|
||||
protected void onFinishTask() {
|
||||
super.onFinishTask();
|
||||
final Random rand = this.getMachine().getWorld().rand;
|
||||
final ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(this.getUtil().getStack(Isolator.SLOT_TARGET));
|
||||
MachineUtil util = this.getUtil();
|
||||
final ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(util.getStack(Isolator.SLOT_TARGET));
|
||||
if (root == null) {
|
||||
return;
|
||||
}
|
||||
final IIndividual individual = root.getMember(this.getUtil().getStack(Isolator.SLOT_TARGET));
|
||||
final IIndividual individual = root.getMember(util.getStack(Isolator.SLOT_TARGET));
|
||||
if (individual == null) {
|
||||
return;
|
||||
}
|
||||
IAllele allele = null;
|
||||
IChromosomeType chromosome = null;
|
||||
Gene gene = null;
|
||||
if (this.getMachine().getWorld().rand.nextFloat() < 2.0f) {
|
||||
while (gene == null) {
|
||||
try {
|
||||
chromosome = root.getKaryotype()[rand.nextInt(root.getKaryotype().length)];
|
||||
allele = (rand.nextBoolean() ? individual.getGenome().getActiveAllele(chromosome) : individual.getGenome().getInactiveAllele(chromosome));
|
||||
gene = Gene.create(allele, chromosome, root);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IChromosomeType[] karyotype = root.getKaryotype();
|
||||
IChromosomeType chromosome = karyotype[rand.nextInt(karyotype.length)];
|
||||
IGenome genome = individual.getGenome();
|
||||
IAllele allele = rand.nextBoolean() ? genome.getActiveAllele(chromosome) : genome.getInactiveAllele(chromosome);
|
||||
Gene gene = Gene.create(allele, chromosome, root);
|
||||
|
||||
final ItemStack serum = ItemSequence.create(gene);
|
||||
this.getUtil().setStack(Isolator.SLOT_RESULUT, serum);
|
||||
this.getUtil().decreaseStack(Isolator.SLOT_SEQUENCER_VIAL, 1);
|
||||
if (rand.nextFloat() < 0.05f) {
|
||||
this.getUtil().decreaseStack(Isolator.SLOT_TARGET, 1);
|
||||
util.setStack(Isolator.SLOT_RESULUT, serum);
|
||||
util.decreaseStack(Isolator.SLOT_SEQUENCER_VIAL, 1);
|
||||
if (rand.nextFloat() < TARGET_LOSS_CHANCE) {
|
||||
util.decreaseStack(Isolator.SLOT_TARGET, 1);
|
||||
}
|
||||
this.getUtil().drainTank(Isolator.TANK_ETHANOL, (int) this.ethanolPerProcess);
|
||||
util.drainTank(Isolator.TANK_ETHANOL, ETHANOL_PER_PROCESS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTickTask() {
|
||||
this.getMachine().getInterface(IChargedSlots.class).alterCharge(Isolator.SLOT_ENZYME, -this.enzymePerProcess * this.getProgressPerTick() / 100.0f);
|
||||
IChargedSlots chargedSlots = this.getMachine().getInterface(IChargedSlots.class);
|
||||
chargedSlots.alterCharge(Isolator.SLOT_ENZYME, -ENZYME_PER_PROCESS * this.getProgressPerTick() / 100.0f);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user