mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-27 15:33:12 +00:00
Some reformat code for 1.11.2 source (#84)
* Optimized imports * Some code reformat * Some refactoring and code reformat * Some code reformat
This commit is contained in:
1 parent
886c36a308
commit
c3809fbc27
508 files changed
+6677
-6238
No files matched your search
@@ -30,5 +30,4 @@ public class CreativeTabGenetics extends CreativeTabs {
|
||||
public ItemStack getTabIconItem() {
|
||||
return GeneticsItems.EMPTY_SERUM.get(1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.network.IPacketID;
|
||||
import binnie.core.proxy.IProxyCore;
|
||||
import binnie.genetics.item.ItemBeeDictionary;
|
||||
import binnie.genetics.core.GeneticsGUI;
|
||||
import binnie.genetics.core.GeneticsPacket;
|
||||
import binnie.genetics.item.ItemBeeDictionary;
|
||||
import binnie.genetics.item.ItemPunnettSquare;
|
||||
import binnie.genetics.item.ModuleItems;
|
||||
import binnie.genetics.machine.ModuleMachine;
|
||||
@@ -32,13 +32,11 @@ import javax.annotation.Nullable;
|
||||
@Mod(modid = Constants.GENETICS_MOD_ID, name = "Binnie's Genetics", useMetadata = true, dependencies = "required-after:" + Constants.CORE_MOD_ID)
|
||||
public class Genetics extends AbstractMod {
|
||||
|
||||
public static final String CHANNEL = "GEN";
|
||||
@Mod.Instance(Constants.GENETICS_MOD_ID)
|
||||
public static Genetics instance;
|
||||
|
||||
@SidedProxy(clientSide = "binnie.genetics.proxy.ProxyClient", serverSide = "binnie.genetics.proxy.ProxyServer")
|
||||
public static Proxy proxy;
|
||||
|
||||
public static final String CHANNEL = "GEN";
|
||||
@Nullable
|
||||
private static ModuleItems items;
|
||||
@Nullable
|
||||
@@ -46,6 +44,16 @@ public class Genetics extends AbstractMod {
|
||||
|
||||
private static Item dictionaryBees;
|
||||
|
||||
public static ModuleItems items() {
|
||||
Preconditions.checkState(items != null);
|
||||
return items;
|
||||
}
|
||||
|
||||
public static ModuleMachine machine() {
|
||||
Preconditions.checkState(machine != null);
|
||||
return machine;
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(final FMLPreInitializationEvent evt) {
|
||||
proxy.registerItem(dictionaryBees = new ItemBeeDictionary());
|
||||
@@ -64,16 +72,6 @@ public class Genetics extends AbstractMod {
|
||||
this.postInit();
|
||||
}
|
||||
|
||||
public static ModuleItems items() {
|
||||
Preconditions.checkState(items != null);
|
||||
return items;
|
||||
}
|
||||
|
||||
public static ModuleMachine machine() {
|
||||
Preconditions.checkState(machine != null);
|
||||
return machine;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerModules() {
|
||||
this.addModule(items = new ModuleItems());
|
||||
@@ -120,5 +118,4 @@ public class Genetics extends AbstractMod {
|
||||
super(Genetics.instance);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,8 +2,8 @@ package binnie.genetics.core;
|
||||
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.genetics.gui.bee.database.WindowApiaristDatabase;
|
||||
import binnie.genetics.gui.WindowAnalyst;
|
||||
import binnie.genetics.gui.bee.database.WindowApiaristDatabase;
|
||||
import binnie.genetics.gui.punnett.WindowPunnettSquare;
|
||||
import binnie.genetics.machine.acclimatiser.WindowAcclimatiser;
|
||||
import binnie.genetics.machine.analyser.WindowAnalyser;
|
||||
@@ -47,10 +47,6 @@ public enum GeneticsGUI implements IBinnieGUID {
|
||||
|
||||
private final WindowFactory windowFactory;
|
||||
|
||||
public interface WindowFactory {
|
||||
Window create(final EntityPlayer player, @Nullable final IInventory inventory, final Side side);
|
||||
}
|
||||
|
||||
GeneticsGUI(final WindowFactory windowFactory) {
|
||||
this.windowFactory = windowFactory;
|
||||
}
|
||||
@@ -69,4 +65,8 @@ public enum GeneticsGUI implements IBinnieGUID {
|
||||
|
||||
return getWindow(player, object, side);
|
||||
}
|
||||
|
||||
public interface WindowFactory {
|
||||
Window create(final EntityPlayer player, @Nullable final IInventory inventory, final Side side);
|
||||
}
|
||||
}
|
||||
@@ -28,15 +28,13 @@ public enum GeneticsTexture implements IBinnieTexture {
|
||||
Acclimatiser(ResourceType.Tile, "acclimatiser"),
|
||||
Splicer(ResourceType.Tile, "splicer");
|
||||
|
||||
public static BinnieSprite dnaIcon = Binnie.RESOURCE.getItemSprite(Genetics.instance, "dna");
|
||||
private final String texture;
|
||||
private final ResourceType type;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nullable
|
||||
private BinnieResource resource;
|
||||
|
||||
public static BinnieSprite dnaIcon = Binnie.RESOURCE.getItemSprite(Genetics.instance, "dna");
|
||||
|
||||
GeneticsTexture(final ResourceType base, final String texture) {
|
||||
this.texture = texture;
|
||||
this.type = base;
|
||||
|
||||
@@ -50,10 +50,10 @@ public class Engineering {
|
||||
if (item instanceof IItemSerum) {
|
||||
((IItemSerum) item).addGene(stack, gene);
|
||||
}
|
||||
if(item == Genetics.items().getItemGenetics()){
|
||||
if (item == Genetics.items().getItemGenetics()) {
|
||||
if (metadata == GeneticsItems.EMPTY_SERUM.ordinal()) {
|
||||
return ItemSerum.create(gene);
|
||||
}else if (metadata == GeneticsItems.EMPTY_GENOME.ordinal()) {
|
||||
} else if (metadata == GeneticsItems.EMPTY_GENOME.ordinal()) {
|
||||
return ItemSerumArray.create(gene);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ import java.util.List;
|
||||
public class GeneItem implements INbtWritable, IGeneItem {
|
||||
private IGene gene;
|
||||
|
||||
public GeneItem(final IGene gene) {
|
||||
this.gene = gene;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static GeneItem create(final ItemStack stack) {
|
||||
NBTTagCompound tagCompound = stack.getTagCompound();
|
||||
@@ -30,10 +34,6 @@ public class GeneItem implements INbtWritable, IGeneItem {
|
||||
return null;
|
||||
}
|
||||
|
||||
public GeneItem(final IGene gene) {
|
||||
this.gene = gene;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToItem(final ItemStack stack) {
|
||||
NBTTagCompound nbt = stack.getTagCompound();
|
||||
|
||||
@@ -2,14 +2,24 @@ package binnie.genetics.genetics;
|
||||
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import com.google.common.base.Throwables;
|
||||
import forestry.api.genetics.*;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleFloat;
|
||||
import forestry.api.genetics.IAlleleInteger;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class GeneticEngineeringSystem {
|
||||
BreedingSystem breedingSystem;
|
||||
public Map<IChromosomeType, List<IAllele>> chromosomeMap;
|
||||
static List<IAllele> speciesList;
|
||||
public Map<IChromosomeType, List<IAllele>> chromosomeMap;
|
||||
BreedingSystem breedingSystem;
|
||||
|
||||
public GeneticEngineeringSystem(final BreedingSystem system) {
|
||||
this.chromosomeMap = new HashMap<>();
|
||||
|
||||
@@ -12,14 +12,20 @@ public class SequencerItem extends GeneItem {
|
||||
public int sequenced;
|
||||
public boolean analysed;
|
||||
|
||||
public SequencerItem(final IGene gene) {
|
||||
super(gene);
|
||||
this.sequenced = 0;
|
||||
this.analysed = false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static SequencerItem create(final ItemStack itemStack) {
|
||||
NBTTagCompound nbt = itemStack.getTagCompound();
|
||||
if (nbt != null &&
|
||||
nbt.hasKey("gene", Constants.NBT.TAG_COMPOUND) &&
|
||||
nbt.hasKey("seq", Constants.NBT.TAG_BYTE) &&
|
||||
nbt.hasKey("ana")
|
||||
) {
|
||||
nbt.hasKey("gene", Constants.NBT.TAG_COMPOUND) &&
|
||||
nbt.hasKey("seq", Constants.NBT.TAG_BYTE) &&
|
||||
nbt.hasKey("ana")
|
||||
) {
|
||||
NBTTagCompound geneNbt = nbt.getCompoundTag("gene");
|
||||
Gene gene = Gene.create(geneNbt);
|
||||
SequencerItem sequencerItem = new SequencerItem(gene);
|
||||
@@ -30,12 +36,6 @@ public class SequencerItem extends GeneItem {
|
||||
return null;
|
||||
}
|
||||
|
||||
public SequencerItem(final IGene gene) {
|
||||
super(gene);
|
||||
this.sequenced = 0;
|
||||
this.analysed = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(final NBTTagCompound nbt2) {
|
||||
NBTTagCompound nbt = super.writeToNBT(nbt2);
|
||||
|
||||
@@ -11,7 +11,11 @@ import binnie.core.craftgui.geometry.Point;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.genetics.Genetics;
|
||||
import forestry.api.genetics.*;
|
||||
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 net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -226,7 +226,7 @@ public class AnalystPageMutations extends ControlAnalystPage {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void drawSprite(BinnieSprite sprite){
|
||||
private void drawSprite(BinnieSprite sprite) {
|
||||
RenderUtil.drawSprite(new Point(14, 0), sprite.getSprite());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package binnie.genetics.gui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.*;
|
||||
import binnie.core.craftgui.Attribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.geometry.Point;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.genetics.gui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.core.craftgui.Attribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
@@ -11,7 +12,6 @@ import binnie.core.craftgui.events.EventWidget;
|
||||
import binnie.core.craftgui.geometry.Point;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -29,6 +29,5 @@ public class ControlGenesisOption extends ControlOption<Gene> {
|
||||
RenderUtil.drawText(new Area(0, 0, 70, 22), TextJustification.MiddleCenter, this.getChromosomeName(), this.getColour());
|
||||
RenderUtil.drawText(new Area(75, 0, 80, 22), TextJustification.MiddleCenter, this.getAlleleName(), this.getColour());
|
||||
RenderUtil.drawSolidRect(new Area(70, 2, 1, 16), -16777216 + this.getColour());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -18,9 +18,9 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import java.util.EnumSet;
|
||||
|
||||
public abstract class ControlToleranceBar<T extends Enum<T>> extends Control implements ITooltip {
|
||||
private Class<T> enumClass;
|
||||
EnumSet<T> tolerated;
|
||||
EnumSet<T> fullSet;
|
||||
private Class<T> enumClass;
|
||||
|
||||
public ControlToleranceBar(final IWidget parent, final int x, final int y, final int width, final int height, final Class<T> clss) {
|
||||
super(parent, x, y, width, height);
|
||||
|
||||
@@ -3,7 +3,11 @@ package binnie.genetics.gui;
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.api.IFlower;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.craftgui.*;
|
||||
import binnie.core.craftgui.Attribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.Widget;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.scroll.ControlScrollBar;
|
||||
@@ -69,16 +73,12 @@ public class WindowAnalyst extends Window {
|
||||
boolean isDatabase;
|
||||
boolean isMaster;
|
||||
boolean lockedSearch;
|
||||
private Control analystNone;
|
||||
private ControlSlide slideUpInv;
|
||||
@Nullable
|
||||
IIndividual current;
|
||||
@Nullable
|
||||
BreedingSystem currentSystem;
|
||||
|
||||
public static GeneticsGUI.WindowFactory create(final boolean database, final boolean master) {
|
||||
return (player, inventory, side) -> new WindowAnalyst(player, inventory, side, database, master);
|
||||
}
|
||||
private Control analystNone;
|
||||
private ControlSlide slideUpInv;
|
||||
|
||||
public WindowAnalyst(final EntityPlayer player, @Nullable final IInventory inventory, final Side side, final boolean database, final boolean master) {
|
||||
super(312, 230, player, inventory, side);
|
||||
@@ -96,6 +96,10 @@ public class WindowAnalyst extends Window {
|
||||
this.lockedSearch = this.isDatabase;
|
||||
}
|
||||
|
||||
public static GeneticsGUI.WindowFactory create(final boolean database, final boolean master) {
|
||||
return (player, inventory, side) -> new WindowAnalyst(player, inventory, side, database, master);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
@@ -280,37 +284,6 @@ public class WindowAnalyst extends Window {
|
||||
this.setSystem(Binnie.GENETICS.beeBreedingSystem);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setIndividual(final IIndividual ind) {
|
||||
if (!this.isDatabase) {
|
||||
if (ind == null) {
|
||||
this.analystNone.show();
|
||||
this.slideUpInv.hide();
|
||||
} else {
|
||||
this.analystNone.hide();
|
||||
this.slideUpInv.show();
|
||||
}
|
||||
}
|
||||
if (ind == this.current || (ind != null && this.current != null && ind.isGeneticEqual(this.current))) {
|
||||
return;
|
||||
}
|
||||
final boolean systemChange = (this.current = ind) != null && ind.getGenome().getSpeciesRoot() != this.getSystem().getSpeciesRoot();
|
||||
if (systemChange) {
|
||||
this.currentSystem = Binnie.GENETICS.getSystem(ind.getGenome().getSpeciesRoot());
|
||||
}
|
||||
this.updatePages(systemChange);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setSystem(final BreedingSystem system) {
|
||||
if (system == this.currentSystem) {
|
||||
return;
|
||||
}
|
||||
this.currentSystem = system;
|
||||
this.current = null;
|
||||
this.updatePages(true);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void updatePages(final boolean systemChange) {
|
||||
int oldLeft = -1;
|
||||
@@ -361,59 +334,59 @@ public class WindowAnalyst extends Window {
|
||||
}
|
||||
this.tabBar.deleteAllChildren();
|
||||
if (this.analystPages.size() > 0) {
|
||||
final int width = this.tabBar.width() / this.analystPages.size();
|
||||
int x = 0;
|
||||
for (final ControlAnalystPage page : this.analystPages) {
|
||||
new ControlTooltip(this.tabBar, x, 0, width, this.tabBar.height()) {
|
||||
ControlAnalystPage value;
|
||||
final int width = this.tabBar.width() / this.analystPages.size();
|
||||
int x = 0;
|
||||
for (final ControlAnalystPage page : this.analystPages) {
|
||||
new ControlTooltip(this.tabBar, x, 0, width, this.tabBar.height()) {
|
||||
ControlAnalystPage value;
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.add(this.value.getTitle());
|
||||
}
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.add(this.value.getTitle());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initialise() {
|
||||
super.initialise();
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.value = page;
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
final int currentIndex = WindowAnalyst.this.analystPages.indexOf(WindowAnalyst.this.rightPage.getContent());
|
||||
int clickedIndex = WindowAnalyst.this.analystPages.indexOf(value);
|
||||
if (WindowAnalyst.this.isDatabase) {
|
||||
if (clickedIndex != 0 && clickedIndex != currentIndex) {
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.rightPage, value);
|
||||
@Override
|
||||
protected void initialise() {
|
||||
super.initialise();
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.value = page;
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
final int currentIndex = WindowAnalyst.this.analystPages.indexOf(WindowAnalyst.this.rightPage.getContent());
|
||||
int clickedIndex = WindowAnalyst.this.analystPages.indexOf(value);
|
||||
if (WindowAnalyst.this.isDatabase) {
|
||||
if (clickedIndex != 0 && clickedIndex != currentIndex) {
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.rightPage, value);
|
||||
}
|
||||
} else {
|
||||
if (clickedIndex < 0) {
|
||||
clickedIndex = 0;
|
||||
}
|
||||
if (clickedIndex < currentIndex) {
|
||||
++clickedIndex;
|
||||
}
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.rightPage, null);
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.leftPage, null);
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.rightPage, WindowAnalyst.this.analystPages.get(clickedIndex));
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.leftPage, WindowAnalyst.this.analystPages.get(clickedIndex - 1));
|
||||
}
|
||||
} else {
|
||||
if (clickedIndex < 0) {
|
||||
clickedIndex = 0;
|
||||
}
|
||||
if (clickedIndex < currentIndex) {
|
||||
++clickedIndex;
|
||||
}
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.rightPage, null);
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.leftPage, null);
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.rightPage, WindowAnalyst.this.analystPages.get(clickedIndex));
|
||||
WindowAnalyst.this.setPage(WindowAnalyst.this.leftPage, WindowAnalyst.this.analystPages.get(clickedIndex - 1));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final boolean active = this.value == WindowAnalyst.this.leftPage.getContent() || this.value == WindowAnalyst.this.rightPage.getContent();
|
||||
RenderUtil.setColour((active ? -16777216 : 1140850688) + this.value.getColour());
|
||||
CraftGUI.render.texture(CraftGUITexture.TabSolid, this.getArea().inset(1));
|
||||
RenderUtil.setColour(this.value.getColour());
|
||||
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea().inset(1));
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
}
|
||||
};
|
||||
x += width;
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final boolean active = this.value == WindowAnalyst.this.leftPage.getContent() || this.value == WindowAnalyst.this.rightPage.getContent();
|
||||
RenderUtil.setColour((active ? -16777216 : 1140850688) + this.value.getColour());
|
||||
CraftGUI.render.texture(CraftGUITexture.TabSolid, this.getArea().inset(1));
|
||||
RenderUtil.setColour(this.value.getColour());
|
||||
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea().inset(1));
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
}
|
||||
};
|
||||
x += width;
|
||||
}
|
||||
this.setPage(this.leftPage, this.analystPages.get((oldLeft >= 0) ? oldLeft : 0));
|
||||
if (this.analystPages.size() > 1) {
|
||||
@@ -504,7 +477,38 @@ public class WindowAnalyst extends Window {
|
||||
return this.current;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setIndividual(final IIndividual ind) {
|
||||
if (!this.isDatabase) {
|
||||
if (ind == null) {
|
||||
this.analystNone.show();
|
||||
this.slideUpInv.hide();
|
||||
} else {
|
||||
this.analystNone.hide();
|
||||
this.slideUpInv.show();
|
||||
}
|
||||
}
|
||||
if (ind == this.current || (ind != null && this.current != null && ind.isGeneticEqual(this.current))) {
|
||||
return;
|
||||
}
|
||||
final boolean systemChange = (this.current = ind) != null && ind.getGenome().getSpeciesRoot() != this.getSystem().getSpeciesRoot();
|
||||
if (systemChange) {
|
||||
this.currentSystem = Binnie.GENETICS.getSystem(ind.getGenome().getSpeciesRoot());
|
||||
}
|
||||
this.updatePages(systemChange);
|
||||
}
|
||||
|
||||
public BreedingSystem getSystem() {
|
||||
return this.currentSystem;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setSystem(final BreedingSystem system) {
|
||||
if (system == this.currentSystem) {
|
||||
return;
|
||||
}
|
||||
this.currentSystem = system;
|
||||
this.current = null;
|
||||
this.updatePages(true);
|
||||
}
|
||||
}
|
||||
@@ -139,8 +139,8 @@ public class AnalystPageProducts extends AnalystPageProduce {
|
||||
@Nullable
|
||||
public static ItemStack getContainer(final FluidStack fluidStack) {
|
||||
ItemStack[] containers = {
|
||||
new ItemStack(Items.GLASS_BOTTLE),
|
||||
new ItemStack(Items.BUCKET)
|
||||
new ItemStack(Items.GLASS_BOTTLE),
|
||||
new ItemStack(Items.BUCKET)
|
||||
};
|
||||
|
||||
for (ItemStack container : containers) {
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package binnie.genetics.gui.bee.database;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.*;
|
||||
import binnie.core.craftgui.Attribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.geometry.Area;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
@@ -49,7 +53,7 @@ public class ControlBiomes extends Control implements ITooltip {
|
||||
if (Biome.getBiome(i) != null) {
|
||||
//TODO FIND COLOR
|
||||
//CraftGUI.Render.colour(Biome.getBiome(i).color);
|
||||
|
||||
|
||||
}
|
||||
CraftGUI.render.texture(CraftGUITexture.Button, new Area(x, y, 16, 16));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package binnie.genetics.gui.bee.database;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.*;
|
||||
import binnie.core.craftgui.Attribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.geometry.Area;
|
||||
import binnie.core.craftgui.renderer.RenderUtil;
|
||||
|
||||
@@ -14,14 +14,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ControlProductsBox extends ControlListBox<ControlProductsBox.Product> {
|
||||
IAlleleBeeSpecies species;
|
||||
private int index;
|
||||
private Type type;
|
||||
IAlleleBeeSpecies species;
|
||||
|
||||
@Override
|
||||
public IWidget createOption(final Product value, final int y) {
|
||||
return new ControlProductsItem(getContent(), value, y);
|
||||
}
|
||||
|
||||
public ControlProductsBox(final IWidget parent, final int x, final int y, final int width, final int height, final Type type) {
|
||||
super(parent, x, y, width, height, 12);
|
||||
@@ -29,6 +24,11 @@ public class ControlProductsBox extends ControlListBox<ControlProductsBox.Produc
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWidget createOption(final Product value, final int y) {
|
||||
return new ControlProductsItem(getContent(), value, y);
|
||||
}
|
||||
|
||||
public void setSpecies(final IAlleleBeeSpecies species) {
|
||||
if (species != this.species && (this.species = species) != null) {
|
||||
final IAllele[] template = Binnie.GENETICS.getBeeRoot().getTemplate(species.getUID());
|
||||
|
||||
@@ -53,41 +53,6 @@ public class PageSpeciesGenome extends PageSpecies {
|
||||
this.pageSpeciesGenome_EffectText = new ControlText(this, new Area(x, 155, 72, 30), "", TextJustification.TopLeft);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
final IAllele[] template = Binnie.GENETICS.getBeeRoot().getTemplate(species.getUID());
|
||||
if (template != null) {
|
||||
final IBeeGenome genome = Binnie.GENETICS.getBeeRoot().templateAsGenome(template);
|
||||
final IBee bee = Binnie.GENETICS.getBeeRoot().getBee(genome);
|
||||
this.pageSpeciesGenome_SpeedText.setValue(rateSpeed(genome.getSpeed()));
|
||||
this.pageSpeciesGenome_LifespanText.setValue(rateLifespan(genome.getLifespan()));
|
||||
this.pageSpeciesGenome_FertilityText.setValue(genome.getFertility() + " children");
|
||||
this.pageSpeciesGenome_FloweringText.setValue(rateFlowering(genome.getFlowering()));
|
||||
final Vec3i area = genome.getTerritory();
|
||||
this.pageSpeciesGenome_TerritoryText.setValue(area.getX() + "x" + area.getY() + "x" + area.getZ());
|
||||
String behavior = "Daytime";
|
||||
if (genome.getPrimary().isNocturnal()) {
|
||||
behavior = "Nighttime";
|
||||
}
|
||||
if (genome.getNeverSleeps()) {
|
||||
behavior = "All Day";
|
||||
}
|
||||
this.pageSpeciesGenome_NocturnalText.setValue(behavior);
|
||||
if (genome.getCaveDwelling()) {
|
||||
this.pageSpeciesGenome_CaveDwellingText.setValue("Not Needed");
|
||||
} else {
|
||||
this.pageSpeciesGenome_CaveDwellingText.setValue("Required");
|
||||
}
|
||||
this.pageSpeciesGenome_TolerantFlyerText.setValue(tolerated(genome.getToleratesRain()));
|
||||
if (genome.getFlowerProvider() != null) {
|
||||
this.pageSpeciesGenome_FlowerText.setValue(genome.getFlowerProvider().getDescription());
|
||||
} else {
|
||||
this.pageSpeciesGenome_FlowerText.setValue("None");
|
||||
}
|
||||
this.pageSpeciesGenome_EffectText.setValue(genome.getEffect().getName());
|
||||
}
|
||||
}
|
||||
|
||||
public static String rateFlowering(final int flowering) {
|
||||
if (flowering >= 99) {
|
||||
return "Maximum";
|
||||
@@ -169,4 +134,39 @@ public class PageSpeciesGenome extends PageSpecies {
|
||||
}
|
||||
return "Not Tolerated";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
final IAllele[] template = Binnie.GENETICS.getBeeRoot().getTemplate(species.getUID());
|
||||
if (template != null) {
|
||||
final IBeeGenome genome = Binnie.GENETICS.getBeeRoot().templateAsGenome(template);
|
||||
final IBee bee = Binnie.GENETICS.getBeeRoot().getBee(genome);
|
||||
this.pageSpeciesGenome_SpeedText.setValue(rateSpeed(genome.getSpeed()));
|
||||
this.pageSpeciesGenome_LifespanText.setValue(rateLifespan(genome.getLifespan()));
|
||||
this.pageSpeciesGenome_FertilityText.setValue(genome.getFertility() + " children");
|
||||
this.pageSpeciesGenome_FloweringText.setValue(rateFlowering(genome.getFlowering()));
|
||||
final Vec3i area = genome.getTerritory();
|
||||
this.pageSpeciesGenome_TerritoryText.setValue(area.getX() + "x" + area.getY() + "x" + area.getZ());
|
||||
String behavior = "Daytime";
|
||||
if (genome.getPrimary().isNocturnal()) {
|
||||
behavior = "Nighttime";
|
||||
}
|
||||
if (genome.getNeverSleeps()) {
|
||||
behavior = "All Day";
|
||||
}
|
||||
this.pageSpeciesGenome_NocturnalText.setValue(behavior);
|
||||
if (genome.getCaveDwelling()) {
|
||||
this.pageSpeciesGenome_CaveDwellingText.setValue("Not Needed");
|
||||
} else {
|
||||
this.pageSpeciesGenome_CaveDwellingText.setValue("Required");
|
||||
}
|
||||
this.pageSpeciesGenome_TolerantFlyerText.setValue(tolerated(genome.getToleratesRain()));
|
||||
if (genome.getFlowerProvider() != null) {
|
||||
this.pageSpeciesGenome_FlowerText.setValue(genome.getFlowerProvider().getDescription());
|
||||
} else {
|
||||
this.pageSpeciesGenome_FlowerText.setValue("None");
|
||||
}
|
||||
this.pageSpeciesGenome_EffectText.setValue(genome.getEffect().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,15 @@ package binnie.genetics.gui.bee.database;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.craftgui.database.*;
|
||||
import binnie.core.craftgui.database.DatabaseTab;
|
||||
import binnie.core.craftgui.database.PageBranchOverview;
|
||||
import binnie.core.craftgui.database.PageBranchSpecies;
|
||||
import binnie.core.craftgui.database.PageBreeder;
|
||||
import binnie.core.craftgui.database.PageSpeciesClassification;
|
||||
import binnie.core.craftgui.database.PageSpeciesMutations;
|
||||
import binnie.core.craftgui.database.PageSpeciesOverview;
|
||||
import binnie.core.craftgui.database.PageSpeciesResultant;
|
||||
import binnie.core.craftgui.database.WindowAbstractDatabase;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.genetics.Genetics;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -10,6 +18,14 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class WindowApiaristDatabase extends WindowAbstractDatabase {
|
||||
public WindowApiaristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
super(player, side, nei, Binnie.GENETICS.beeBreedingSystem, 110);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
return new WindowApiaristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected void addTabs() {
|
||||
@@ -25,14 +41,6 @@ public class WindowApiaristDatabase extends WindowAbstractDatabase {
|
||||
new PageBreeder(this.getInfoPages(Mode.BREEDER), this.getUsername(), new DatabaseTab(Genetics.instance, "breeder", 0));
|
||||
}
|
||||
|
||||
public WindowApiaristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
super(player, side, nei, Binnie.GENETICS.beeBreedingSystem, 110);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
return new WindowApiaristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
|
||||
@@ -44,40 +44,40 @@ public class AnalystPageSoil extends ControlAnalystPage {
|
||||
y += 16;
|
||||
new ControlText(this, new Area(4, y, this.width() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.recommended"), TextJustification.MiddleCenter).setColour(this.getColour());
|
||||
y += 12;
|
||||
EnumMoisture recomMoisture = EnumMoisture.Normal;
|
||||
final boolean canTolNormal = Tolerance.canTolerate(moisture, EnumMoisture.Normal, moistureTol);
|
||||
final boolean canTolDamp = Tolerance.canTolerate(moisture, EnumMoisture.Damp, moistureTol);
|
||||
final boolean canTolDry = Tolerance.canTolerate(moisture, EnumMoisture.Dry, moistureTol);
|
||||
EnumMoisture recomMoisture = EnumMoisture.NORMAL;
|
||||
final boolean canTolNormal = Tolerance.canTolerate(moisture, EnumMoisture.NORMAL, moistureTol);
|
||||
final boolean canTolDamp = Tolerance.canTolerate(moisture, EnumMoisture.DAMP, moistureTol);
|
||||
final boolean canTolDry = Tolerance.canTolerate(moisture, EnumMoisture.DRY, moistureTol);
|
||||
if (canTolNormal) {
|
||||
if (canTolDamp && !canTolDry) {
|
||||
recomMoisture = EnumMoisture.Damp;
|
||||
recomMoisture = EnumMoisture.DAMP;
|
||||
} else if (canTolDry && !canTolDamp) {
|
||||
recomMoisture = EnumMoisture.Dry;
|
||||
recomMoisture = EnumMoisture.DRY;
|
||||
}
|
||||
} else {
|
||||
if (canTolDamp) {
|
||||
recomMoisture = EnumMoisture.Damp;
|
||||
recomMoisture = EnumMoisture.DAMP;
|
||||
}
|
||||
if (canTolDry) {
|
||||
recomMoisture = EnumMoisture.Dry;
|
||||
recomMoisture = EnumMoisture.DRY;
|
||||
}
|
||||
}
|
||||
EnumAcidity recomPH = EnumAcidity.Neutral;
|
||||
final boolean canTolNeutral = Tolerance.canTolerate(pH, EnumAcidity.Neutral, pHTol);
|
||||
final boolean canTolAcid = Tolerance.canTolerate(pH, EnumAcidity.Acid, pHTol);
|
||||
final boolean canTolAlkaline = Tolerance.canTolerate(pH, EnumAcidity.Alkaline, pHTol);
|
||||
EnumAcidity recomPH = EnumAcidity.NEUTRAL;
|
||||
final boolean canTolNeutral = Tolerance.canTolerate(pH, EnumAcidity.NEUTRAL, pHTol);
|
||||
final boolean canTolAcid = Tolerance.canTolerate(pH, EnumAcidity.ACID, pHTol);
|
||||
final boolean canTolAlkaline = Tolerance.canTolerate(pH, EnumAcidity.ALKALINE, pHTol);
|
||||
if (canTolNeutral) {
|
||||
if (canTolAcid && !canTolAlkaline) {
|
||||
recomPH = EnumAcidity.Acid;
|
||||
recomPH = EnumAcidity.ACID;
|
||||
} else if (canTolAlkaline && !canTolAcid) {
|
||||
recomPH = EnumAcidity.Alkaline;
|
||||
recomPH = EnumAcidity.ALKALINE;
|
||||
}
|
||||
} else {
|
||||
if (canTolAcid) {
|
||||
recomPH = EnumAcidity.Acid;
|
||||
recomPH = EnumAcidity.ACID;
|
||||
}
|
||||
if (canTolAlkaline) {
|
||||
recomPH = EnumAcidity.Alkaline;
|
||||
recomPH = EnumAcidity.ALKALINE;
|
||||
}
|
||||
}
|
||||
final ItemStack stack = new ItemStack(Botany.soil, 1, BlockSoil.getMeta(recomPH, recomMoisture));
|
||||
@@ -88,8 +88,8 @@ public class AnalystPageSoil extends ControlAnalystPage {
|
||||
new ControlText(this, new Area(4, y, this.width() - 8, 14), Genetics.proxy.localise("gui.analyst.soil.other"), TextJustification.MiddleCenter).setColour(this.getColour());
|
||||
y += 12;
|
||||
final List<ItemStack> stacks = new ArrayList<>();
|
||||
for (final EnumAcidity a : EnumSet.range(EnumAcidity.Acid, EnumAcidity.Alkaline)) {
|
||||
for (final EnumMoisture b : EnumSet.range(EnumMoisture.Dry, EnumMoisture.Damp)) {
|
||||
for (final EnumAcidity a : EnumSet.range(EnumAcidity.ACID, EnumAcidity.ALKALINE)) {
|
||||
for (final EnumMoisture b : EnumSet.range(EnumMoisture.DRY, EnumMoisture.DAMP)) {
|
||||
if (Tolerance.canTolerate(pH, a, pHTol) && Tolerance.canTolerate(moisture, b, moistureTol) && (a != recomPH || b != recomMoisture)) {
|
||||
stacks.add(new ItemStack(Botany.soil, 1, BlockSoil.getMeta(a, b)));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package binnie.genetics.gui.punnett;
|
||||
|
||||
import binnie.core.craftgui.*;
|
||||
import binnie.core.craftgui.Attribute;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.renderer.RenderUtil;
|
||||
|
||||
@@ -72,5 +72,4 @@ public class ControlPunnett extends Control {
|
||||
new ControlText(this, new Area(0, ControlPunnett.boxHeight, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getName(), TextJustification.TopCenter).setColour(11184810);
|
||||
new ControlText(this, new Area(0, ControlPunnett.boxHeight * 2, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getName(), TextJustification.TopCenter).setColour(11184810);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,15 +23,6 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class WindowPunnettSquare extends Window {
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowPunnettSquare(player, inventory, side);
|
||||
}
|
||||
|
||||
public WindowPunnettSquare(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(245, 205, player, inventory, side);
|
||||
this.root = null;
|
||||
}
|
||||
|
||||
private static final IBinnieTexture texture = new GuiTexture();
|
||||
ControlSlot bee1;
|
||||
ControlSlot bee2;
|
||||
@@ -39,6 +30,15 @@ public class WindowPunnettSquare extends Window {
|
||||
@Nullable
|
||||
ISpeciesRoot root;
|
||||
|
||||
public WindowPunnettSquare(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(245, 205, player, inventory, side);
|
||||
this.root = null;
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowPunnettSquare(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return Genetics.instance;
|
||||
@@ -78,7 +78,5 @@ public class WindowPunnettSquare extends Window {
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,9 +67,9 @@ public class AnalystPageClimate extends ControlAnalystPage {
|
||||
final List<Biome> biomes = new ArrayList<>();
|
||||
for (final Biome biome : Biome.EXPLORATION_BIOMES_LIST) { //TODO check
|
||||
if (biome != null &&
|
||||
biome != Biomes.FROZEN_OCEAN &&
|
||||
Tolerance.canTolerate(temp, EnumTemperature.getFromBiome(biome), tempTol) &&
|
||||
Tolerance.canTolerate(humid, EnumHumidity.getFromValue(biome.getRainfall()), humidTol)) {
|
||||
biome != Biomes.FROZEN_OCEAN &&
|
||||
Tolerance.canTolerate(temp, EnumTemperature.getFromBiome(biome), tempTol) &&
|
||||
Tolerance.canTolerate(humid, EnumHumidity.getFromValue(biome.getRainfall()), humidTol)) {
|
||||
boolean match = false;
|
||||
for (final Biome eBiome : biomes) {
|
||||
if (biome.getBiomeName().contains(eBiome.getBiomeName()) && EnumHumidity.getFromValue(eBiome.getRainfall()) == EnumHumidity.getFromValue(biome.getRainfall()) && EnumTemperature.getFromBiome(eBiome) == EnumTemperature.getFromBiome(biome)) {
|
||||
|
||||
@@ -27,7 +27,12 @@ import binnie.genetics.machine.GeneticMachine;
|
||||
import binnie.genetics.machine.LaboratoryMachine;
|
||||
import binnie.genetics.machine.incubator.Incubator;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import mezz.jei.api.*;
|
||||
import mezz.jei.api.BlankModPlugin;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.ISubtypeRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -58,15 +63,15 @@ public class GeneticsJeiPlugin extends BlankModPlugin {
|
||||
GeneticsJeiPlugin.drawables = Drawables.getDrawables(guiHelper);
|
||||
|
||||
registry.addRecipeCategories(
|
||||
new IncubatorRecipeCategory(),
|
||||
new LarvaeIncubatorRecipeCategory(),
|
||||
new IsolatorRecipeCategory(),
|
||||
new PolymeriserRecipeCategory(),
|
||||
new SequencerRecipeCategory(),
|
||||
new InoculatorRecipeCategory(),
|
||||
new SplicerRecipeCategory(),
|
||||
new GenepoolRecipeCategory(),
|
||||
new DatabaseRecipeCategory()
|
||||
new IncubatorRecipeCategory(),
|
||||
new LarvaeIncubatorRecipeCategory(),
|
||||
new IsolatorRecipeCategory(),
|
||||
new PolymeriserRecipeCategory(),
|
||||
new SequencerRecipeCategory(),
|
||||
new InoculatorRecipeCategory(),
|
||||
new SplicerRecipeCategory(),
|
||||
new GenepoolRecipeCategory(),
|
||||
new DatabaseRecipeCategory()
|
||||
);
|
||||
|
||||
registry.addRecipeCategoryCraftingItem(LaboratoryMachine.Incubator.get(1), RecipeUids.INCUBATOR, RecipeUids.INCUBATOR_LARVAE);
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -42,8 +42,8 @@ public class DatabaseRecipeWrapper extends BlankRecipeWrapper {
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInputs(ItemStack.class, Arrays.asList(
|
||||
input,
|
||||
new ItemStack(Genetics.items().database)
|
||||
input,
|
||||
new ItemStack(Genetics.items().database)
|
||||
));
|
||||
|
||||
ingredients.setOutputLists(ItemStack.class, Collections.singletonList(outputs));
|
||||
|
||||
@@ -3,7 +3,11 @@ package binnie.genetics.integration.jei.genepool;
|
||||
import binnie.genetics.integration.jei.GeneticsJeiPlugin;
|
||||
import binnie.genetics.integration.jei.RecipeUids;
|
||||
import binnie.genetics.machine.genepool.Genepool;
|
||||
import mezz.jei.api.gui.*;
|
||||
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;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package binnie.genetics.integration.jei.genepool;
|
||||
|
||||
import forestry.api.genetics.*;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
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;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
+5
-1
@@ -3,7 +3,11 @@ 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.gui.*;
|
||||
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;
|
||||
|
||||
@@ -9,7 +9,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
public class IncubatorRecipeWrapper extends BlankRecipeWrapper {
|
||||
private final IIncubatorRecipe recipe;
|
||||
|
||||
-1
@@ -35,5 +35,4 @@ public class LarvaeIncubatorRecipeMaker {
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
}
|
||||
+5
-1
@@ -10,7 +10,11 @@ import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import mezz.jei.api.gui.*;
|
||||
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 mezz.jei.api.recipe.IFocus;
|
||||
|
||||
@@ -6,7 +6,11 @@ import binnie.core.genetics.Gene;
|
||||
import binnie.genetics.genetics.Engineering;
|
||||
import binnie.genetics.item.ItemSerum;
|
||||
import binnie.genetics.item.ItemSerumArray;
|
||||
import forestry.api.genetics.*;
|
||||
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;
|
||||
|
||||
|
||||
+3
-4
@@ -15,7 +15,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
@@ -42,8 +42,8 @@ public class InoculatorRecipeWrapper extends BlankRecipeWrapper {
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInputs(ItemStack.class, Arrays.asList(
|
||||
inputSerum,
|
||||
wildcardTarget
|
||||
inputSerum,
|
||||
wildcardTarget
|
||||
));
|
||||
|
||||
ingredients.setOutput(ItemStack.class, wildcardTarget);
|
||||
@@ -107,5 +107,4 @@ public class InoculatorRecipeWrapper extends BlankRecipeWrapper {
|
||||
public ItemStack getWildcardTarget() {
|
||||
return wildcardTarget;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,14 +3,18 @@ package binnie.genetics.integration.jei.isolator;
|
||||
import binnie.genetics.integration.jei.GeneticsJeiPlugin;
|
||||
import binnie.genetics.integration.jei.RecipeUids;
|
||||
import binnie.genetics.machine.isolator.Isolator;
|
||||
import mezz.jei.api.gui.*;
|
||||
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 net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
public class IsolatorRecipeCategory extends BlankRecipeCategory<IsolatorRecipeWrapper> {
|
||||
private final IDrawableAnimated arrowAnimated;
|
||||
|
||||
@@ -2,7 +2,12 @@ package binnie.genetics.integration.jei.isolator;
|
||||
|
||||
import binnie.core.genetics.Gene;
|
||||
import binnie.genetics.item.ItemSequence;
|
||||
import forestry.api.genetics.*;
|
||||
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;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
+5
-1
@@ -3,7 +3,11 @@ package binnie.genetics.integration.jei.polymeriser;
|
||||
import binnie.genetics.integration.jei.GeneticsJeiPlugin;
|
||||
import binnie.genetics.integration.jei.RecipeUids;
|
||||
import binnie.genetics.machine.polymeriser.Polymeriser;
|
||||
import mezz.jei.api.gui.*;
|
||||
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;
|
||||
|
||||
+3
-3
@@ -15,9 +15,9 @@ public class PolymeriserRecipeMaker {
|
||||
List<PolymeriserRecipeWrapper> recipes = new ArrayList<>();
|
||||
|
||||
List<ItemStack> inputs = Arrays.asList(
|
||||
new ItemStack(Genetics.items().itemSequencer, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Genetics.items().itemSerum, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Genetics.items().itemSerumArray, 1, OreDictionary.WILDCARD_VALUE)
|
||||
new ItemStack(Genetics.items().itemSequencer, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Genetics.items().itemSerum, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Genetics.items().itemSerumArray, 1, OreDictionary.WILDCARD_VALUE)
|
||||
);
|
||||
|
||||
IStackHelper stackHelper = GeneticsJeiPlugin.jeiHelpers.getStackHelper();
|
||||
|
||||
+2
-2
@@ -31,8 +31,8 @@ public class PolymeriserRecipeWrapper extends BlankRecipeWrapper {
|
||||
int dnaAmount = (int) (PolymeriserLogic.getDNAPerProcess(input) * processCount);
|
||||
int bacteriaAmount = (int) (PolymeriserLogic.getBacteriaPerProcess(input) * processCount);
|
||||
ingredients.setInputs(FluidStack.class, Arrays.asList(
|
||||
GeneticLiquid.RawDNA.get(dnaAmount),
|
||||
GeneticLiquid.BacteriaPoly.get(bacteriaAmount)
|
||||
GeneticLiquid.RawDNA.get(dnaAmount),
|
||||
GeneticLiquid.BacteriaPoly.get(bacteriaAmount)
|
||||
));
|
||||
|
||||
ItemStack output = input.copy();
|
||||
|
||||
@@ -34,9 +34,9 @@ public class SequencerRecipeWrapper extends BlankRecipeWrapper {
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInputs(ItemStack.class, Arrays.asList(
|
||||
input,
|
||||
GeneticsItems.FluorescentDye.get(1),
|
||||
new ItemStack(Genetics.items().database)
|
||||
input,
|
||||
GeneticsItems.FluorescentDye.get(1),
|
||||
new ItemStack(Genetics.items().database)
|
||||
));
|
||||
|
||||
ingredients.setOutput(ItemStack.class, GeneticsItems.EmptySequencer.get(1));
|
||||
|
||||
@@ -16,7 +16,7 @@ public enum GeneticLiquid implements IFluidType {
|
||||
|
||||
String name;
|
||||
String ident;
|
||||
// IIcon icon;
|
||||
//IIcon icon;
|
||||
int colour;
|
||||
float transparency;
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemAnalyst extends ItemCore {
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(final IIconRegister register) {
|
||||
// this.itemIcon = Genetics.proxy.getIcon(register, "analyst");
|
||||
// }
|
||||
/*@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = Genetics.proxy.getIcon(register, "analyst");
|
||||
}*/
|
||||
|
||||
public ItemAnalyst() {
|
||||
super("analyst");
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.genetics.item;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.core.GeneticsGUI;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
@@ -75,5 +74,4 @@ public class ItemBeeDictionary extends Item implements IItemModelRegister {
|
||||
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(this, 1, new ModelResourceLocation(getRegistryName().toString() + "_master", "inventory"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class ItemDatabase extends ItemCore {
|
||||
}
|
||||
|
||||
Genetics.proxy.openGui(id, player, player.getPosition());
|
||||
|
||||
|
||||
return new ActionResult(EnumActionResult.PASS, itemStack);
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ public class ItemDatabase extends ItemCore {
|
||||
public String getItemStackDisplayName(ItemStack itemStack) {
|
||||
return Genetics.proxy.localise(isMaster(itemStack) ? "item.database.master.name" : "item.database.name");
|
||||
}
|
||||
|
||||
protected boolean isMaster(ItemStack itemStack){
|
||||
|
||||
protected boolean isMaster(ItemStack itemStack) {
|
||||
return itemStack.getItemDamage() > 0;
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public abstract class ItemGene extends ItemCore implements IColoredItem {
|
||||
gene.getInfo(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int getCharges(final ItemStack stack) {
|
||||
return stack.getMaxDamage() - stack.getItemDamage();
|
||||
}
|
||||
@@ -53,10 +53,10 @@ public abstract class ItemGene extends ItemCore implements IColoredItem {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public abstract void getSubItems(Item item, final CreativeTabs tab, final NonNullList<ItemStack> subItems);
|
||||
|
||||
|
||||
@Nullable
|
||||
public abstract IGeneItem getGeneItem(ItemStack itemStack);
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getColorFromItemstack(ItemStack stack, int tintIndex) {
|
||||
@@ -66,7 +66,7 @@ public abstract class ItemGene extends ItemCore implements IColoredItem {
|
||||
}
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getShareTag() {
|
||||
return true;
|
||||
|
||||
@@ -11,11 +11,11 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemMasterRegistry extends ItemCore {
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(final IIconRegister register) {
|
||||
// this.itemIcon = Genetics.proxy.getIcon(register, "masterRegistry");
|
||||
// }
|
||||
/*@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = Genetics.proxy.getIcon(register, "masterRegistry");
|
||||
}*/
|
||||
|
||||
public ItemMasterRegistry() {
|
||||
super("master_registry");
|
||||
|
||||
@@ -32,5 +32,4 @@ public class ItemPunnettSquare extends Item {
|
||||
ItemStack itemStack = playerIn.getHeldItem(handIn);
|
||||
return new ActionResult<>(EnumActionResult.PASS, itemStack);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,11 +11,11 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemRegistry extends ItemCore {
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(final IIconRegister register) {
|
||||
// this.itemIcon = Genetics.proxy.getIcon(register, "registry");
|
||||
// }
|
||||
/*@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = Genetics.proxy.getIcon(register, "registry");
|
||||
}*/
|
||||
|
||||
public ItemRegistry() {
|
||||
super("registry");
|
||||
|
||||
@@ -33,6 +33,18 @@ public class ItemSequence extends ItemCore implements IItemAnalysable, IItemChar
|
||||
this.setCreativeTab(CreativeTabGenetics.instance);
|
||||
}
|
||||
|
||||
public static ItemStack create(final IGene gene) {
|
||||
return create(gene, false);
|
||||
}
|
||||
|
||||
public static ItemStack create(final IGene gene, final boolean sequenced) {
|
||||
final ItemStack item = new ItemStack(Genetics.items().itemSequencer);
|
||||
item.setItemDamage(sequenced ? 0 : item.getMaxDamage());
|
||||
final SequencerItem seq = new SequencerItem(gene);
|
||||
seq.writeToItem(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
GeneItem gene = GeneItem.create(itemstack);
|
||||
@@ -93,18 +105,6 @@ public class ItemSequence extends ItemCore implements IItemAnalysable, IItemChar
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public static ItemStack create(final IGene gene) {
|
||||
return create(gene, false);
|
||||
}
|
||||
|
||||
public static ItemStack create(final IGene gene, final boolean sequenced) {
|
||||
final ItemStack item = new ItemStack(Genetics.items().itemSequencer);
|
||||
item.setItemDamage(sequenced ? 0 : item.getMaxDamage());
|
||||
final SequencerItem seq = new SequencerItem(gene);
|
||||
seq.writeToItem(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharges(final ItemStack itemStack) {
|
||||
return itemStack.getMaxDamage() - itemStack.getItemDamage();
|
||||
|
||||
@@ -30,6 +30,14 @@ public class ItemSerum extends ItemGene implements IItemSerum {
|
||||
this.setMaxDamage(16);
|
||||
}
|
||||
|
||||
public static ItemStack create(final IGene gene) {
|
||||
final ItemStack item = new ItemStack(Genetics.items().itemSerum);
|
||||
item.setItemDamage(item.getMaxDamage());
|
||||
final GeneItem seq = new GeneItem(gene);
|
||||
seq.writeToItem(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharges(ItemStack itemStack) {
|
||||
return itemStack.getMaxDamage() - itemStack.getItemDamage();
|
||||
@@ -104,12 +112,4 @@ public class ItemSerum extends ItemGene implements IItemSerum {
|
||||
geneI.writeToItem(stack);
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ItemStack create(final IGene gene) {
|
||||
final ItemStack item = new ItemStack(Genetics.items().itemSerum);
|
||||
item.setItemDamage(item.getMaxDamage());
|
||||
final GeneItem seq = new GeneItem(gene);
|
||||
seq.writeToItem(item);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,12 @@ import binnie.genetics.api.IItemSerum;
|
||||
import binnie.genetics.genetics.GeneArrayItem;
|
||||
import binnie.genetics.genetics.IGeneItem;
|
||||
import com.google.common.base.Preconditions;
|
||||
import forestry.api.genetics.*;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosome;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -25,6 +30,14 @@ public class ItemSerumArray extends ItemGene implements IItemSerum {
|
||||
this.setMaxDamage(16);
|
||||
}
|
||||
|
||||
public static ItemStack create(final IGene gene) {
|
||||
final ItemStack item = new ItemStack(Genetics.items().itemSerumArray);
|
||||
item.setItemDamage(item.getMaxDamage());
|
||||
final GeneArrayItem seq = new GeneArrayItem(gene);
|
||||
seq.writeToItem(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCharges(final ItemStack itemStack) {
|
||||
return itemStack.getMaxDamage() - itemStack.getItemDamage();
|
||||
@@ -114,12 +127,4 @@ public class ItemSerumArray extends ItemGene implements IItemSerum {
|
||||
geneItem.writeToItem(stack);
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ItemStack create(final IGene gene) {
|
||||
final ItemStack item = new ItemStack(Genetics.items().itemSerumArray);
|
||||
item.setItemDamage(item.getMaxDamage());
|
||||
final GeneArrayItem seq = new GeneArrayItem(gene);
|
||||
seq.writeToItem(item);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
@@ -40,9 +40,6 @@ public class ModuleItems implements IInitializable {
|
||||
public static BinnieSprite iconArrow0;
|
||||
public static BinnieSprite iconAdd1;
|
||||
public static BinnieSprite iconArrow1;
|
||||
|
||||
@Nullable
|
||||
private Item itemGenetics;
|
||||
public ItemSerum itemSerum;
|
||||
public ItemSequence itemSequencer;
|
||||
public ItemDatabase database;
|
||||
@@ -50,14 +47,16 @@ public class ModuleItems implements IInitializable {
|
||||
public Item registry;
|
||||
public Item masterRegistry;
|
||||
public ItemSerumArray itemSerumArray = null;
|
||||
|
||||
@Nullable
|
||||
private Item itemGenetics;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
itemSerum = new ItemSerum();
|
||||
Genetics.proxy.registerItem(itemSerum);
|
||||
itemSerumArray = new ItemSerumArray();
|
||||
Genetics.proxy.registerItem(itemSerumArray);
|
||||
|
||||
|
||||
database = new ItemDatabase();
|
||||
Genetics.proxy.registerItem(database);
|
||||
analyst = new ItemAnalyst();
|
||||
@@ -73,7 +72,7 @@ public class ModuleItems implements IInitializable {
|
||||
|
||||
Binnie.LIQUID.createLiquids(GeneticLiquid.values());
|
||||
}
|
||||
|
||||
|
||||
public Item getItemGenetics() {
|
||||
Preconditions.checkState(itemGenetics != null);
|
||||
return itemGenetics;
|
||||
@@ -101,72 +100,84 @@ public class ModuleItems implements IInitializable {
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addShapelessRecipe(GeneticsItems.DNADye.get(8),
|
||||
Items.GLOWSTONE_DUST, new ItemStack(Items.DYE, 1, 5));
|
||||
Items.GLOWSTONE_DUST, new ItemStack(Items.DYE, 1, 5)
|
||||
);
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticsItems.LaboratoryCasing.get(itemGenetics, 1),
|
||||
"iii",
|
||||
"iYi",
|
||||
"iii",
|
||||
'i', "ingotIron", 'Y', Mods.Forestry.item("sturdy_machine")));
|
||||
"iii",
|
||||
"iYi",
|
||||
"iii",
|
||||
'i', "ingotIron", 'Y', Mods.Forestry.item("sturdy_machine")
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(GeneticsItems.DNADye.get(itemGenetics, 2), "dyePurple", "dyeMagenta", "dyePink"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(GeneticsItems.FluorescentDye.get(itemGenetics, 2), "dyeOrange", "dyeYellow", "dustGlowstone"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(GeneticsItems.GrowthMedium.get(itemGenetics, 2), new ItemStack(Items.DYE, 1, 15), Items.SUGAR));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticsItems.EmptySequencer.get(itemGenetics, 1),
|
||||
" p ",
|
||||
"iGi",
|
||||
" p ",
|
||||
'i', "ingotGold", 'G', Blocks.GLASS_PANE, 'p', Items.PAPER));
|
||||
" p ",
|
||||
"iGi",
|
||||
" p ",
|
||||
'i', "ingotGold", 'G', Blocks.GLASS_PANE, 'p', Items.PAPER
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticsItems.EMPTY_SERUM.get(itemGenetics, 1),
|
||||
" g ",
|
||||
" G ",
|
||||
"GGG",
|
||||
'g', "ingotGold", 'G', Blocks.GLASS_PANE));
|
||||
" g ",
|
||||
" G ",
|
||||
"GGG",
|
||||
'g', "ingotGold", 'G', Blocks.GLASS_PANE
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticsItems.EMPTY_GENOME.get(itemGenetics, 1),
|
||||
"sss",
|
||||
"sss",
|
||||
"sss",
|
||||
's', GeneticsItems.EMPTY_SERUM.get(itemGenetics, 1)));
|
||||
"sss",
|
||||
"sss",
|
||||
"sss",
|
||||
's', GeneticsItems.EMPTY_SERUM.get(itemGenetics, 1)
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(FluidContainerType.CYLINDER.get(8),
|
||||
" g ",
|
||||
"g g",
|
||||
" ",
|
||||
'g', Blocks.GLASS_PANE));
|
||||
" g ",
|
||||
"g g",
|
||||
" ",
|
||||
'g', Blocks.GLASS_PANE
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticsItems.IntegratedCircuit.get(itemGenetics, 1),
|
||||
"l g",
|
||||
" c ",
|
||||
"g l",
|
||||
'c', Mods.Forestry.stack("chipsets", 1, 1), 'l', new ItemStack(Items.DYE, 1, 4), 'g', "dustGlowstone"));
|
||||
"l g",
|
||||
" c ",
|
||||
"g l",
|
||||
'c', Mods.Forestry.stack("chipsets", 1, 1), 'l', new ItemStack(Items.DYE, 1, 4), 'g', "dustGlowstone"
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticsItems.IntegratedCircuit.get(itemGenetics, 1),
|
||||
"g l",
|
||||
" c ",
|
||||
"l g",
|
||||
'c', Mods.Forestry.stack("chipsets", 1, 1), 'l', new ItemStack(Items.DYE, 1, 4), 'g', "dustGlowstone"));
|
||||
"g l",
|
||||
" c ",
|
||||
"l g",
|
||||
'c', Mods.Forestry.stack("chipsets", 1, 1), 'l', new ItemStack(Items.DYE, 1, 4), 'g', "dustGlowstone"
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticsItems.IntegratedCasing.get(itemGenetics, 1),
|
||||
"ccc",
|
||||
"cdc",
|
||||
"ccc",
|
||||
'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'd', GeneticsItems.LaboratoryCasing.get(itemGenetics, 1)));
|
||||
"ccc",
|
||||
"cdc",
|
||||
"ccc",
|
||||
'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'd', GeneticsItems.LaboratoryCasing.get(itemGenetics, 1)
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticsItems.IntegratedCPU.get(itemGenetics, 1),
|
||||
"ccc",
|
||||
"cdc",
|
||||
"ccc",
|
||||
'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'd', Items.DIAMOND));
|
||||
"ccc",
|
||||
"cdc",
|
||||
"ccc",
|
||||
'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'd', Items.DIAMOND
|
||||
));
|
||||
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.LIQUID.getFluidStack("water", 2000), ItemStack.EMPTY,
|
||||
new ItemStack(database),
|
||||
"X#X",
|
||||
"YEY",
|
||||
"RDR",
|
||||
'#', Blocks.GLASS_PANE, 'X', Items.DIAMOND, 'Y', Items.DIAMOND, 'R', Items.REDSTONE, 'D', Items.ENDER_EYE, 'E', Blocks.OBSIDIAN);
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.LIQUID.getFluidStack("water", 2000), ItemStack.EMPTY,
|
||||
new ItemStack(database),
|
||||
"X#X",
|
||||
"YEY",
|
||||
"RDR",
|
||||
'#', Blocks.GLASS_PANE, 'X', Items.DIAMOND, 'Y', Items.DIAMOND, 'R', Items.REDSTONE, 'D', Items.ENDER_EYE, 'E', Blocks.OBSIDIAN
|
||||
);
|
||||
GameRegistry.addSmelting(itemSequencer, GeneticsItems.EmptySequencer.get(itemGenetics, 1), 0.0f);
|
||||
GameRegistry.addSmelting(itemSerum, GeneticsItems.EMPTY_SERUM.get(itemGenetics, 1), 0.0f);
|
||||
GameRegistry.addSmelting(itemSerumArray, GeneticsItems.EMPTY_GENOME.get(itemGenetics, 1), 0.0f);
|
||||
|
||||
GameRegistry.addShapedRecipe(new ItemStack(analyst),
|
||||
" c ",
|
||||
"cac",
|
||||
" d ",
|
||||
'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'a', Mods.Forestry.item("portable_alyzer"), 'd', new ItemStack(Items.DIAMOND));
|
||||
" c ",
|
||||
"cac",
|
||||
" d ",
|
||||
'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'a', Mods.Forestry.item("portable_alyzer"), 'd', new ItemStack(Items.DIAMOND)
|
||||
);
|
||||
|
||||
Item[] databases = {ExtraBeesIntegration.dictionary, ExtraTrees.items().itemDictionary, ExtraTrees.items().itemDictionaryLepi, Botany.database};
|
||||
if (BinnieCore.isBotanyActive() && BinnieCore.isExtraBeesActive() && BinnieCore.isExtraTreesActive()) {
|
||||
@@ -175,10 +186,11 @@ public class ModuleItems implements IInitializable {
|
||||
for (Item databaseC : databases) {
|
||||
for (Item databaseD : databases) {
|
||||
if (databaseA != databaseB && databaseA != databaseC && databaseA != databaseD && databaseB != databaseC && databaseB != databaseD && databaseC != databaseD) {
|
||||
GameRegistry.addShapedRecipe(new ItemStack(registry),
|
||||
" b ",
|
||||
"fct",
|
||||
" l ", 'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'b', databaseA, 't', databaseB, 'f', databaseC, 'l', databaseD);
|
||||
GameRegistry.addShapedRecipe(new ItemStack(registry),
|
||||
" b ",
|
||||
"fct",
|
||||
" l ", 'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'b', databaseA, 't', databaseB, 'f', databaseC, 'l', databaseD
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,5 +21,4 @@ public class ComponentGeneticGUI extends MachineComponent implements IInteractio
|
||||
public void onRightClick(World p0, EntityPlayer player, BlockPos pos) {
|
||||
Genetics.proxy.openGui(this.id, player, pos);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package binnie.genetics.machine;
|
||||
|
||||
import binnie.core.machines.*;
|
||||
import binnie.core.machines.IMachine;
|
||||
import binnie.core.machines.IMachineType;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
import binnie.core.machines.MachinePackage;
|
||||
import binnie.core.machines.component.IInteraction;
|
||||
import binnie.core.machines.network.INetwork;
|
||||
import binnie.genetics.Genetics;
|
||||
@@ -54,10 +58,10 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
new ComponentGUIHolder(machine);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void renderMachine(final Machine machine, final double x, final double y, final double z, final float var8, final RenderBlocks renderer) {
|
||||
// MachineRendererLab.instance.renderMachine(machine, this.colour, this.renderTexture, x, y, z, var8);
|
||||
// }
|
||||
/*@Override
|
||||
public void renderMachine(final Machine machine, final double x, final double y, final double z, final float var8, final RenderBlocks renderer) {
|
||||
MachineRendererLab.instance.renderMachine(machine, this.colour, this.renderTexture, x, y, z, var8);
|
||||
}*/
|
||||
}
|
||||
|
||||
public static class ComponentGUIHolder extends MachineComponent implements INetwork.TilePacketSync, IInteraction.RightClick {
|
||||
@@ -121,54 +125,54 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
public void onRightClick(World p0, EntityPlayer p1, BlockPos pos) {
|
||||
|
||||
}
|
||||
// @Override
|
||||
// public void onRightClick(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
// if (BinnieCore.proxy.isSimulating(world) && player.getHeldItem() != null) {
|
||||
// if (!this.stack.isEmpty() && player.getHeldItem().getItem() instanceof IToolWrench) {
|
||||
// final float f = 0.7f;
|
||||
// final double d0 = world.rand.nextFloat() * f + (1.0f - f) * 0.5;
|
||||
// final double d2 = world.rand.nextFloat() * f + (1.0f - f) * 0.5;
|
||||
// final double d3 = world.rand.nextFloat() * f + (1.0f - f) * 0.5;
|
||||
// final EntityItem entityitem = new EntityItem(world, x + d0, y + d2, z + d3, this.stack);
|
||||
// entityitem.delayBeforeCanPickup = 10;
|
||||
// world.spawnEntity(entityitem);
|
||||
// this.stack = null;
|
||||
// ((IToolWrench) player.getHeldItem().getItem()).wrenchUsed(player, x, y, z);
|
||||
// this.getUtil().refreshBlock();
|
||||
// return;
|
||||
// }
|
||||
// final List<Item> validSelections = new ArrayList<Item>();
|
||||
// if (BinnieCore.isBotanyActive()) {
|
||||
// validSelections.add(Botany.database);
|
||||
// }
|
||||
// if (BinnieCore.isExtraBeesActive()) {
|
||||
// validSelections.add(ExtraBees.dictionary);
|
||||
// }
|
||||
// if (BinnieCore.isExtraTreesActive()) {
|
||||
// validSelections.add(ExtraTrees.itemDictionary);
|
||||
// }
|
||||
// if (BinnieCore.isLepidopteryActive()) {
|
||||
// validSelections.add(ExtraTrees.itemDictionaryLepi);
|
||||
// }
|
||||
// validSelections.add(Genetics.database);
|
||||
// validSelections.add(Genetics.analyst);
|
||||
// validSelections.add(Genetics.registry);
|
||||
// validSelections.add(Genetics.masterRegistry);
|
||||
// validSelections.add(BinnieCore.genesis);
|
||||
// if (this.stack.isEmpty() && validSelections.contains(player.getHeldItem().getItem())) {
|
||||
// this.stack = player.getHeldItem().copy();
|
||||
// final ItemStack heldItem = player.getHeldItem();
|
||||
// heldItem.shrink(1);
|
||||
// world.markBlockForUpdate(x, y, z);
|
||||
// return;
|
||||
// }
|
||||
// if (!this.stack.isEmpty() && player.getHeldItem().getItem() instanceof IToolWrench) {
|
||||
// this.stack.getItem().onItemRightClick(this.stack, world, player);
|
||||
// }
|
||||
// }
|
||||
// if (!this.stack.isEmpty()) {
|
||||
// this.stack.getItem().onItemRightClick(this.stack, world, player);
|
||||
// }
|
||||
// }
|
||||
/*@Override
|
||||
public void onRightClick(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
if (BinnieCore.proxy.isSimulating(world) && player.getHeldItem() != null) {
|
||||
if (!this.stack.isEmpty() && player.getHeldItem().getItem() instanceof IToolWrench) {
|
||||
final float f = 0.7f;
|
||||
final double d0 = world.rand.nextFloat() * f + (1.0f - f) * 0.5;
|
||||
final double d2 = world.rand.nextFloat() * f + (1.0f - f) * 0.5;
|
||||
final double d3 = world.rand.nextFloat() * f + (1.0f - f) * 0.5;
|
||||
final EntityItem entityitem = new EntityItem(world, x + d0, y + d2, z + d3, this.stack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
world.spawnEntity(entityitem);
|
||||
this.stack = null;
|
||||
((IToolWrench) player.getHeldItem().getItem()).wrenchUsed(player, x, y, z);
|
||||
this.getUtil().refreshBlock();
|
||||
return;
|
||||
}
|
||||
final List<Item> validSelections = new ArrayList<Item>();
|
||||
if (BinnieCore.isBotanyActive()) {
|
||||
validSelections.add(Botany.database);
|
||||
}
|
||||
if (BinnieCore.isExtraBeesActive()) {
|
||||
validSelections.add(ExtraBees.dictionary);
|
||||
}
|
||||
if (BinnieCore.isExtraTreesActive()) {
|
||||
validSelections.add(ExtraTrees.itemDictionary);
|
||||
}
|
||||
if (BinnieCore.isLepidopteryActive()) {
|
||||
validSelections.add(ExtraTrees.itemDictionaryLepi);
|
||||
}
|
||||
validSelections.add(Genetics.database);
|
||||
validSelections.add(Genetics.analyst);
|
||||
validSelections.add(Genetics.registry);
|
||||
validSelections.add(Genetics.masterRegistry);
|
||||
validSelections.add(BinnieCore.genesis);
|
||||
if (this.stack.isEmpty() && validSelections.contains(player.getHeldItem().getItem())) {
|
||||
this.stack = player.getHeldItem().copy();
|
||||
final ItemStack heldItem = player.getHeldItem();
|
||||
heldItem.shrink(1);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (!this.stack.isEmpty() && player.getHeldItem().getItem() instanceof IToolWrench) {
|
||||
this.stack.getItem().onItemRightClick(this.stack, world, player);
|
||||
}
|
||||
}
|
||||
if (!this.stack.isEmpty()) {
|
||||
this.stack.getItem().onItemRightClick(this.stack, world, player);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@@ -34,5 +34,4 @@ public class MachineRendererGenetics {
|
||||
}
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -91,5 +91,4 @@ public class MachineRendererLab {
|
||||
}
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class ModuleMachine implements IInitializable {
|
||||
public static ValidatorSprite spriteDye;
|
||||
public static ValidatorSprite spriteBacteria;
|
||||
public static ValidatorSprite spriteNugget;
|
||||
|
||||
|
||||
public static MachineGroup packageGenetic;
|
||||
public static MachineGroup packageAdvGenetic;
|
||||
public static MachineGroup packageLabMachine;
|
||||
|
||||
@@ -17,7 +17,11 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Acclimatiser {
|
||||
public static final int[] SLOT_RESERVE = new int[]{0, 1, 2, 3};
|
||||
|
||||
@@ -3,7 +3,12 @@ package binnie.genetics.machine.acclimatiser;
|
||||
import binnie.core.genetics.Gene;
|
||||
import binnie.core.genetics.Tolerance;
|
||||
import binnie.genetics.machine.inoculator.Inoculator;
|
||||
import forestry.api.genetics.*;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAlleleTolerance;
|
||||
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;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package binnie.genetics.machine.acclimatiser;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.minecraft.control.*;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.machine.craftgui.WindowMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -52,5 +56,4 @@ public class WindowAcclimatiser extends WindowMachine {
|
||||
protected String getBackgroundTextureName() {
|
||||
return "acclimatiser";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,11 @@ package binnie.genetics.machine.analyser;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.*;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.genetics.core.GeneticsGUI;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
package binnie.genetics.machine.analyser;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.minecraft.GUIIcon;
|
||||
import binnie.core.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.core.craftgui.minecraft.control.*;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlProgress;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.craftgui.window.Panel;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
import binnie.genetics.machine.craftgui.WindowMachine;
|
||||
@@ -66,5 +73,4 @@ public class WindowAnalyser extends WindowMachine {
|
||||
protected String getBackgroundTextureName() {
|
||||
return "analyser";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -76,13 +76,13 @@ public class ControlGeneScroll extends Control implements IControlValue<Breeding
|
||||
this.setSize(new Point(this.getSize().x(), y));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final BreedingSystem system) {
|
||||
this.setGenes(system);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BreedingSystem getValue() {
|
||||
return this.system;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final BreedingSystem system) {
|
||||
this.setGenes(system);
|
||||
}
|
||||
}
|
||||
@@ -37,10 +37,19 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class WindowGeneBank extends WindowMachine {
|
||||
// public static IIcon[] iconsDNA;
|
||||
//public static IIcon[] iconsDNA;
|
||||
public boolean isNei;
|
||||
ControlGeneScroll genes;
|
||||
|
||||
public WindowGeneBank(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
this(player, inventory, side, false);
|
||||
}
|
||||
|
||||
public WindowGeneBank(final EntityPlayer player, final IInventory inventory, final Side side, final boolean isNEI) {
|
||||
super(320, 224, player, inventory, side);
|
||||
this.isNei = isNEI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveGuiNBTOnServer(final EntityPlayer player, final String name, final NBTTagCompound nbt) {
|
||||
super.receiveGuiNBTOnServer(player, name, nbt);
|
||||
@@ -58,15 +67,6 @@ public class WindowGeneBank extends WindowMachine {
|
||||
}
|
||||
}
|
||||
|
||||
public WindowGeneBank(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
this(player, inventory, side, false);
|
||||
}
|
||||
|
||||
public WindowGeneBank(final EntityPlayer player, final IInventory inventory, final Side side, final boolean isNEI) {
|
||||
super(320, 224, player, inventory, side);
|
||||
this.isNei = isNEI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseServer() {
|
||||
final GeneTracker tracker = GeneTracker.getTracker(this.getWorld(), this.getUsername());
|
||||
|
||||
@@ -8,14 +8,14 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowGenomeAssembler extends WindowMachine {
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowGenomeAssembler(player, inventory, side);
|
||||
}
|
||||
|
||||
public WindowGenomeAssembler(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(320, 240, player, inventory, side);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowGenomeAssembler(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Genome Assembler";
|
||||
|
||||
@@ -14,6 +14,12 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class GenepoolLogic extends ComponentProcessSetCost implements IProcess {
|
||||
public static final float ENZYME_PER_PROCESS = 0.25f;
|
||||
private float ethanolDrain;
|
||||
|
||||
public GenepoolLogic(final Machine machine) {
|
||||
super(machine, 8000, 400);
|
||||
this.ethanolDrain = 0.0f;
|
||||
}
|
||||
|
||||
public static int getDNAAmount(final ItemStack stack) {
|
||||
final ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(stack);
|
||||
@@ -31,13 +37,6 @@ public class GenepoolLogic extends ComponentProcessSetCost implements IProcess {
|
||||
return 10;
|
||||
}
|
||||
|
||||
private float ethanolDrain;
|
||||
|
||||
public GenepoolLogic(final Machine machine) {
|
||||
super(machine, 8000, 400);
|
||||
this.ethanolDrain = 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErrorState canWork() {
|
||||
if (this.getUtil().isSlotEmpty(Genepool.SLOT_BEE)) {
|
||||
|
||||
@@ -3,7 +3,14 @@ package binnie.genetics.machine.genepool;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.*;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
import binnie.core.machines.inventory.ComponentTankContainer;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.inventory.TankSlot;
|
||||
import binnie.core.machines.inventory.TankValidator;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.genetics.core.GeneticsGUI;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
package binnie.genetics.machine.genepool;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.minecraft.GUIIcon;
|
||||
import binnie.core.craftgui.minecraft.control.*;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.core.craftgui.minecraft.control.ControlMachineProgress;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.machine.craftgui.WindowMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -60,5 +68,4 @@ public class WindowGenepool extends WindowMachine {
|
||||
protected String getBackgroundTextureName() {
|
||||
return "genepool";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class Incubator {
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(new ItemStack(Items.WHEAT), GeneticLiquid.GrowthMedium.get(25), GeneticLiquid.Bacteria.get(5), 0.2f));
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(GeneticsItems.GrowthMedium.get(1), GeneticLiquid.Bacteria.get(0), GeneticLiquid.Bacteria.get(5), 0.05f));
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(new ItemStack(Items.SUGAR), GeneticLiquid.Bacteria.get(2), null, 0.5f, 0.2f)
|
||||
.setOutputStack(GeneticsItems.Enzyme.get(1)));
|
||||
.setOutputStack(GeneticsItems.Enzyme.get(1)));
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(GeneticsItems.GrowthMedium.get(1), GeneticLiquid.BacteriaPoly.get(0), GeneticLiquid.BacteriaPoly.get(5), 0.05f));
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(GeneticsItems.GrowthMedium.get(1), GeneticLiquid.BacteriaVector.get(0), GeneticLiquid.BacteriaVector.get(5), 0.05f));
|
||||
Incubator.RECIPES.add(new IncubatorRecipe(new ItemStack(Items.DYE, 1, 15), GeneticLiquid.Bacteria.get(10), GeneticLiquid.BacteriaPoly.get(10), 0.1f));
|
||||
@@ -69,5 +69,4 @@ public class Incubator {
|
||||
public static IncubatorRecipeLarvae getLarvaeRecipe() {
|
||||
return LARVAE_RECIPE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,10 @@ public class IncubatorLogic extends ComponentProcessIndefinate implements IProce
|
||||
this.roomForOutput = true;
|
||||
}
|
||||
|
||||
private static boolean isStackValid(ItemStack stack, IIncubatorRecipe recipe) {
|
||||
return ItemStack.areItemsEqual(recipe.getInputStack(), stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErrorState canWork() {
|
||||
if (this.recipe == null) {
|
||||
@@ -71,10 +75,6 @@ public class IncubatorLogic extends ComponentProcessIndefinate implements IProce
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isStackValid(ItemStack stack, IIncubatorRecipe recipe) {
|
||||
return ItemStack.areItemsEqual(recipe.getInputStack(), stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoryUpdate() {
|
||||
super.onInventoryUpdate();
|
||||
|
||||
@@ -3,7 +3,14 @@ package binnie.genetics.machine.incubator;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.minecraft.GUIIcon;
|
||||
import binnie.core.craftgui.minecraft.control.*;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.core.craftgui.minecraft.control.ControlMachineProgress;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
@@ -62,5 +69,4 @@ public class WindowIncubator extends WindowMachine {
|
||||
protected String getBackgroundTextureName() {
|
||||
return "incubator";
|
||||
}
|
||||
|
||||
}
|
||||
+18
-19
@@ -15,24 +15,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ComponentApiaristIndexerInventory extends ComponentIndexerInventory<ComponentApiaristIndexerInventory.Mode> implements IInventory {
|
||||
private static class SpeciesList {
|
||||
public List<Integer> drones;
|
||||
public List<Integer> queens;
|
||||
public List<Integer> princesses;
|
||||
public List<ItemStack> bees;
|
||||
|
||||
SpeciesList() {
|
||||
this.drones = new ArrayList<>();
|
||||
this.queens = new ArrayList<>();
|
||||
this.princesses = new ArrayList<>();
|
||||
this.bees = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void add(final ItemStack stack) {
|
||||
this.bees.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
public ComponentApiaristIndexerInventory(final Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
@@ -138,7 +120,6 @@ public class ComponentApiaristIndexerInventory extends ComponentIndexerInventory
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return this.sortedInventory.isEmpty();
|
||||
@@ -184,4 +165,22 @@ public class ComponentApiaristIndexerInventory extends ComponentIndexerInventory
|
||||
Species,
|
||||
Type;
|
||||
}
|
||||
|
||||
private static class SpeciesList {
|
||||
public List<Integer> drones;
|
||||
public List<Integer> queens;
|
||||
public List<Integer> princesses;
|
||||
public List<ItemStack> bees;
|
||||
|
||||
SpeciesList() {
|
||||
this.drones = new ArrayList<>();
|
||||
this.queens = new ArrayList<>();
|
||||
this.princesses = new ArrayList<>();
|
||||
this.bees = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void add(final ItemStack stack) {
|
||||
this.bees.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,10 @@ import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ComponentIndexerInventory<T> extends ComponentInventory implements IInventory {
|
||||
int indexerSize;
|
||||
public int guiRefreshCounter;
|
||||
List<ItemStack> indexerInventory;
|
||||
public List<Integer> sortedInventory;
|
||||
int indexerSize;
|
||||
List<ItemStack> indexerInventory;
|
||||
@Nullable
|
||||
T sortingMode;
|
||||
boolean needsSorting;
|
||||
@@ -74,15 +74,15 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public ItemStack getStackInSlotOnClosing(final int var1) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getInventoryName() {
|
||||
// return "";
|
||||
// }
|
||||
/*@Override
|
||||
public ItemStack getStackInSlotOnClosing(final int var1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "";
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
@@ -94,24 +94,24 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void openInventory() {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void closeInventory() {
|
||||
// }
|
||||
|
||||
public void setMode(final T mode) {
|
||||
this.sortingMode = mode;
|
||||
this.needsSorting = true;
|
||||
/*@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}*/
|
||||
|
||||
@Nullable
|
||||
public T getMode() {
|
||||
return this.sortingMode;
|
||||
}
|
||||
|
||||
public void setMode(final T mode) {
|
||||
this.sortingMode = mode;
|
||||
this.needsSorting = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(final NBTTagCompound nbttagcompound2) {
|
||||
NBTTagCompound nbttagcompound = super.writeToNBT(nbttagcompound2);
|
||||
@@ -139,5 +139,4 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
|
||||
public abstract void Sort();
|
||||
|
||||
}
|
||||
@@ -23,6 +23,12 @@ public class InoculatorLogic extends ComponentProcess implements IProcess {
|
||||
public static final int PROCESS_BASE_LENGTH = 12000;
|
||||
public static final int PROCESS_BASE_ENERGY = 600000;
|
||||
public static final int BACTERIA_PER_PROCESS = 15;
|
||||
private float bacteriaDrain;
|
||||
|
||||
public InoculatorLogic(final Machine machine) {
|
||||
super(machine);
|
||||
this.bacteriaDrain = 0.0f;
|
||||
}
|
||||
|
||||
public static int getProcessLength(ItemStack itemStack) {
|
||||
return PROCESS_BASE_LENGTH * getNumberOfGenes(itemStack);
|
||||
@@ -39,11 +45,24 @@ public class InoculatorLogic extends ComponentProcess implements IProcess {
|
||||
return Engineering.getGenes(serum).length;
|
||||
}
|
||||
|
||||
private float bacteriaDrain;
|
||||
|
||||
public InoculatorLogic(final Machine machine) {
|
||||
super(machine);
|
||||
this.bacteriaDrain = 0.0f;
|
||||
public static ItemStack applySerum(ItemStack target, ItemStack serum) {
|
||||
ItemStack applied = target.copy();
|
||||
final IIndividual ind = AlleleManager.alleleRegistry.getIndividual(applied);
|
||||
if (!ind.isAnalyzed()) {
|
||||
ind.analyze();
|
||||
final NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
ind.writeToNBT(nbttagcompound);
|
||||
applied.setTagCompound(nbttagcompound);
|
||||
}
|
||||
final IGene[] genes = ((IItemSerum) serum.getItem()).getGenes(serum);
|
||||
for (final IGene gene : genes) {
|
||||
Inoculator.setGene(gene, applied, 0);
|
||||
Inoculator.setGene(gene, applied, 1);
|
||||
}
|
||||
if (applied.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
|
||||
applied.setItemDamage(0);
|
||||
}
|
||||
return applied;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,26 +150,6 @@ public class InoculatorLogic extends ComponentProcess implements IProcess {
|
||||
util.damageItem(serum, Inoculator.SLOT_SERUM_VIAL, 1);
|
||||
}
|
||||
|
||||
public static ItemStack applySerum(ItemStack target, ItemStack serum) {
|
||||
ItemStack applied = target.copy();
|
||||
final IIndividual ind = AlleleManager.alleleRegistry.getIndividual(applied);
|
||||
if (!ind.isAnalyzed()) {
|
||||
ind.analyze();
|
||||
final NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
ind.writeToNBT(nbttagcompound);
|
||||
applied.setTagCompound(nbttagcompound);
|
||||
}
|
||||
final IGene[] genes = ((IItemSerum) serum.getItem()).getGenes(serum);
|
||||
for (final IGene gene : genes) {
|
||||
Inoculator.setGene(gene, applied, 0);
|
||||
Inoculator.setGene(gene, applied, 1);
|
||||
}
|
||||
if (applied.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
|
||||
applied.setItemDamage(0);
|
||||
}
|
||||
return applied;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTickTask() {
|
||||
this.bacteriaDrain += BACTERIA_PER_PROCESS / (float) this.getProcessLength();
|
||||
|
||||
@@ -5,7 +5,12 @@ import binnie.core.machines.IMachine;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.MachineUtil;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.*;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
import binnie.core.machines.inventory.ComponentTankContainer;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.inventory.Validator;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.genetics.api.IItemSerum;
|
||||
import binnie.genetics.core.GeneticsGUI;
|
||||
|
||||
@@ -5,7 +5,14 @@ import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.craftgui.minecraft.GUIIcon;
|
||||
import binnie.core.craftgui.minecraft.control.*;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.core.craftgui.minecraft.control.ControlMachineProgress;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
@@ -32,11 +39,11 @@ public class WindowInoculator extends WindowMachine {
|
||||
final int y = 32;
|
||||
new ControlLiquidTank(this, x, y + 18 + 16).setTankID(0);
|
||||
CraftGUIUtil.horizontalGrid(x, y,
|
||||
new ControlSlotArray.Builder(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSlot.Builder(this, 0, 0).assign(0),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSlotArray.Builder(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_EXPENDED)
|
||||
new ControlSlotArray.Builder(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSlot.Builder(this, 0, 0).assign(0),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSlotArray.Builder(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_EXPENDED)
|
||||
);
|
||||
x += 18;
|
||||
new ControlMachineProgress(this, x, y + 24, WindowInoculator.ProgressBase, WindowInoculator.Progress, Position.LEFT);
|
||||
@@ -44,9 +51,9 @@ public class WindowInoculator extends WindowMachine {
|
||||
new ControlErrorState(this, 161, 118);
|
||||
x += 142;
|
||||
CraftGUIUtil.verticalGrid(x, y, TextJustification.MIDDLE_LEFTt, 8,
|
||||
new ControlSlotArray.Builder(this, x, y, 4, 1).create(Inoculator.SLOT_RESERVE),
|
||||
new ControlSlot.Builder(this, x, y + 18 + 8).assign(9),
|
||||
new ControlSlotArray.Builder(this, x, y + 18 + 8 + 18 + 8, 4, 1).create(Inoculator.SLOT_FINISHED)
|
||||
new ControlSlotArray.Builder(this, x, y, 4, 1).create(Inoculator.SLOT_RESERVE),
|
||||
new ControlSlot.Builder(this, x, y + 18 + 8).assign(9),
|
||||
new ControlSlotArray.Builder(this, x, y + 18 + 8 + 18 + 8, 4, 1).create(Inoculator.SLOT_FINISHED)
|
||||
);
|
||||
new ControlIconDisplay(this, x + 18, y + 18 + 2, GUIIcon.ARROW_UP_LEFT.getIcon().getResourceLocation());
|
||||
new ControlIconDisplay(this, x + 18, y + 18 + 18, GUIIcon.ARROW_LEFT_DOWN.getIcon().getResourceLocation());
|
||||
@@ -67,5 +74,4 @@ public class WindowInoculator extends WindowMachine {
|
||||
protected String getBackgroundTextureName() {
|
||||
return "inoculator";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,7 +9,12 @@ import binnie.core.machines.power.ErrorState;
|
||||
import binnie.core.machines.power.IProcess;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.item.ItemSequence;
|
||||
import forestry.api.genetics.*;
|
||||
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;
|
||||
|
||||
@@ -3,7 +3,13 @@ package binnie.genetics.machine.isolator;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.*;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
import binnie.core.machines.inventory.ComponentTankContainer;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.inventory.TankValidator;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.genetics.core.GeneticsGUI;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
package binnie.genetics.machine.isolator;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.minecraft.GUIIcon;
|
||||
import binnie.core.craftgui.minecraft.control.*;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlProgress;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.machine.craftgui.WindowMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -66,5 +74,4 @@ public class WindowIsolator extends WindowMachine {
|
||||
protected String getBackgroundTextureName() {
|
||||
return "isolator";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,13 @@ package binnie.genetics.machine.polymeriser;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.*;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
import binnie.core.machines.inventory.ComponentTankContainer;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.inventory.Validator;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.genetics.core.GeneticsGUI;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
|
||||
@@ -8,5 +8,4 @@ public class Polymeriser {
|
||||
public static final int SLOT_GOLD = 1;
|
||||
public static final int[] SLOT_SERUM_RESERVE = new int[]{2, 3, 4, 5};
|
||||
public static final int[] SLOT_SERUM_FINISHED = new int[]{6, 7, 8, 9};
|
||||
|
||||
}
|
||||
@@ -20,6 +20,21 @@ public class PolymeriserLogic extends ComponentProcessSetCost implements IProces
|
||||
this.bacteriaDrain = 0.0f;
|
||||
}
|
||||
|
||||
public static float getDNAPerProcess(ItemStack serum) {
|
||||
return getNumberOfGenes(serum) * 50;
|
||||
}
|
||||
|
||||
public static float getBacteriaPerProcess(ItemStack serum) {
|
||||
return 0.2f * getDNAPerProcess(serum);
|
||||
}
|
||||
|
||||
private static int getNumberOfGenes(ItemStack serum) {
|
||||
if (serum.isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
return Engineering.getGenes(serum).length;
|
||||
}
|
||||
|
||||
private float getCatalyst() {
|
||||
return (this.getUtil().getSlotCharge(Polymeriser.SLOT_GOLD) > 0.0f) ? 0.2f : 1.0f;
|
||||
}
|
||||
@@ -36,14 +51,6 @@ public class PolymeriserLogic extends ComponentProcessSetCost implements IProces
|
||||
return (int) (super.getProcessEnergy() * getNumberOfGenes(serum) * this.getCatalyst());
|
||||
}
|
||||
|
||||
public static float getDNAPerProcess(ItemStack serum) {
|
||||
return getNumberOfGenes(serum) * 50;
|
||||
}
|
||||
|
||||
public static float getBacteriaPerProcess(ItemStack serum) {
|
||||
return 0.2f * getDNAPerProcess(serum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTickTask() {
|
||||
super.onTickTask();
|
||||
@@ -62,13 +69,6 @@ public class PolymeriserLogic extends ComponentProcessSetCost implements IProces
|
||||
}
|
||||
}
|
||||
|
||||
private static int getNumberOfGenes(ItemStack serum) {
|
||||
if (serum.isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
return Engineering.getGenes(serum).length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
final ItemStack serum = this.getUtil().getStack(Polymeriser.SLOT_SERUM);
|
||||
|
||||
@@ -3,7 +3,15 @@ package binnie.genetics.machine.polymeriser;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.minecraft.GUIIcon;
|
||||
import binnie.core.craftgui.minecraft.control.*;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.core.craftgui.minecraft.control.ControlMachineProgress;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
@@ -59,5 +67,4 @@ public class WindowPolymeriser extends WindowMachine {
|
||||
protected String getBackgroundTextureName() {
|
||||
return "polymeriser";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,9 +16,9 @@ import net.minecraft.item.ItemStack;
|
||||
import java.util.Random;
|
||||
|
||||
public class ControlSequencerProgress extends ControlProgressBase {
|
||||
ControlText textControl;
|
||||
static final String[] CODES = {"A", "T", "G", "C"};
|
||||
static final String[] COLORS = {"a", "d", "b", "c"};
|
||||
ControlText textControl;
|
||||
|
||||
public ControlSequencerProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 100, 52);
|
||||
|
||||
@@ -4,7 +4,11 @@ import binnie.Binnie;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.*;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.core.GeneticsGUI;
|
||||
|
||||
@@ -79,9 +79,11 @@ public class SequencerFX extends MachineComponent implements IRender.RandomDispl
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static class SequencerParticle extends Particle {
|
||||
private static final BinnieSprite[] SPRITES;
|
||||
static{
|
||||
SPRITES = new BinnieSprite[] { Sequencer.fxSeqA, Sequencer.fxSeqG, Sequencer.fxSeqC, Sequencer.fxSeqT};
|
||||
|
||||
static {
|
||||
SPRITES = new BinnieSprite[]{Sequencer.fxSeqA, Sequencer.fxSeqG, Sequencer.fxSeqC, Sequencer.fxSeqT};
|
||||
}
|
||||
|
||||
double axisX;
|
||||
double axisZ;
|
||||
double angle;
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
package binnie.genetics.machine.sequencer;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.geometry.Area;
|
||||
import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.craftgui.minecraft.GUIIcon;
|
||||
import binnie.core.craftgui.minecraft.control.*;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.ExtraBeeTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.machine.craftgui.WindowMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -45,11 +51,11 @@ public class WindowSequencer extends WindowMachine {
|
||||
int x = 16;
|
||||
int y = 32;
|
||||
CraftGUIUtil.horizontalGrid(x, y, TextJustification.MiddleCenter, 2,
|
||||
new ControlSlotArray.Builder(this, 0, 0, 2, 2).create(Sequencer.SLOT_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSequencerProgress(this, 0, 0),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSlot.Builder(this, 0, 0).assign(6)
|
||||
new ControlSlotArray.Builder(this, 0, 0, 2, 2).create(Sequencer.SLOT_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSequencerProgress(this, 0, 0),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSlot.Builder(this, 0, 0).assign(6)
|
||||
);
|
||||
final ControlSlot slotTarget = new ControlSlot.Builder(this, x + 96, y + 16).assign(5);
|
||||
x = 34;
|
||||
@@ -80,5 +86,4 @@ public class WindowSequencer extends WindowMachine {
|
||||
protected String getBackgroundTextureName() {
|
||||
return "sequencer";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,6 +20,12 @@ import javax.annotation.Nullable;
|
||||
public class SplicerLogic extends ComponentProcess implements IProcess {
|
||||
public static int PROCESS_ENERGY = 12000000;
|
||||
public static int PROCESS_LENGTH = 1200;
|
||||
private int nOfGenes;
|
||||
|
||||
public SplicerLogic(final Machine machine) {
|
||||
super(machine);
|
||||
this.nOfGenes = 0;
|
||||
}
|
||||
|
||||
public static int getProcessLength(int numberOfGenes) {
|
||||
float n = numberOfGenes;
|
||||
@@ -39,11 +45,22 @@ public class SplicerLogic extends ComponentProcess implements IProcess {
|
||||
return (int) (PROCESS_ENERGY * n);
|
||||
}
|
||||
|
||||
private int nOfGenes;
|
||||
|
||||
public SplicerLogic(final Machine machine) {
|
||||
super(machine);
|
||||
this.nOfGenes = 0;
|
||||
public static int getGenesToUse(ItemStack serum, ItemStack target) {
|
||||
if (serum.isEmpty() || target.isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
final IIndividual ind = AlleleManager.alleleRegistry.getIndividual(target);
|
||||
final IGene[] genes = ((IItemSerum) serum.getItem()).getGenes(serum);
|
||||
if (ind.getGenome().getSpeciesRoot() != ((IItemSerum) serum.getItem()).getSpeciesRoot(serum)) {
|
||||
return 1;
|
||||
}
|
||||
int i = 0;
|
||||
for (final IGene gene : genes) {
|
||||
if (ind.getGenome().getActiveAllele(gene.getChromosome()) != gene.getAllele() || ind.getGenome().getInactiveAllele(gene.getChromosome()) != gene.getAllele()) {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
return (i < 1) ? 1 : i;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,24 +83,6 @@ public class SplicerLogic extends ComponentProcess implements IProcess {
|
||||
this.nOfGenes = getGenesToUse(serum, target);
|
||||
}
|
||||
|
||||
public static int getGenesToUse(ItemStack serum, ItemStack target) {
|
||||
if (serum.isEmpty() || target.isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
final IIndividual ind = AlleleManager.alleleRegistry.getIndividual(target);
|
||||
final IGene[] genes = ((IItemSerum) serum.getItem()).getGenes(serum);
|
||||
if (ind.getGenome().getSpeciesRoot() != ((IItemSerum) serum.getItem()).getSpeciesRoot(serum)) {
|
||||
return 1;
|
||||
}
|
||||
int i = 0;
|
||||
for (final IGene gene : genes) {
|
||||
if (ind.getGenome().getActiveAllele(gene.getChromosome()) != gene.getAllele() || ind.getGenome().getInactiveAllele(gene.getChromosome()) != gene.getAllele()) {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
return (i < 1) ? 1 : i;
|
||||
}
|
||||
|
||||
private int getFullNumberOfGenes() {
|
||||
final ItemStack serum = this.getUtil().getStack(0);
|
||||
if (serum.isEmpty()) {
|
||||
|
||||
@@ -5,7 +5,12 @@ import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.craftgui.minecraft.GUIIcon;
|
||||
import binnie.core.craftgui.minecraft.control.*;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.craftgui.resource.Texture;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.genetics.Genetics;
|
||||
@@ -32,9 +37,9 @@ public class WindowSplicer extends WindowMachine {
|
||||
int x = 16;
|
||||
new ControlSplicerProgress(this, 84, 32, this.width() - 172, 102);
|
||||
CraftGUIUtil.horizontalGrid(x, 62,
|
||||
new ControlSlotArray.Builder(this, 0, 0, 2, 1).create(Splicer.SLOT_SERUM_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSlot.Builder(this, 0, 0).assign(0)
|
||||
new ControlSlotArray.Builder(this, 0, 0, 2, 1).create(Splicer.SLOT_SERUM_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_RIGHT.getIcon().getResourceLocation()),
|
||||
new ControlSlot.Builder(this, 0, 0).assign(0)
|
||||
);
|
||||
new ControlSlotArray.Builder(this, x + 12, 84, 2, 1).create(Splicer.SLOT_SERUM_EXPENDED);
|
||||
new ControlIconDisplay(this, x + 12 + 36 + 4, 86, GUIIcon.ARROW_UP_LEFT.getIcon().getResourceLocation());
|
||||
@@ -42,11 +47,11 @@ public class WindowSplicer extends WindowMachine {
|
||||
new ControlErrorState(this, 218, 86);
|
||||
x += 142;
|
||||
CraftGUIUtil.verticalGrid((this.width() - 72) / 2, 32, TextJustification.MiddleCenter, 4,
|
||||
new ControlSlotArray.Builder(this, 0, 0, 4, 1).create(Inoculator.SLOT_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_DOWN.getIcon().getResourceLocation()),
|
||||
new ControlSlot.Builder(this, 0, 0).assign(9),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_DOWN.getIcon().getResourceLocation()),
|
||||
new ControlSlotArray.Builder(this, 0, 0, 4, 1).create(Inoculator.SLOT_FINISHED)
|
||||
new ControlSlotArray.Builder(this, 0, 0, 4, 1).create(Inoculator.SLOT_RESERVE),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_DOWN.getIcon().getResourceLocation()),
|
||||
new ControlSlot.Builder(this, 0, 0).assign(9),
|
||||
new ControlIconDisplay(this, 0, 0, GUIIcon.ARROW_DOWN.getIcon().getResourceLocation()),
|
||||
new ControlSlotArray.Builder(this, 0, 0, 4, 1).create(Inoculator.SLOT_FINISHED)
|
||||
);
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
@@ -65,5 +70,4 @@ public class WindowSplicer extends WindowMachine {
|
||||
protected String getBackgroundTextureName() {
|
||||
return "inoculator";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user