Improve/refactoring (#15)

* Improve the code

* Code improve in binnie.core.utils package

* Code improve in binnie.core.triggers package

* Code improve in binnie.core.resource package

* Code improve in binnie.core.proxy package

* Code improve readability in binnie.core package

* Add missed constructors

* Some improve code readabilty

* Expand import with *

* Revert "Expand import with *"

This reverts commit 3bb4a44f3b69a8559bd5753337e0f6793ad18dc4.

* Fix using fully qualified names in imports

* Fix missed unnessesary "this."

* Removed binnie.craftgui package
Optimised imports and removed unnessesary "this."

* Some refactoring code in binnie.core.craftgui package

* Merge from master1.7.10

* Improve code readability in binnie.core.craftgui.database package

* Improve code readability in binnie.core.craftgui.events package

* Improve code readability in binnie.core.craftgui.geometry package

* Improve code readability in binnie.core.craftgui.* package
This commit is contained in:
Alexander Kornilov authored and mezz committed 2017-04-26 15:09:09 -07:00
1 parent a3c2360ba6
commit f402cb155f
428 files changed
+9515 -10103

No files matched your search

@@ -4,25 +4,25 @@
package binnie.genetics.core;
import binnie.craftgui.genetics.machine.WindowSplicer;
import binnie.craftgui.genetics.machine.WindowAcclimatiser;
import binnie.craftgui.genetics.machine.WindowIncubator;
import binnie.craftgui.genetics.machine.WindowAnalyser;
import binnie.craftgui.genetics.machine.WindowInoculator;
import binnie.craftgui.genetics.machine.WindowPolymeriser;
import binnie.craftgui.genetics.machine.WindowSequencer;
import binnie.craftgui.genetics.machine.WindowIsolator;
import binnie.craftgui.genetics.machine.WindowGenepool;
import binnie.genetics.craftgui.WindowSplicer;
import binnie.genetics.craftgui.WindowAcclimatiser;
import binnie.genetics.craftgui.WindowIncubator;
import binnie.genetics.craftgui.WindowAnalyser;
import binnie.genetics.craftgui.WindowInoculator;
import binnie.genetics.craftgui.WindowPolymeriser;
import binnie.genetics.craftgui.WindowSequencer;
import binnie.genetics.craftgui.WindowIsolator;
import binnie.genetics.craftgui.WindowGenepool;
import net.minecraft.tileentity.TileEntity;
import binnie.craftgui.genetics.machine.WindowGeneBankNEI;
import binnie.craftgui.genetics.machine.WindowGeneBank;
import binnie.genetics.craftgui.WindowGeneBankNEI;
import binnie.genetics.craftgui.WindowGeneBank;
import net.minecraft.world.World;
import java.lang.reflect.Constructor;
import binnie.genetics.gui.WindowAnalyst;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.craftgui.minecraft.Window;
import binnie.core.craftgui.minecraft.Window;
import binnie.core.gui.IBinnieGUID;
public enum GeneticsGUI implements IBinnieGUID
@@ -0,0 +1,87 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.genetics.core.GeneticsTexture;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.CraftGUI;
import net.minecraft.nbt.NBTTagCompound;
import binnie.core.craftgui.events.EventMouse;
import binnie.core.craftgui.WidgetAttribute;
import net.minecraft.item.ItemStack;
import binnie.genetics.genetics.Engineering;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.minecraft.Window;
import binnie.Binnie;
import binnie.core.craftgui.Tooltip;
import binnie.core.craftgui.ITooltip;
import binnie.genetics.api.IGene;
import binnie.core.craftgui.controls.core.IControlValue;
import binnie.core.craftgui.controls.core.Control;
public class ControlGene extends Control implements IControlValue<IGene>, ITooltip
{
IGene gene;
@Override
public void getTooltip(final Tooltip tooltip) {
final String cName = Binnie.Genetics.getSystem(this.gene.getSpeciesRoot()).getChromosomeName(this.gene.getChromosome());
tooltip.add(cName + ": " + this.gene.getName());
if (this.isMouseOver() && this.canFill(Window.get(this).getHeldItemStack())) {
tooltip.add("Left click to assign gene");
final IGene existingGene = Engineering.getGene(Window.get(this).getHeldItemStack(), this.gene.getChromosome().ordinal());
if (existingGene == null) {
return;
}
final String dName = Binnie.Genetics.getSystem(this.gene.getSpeciesRoot()).getChromosomeName(this.gene.getChromosome());
tooltip.add("Will replace " + dName + ": " + existingGene.getName());
}
}
private boolean canFill(final ItemStack stack) {
return stack != null && stack.stackSize == 1 && Engineering.isGeneAcceptor(stack) && Engineering.canAcceptGene(stack, this.getValue());
}
protected ControlGene(final IWidget parent, final float x, final float y) {
super(parent, x, y, 16.0f, 16.0f);
this.addAttribute(WidgetAttribute.MouseOver);
this.addSelfEventHandler(new EventMouse.Down.Handler() {
@Override
public void onEvent(final EventMouse.Down event) {
if (ControlGene.this.canFill(Window.get(ControlGene.this.getWidget()).getHeldItemStack())) {
final NBTTagCompound action = new NBTTagCompound();
final NBTTagCompound geneNBT = new NBTTagCompound();
ControlGene.this.getValue().writeToNBT(geneNBT);
action.setTag("gene", geneNBT);
Window.get(ControlGene.this.getWidget()).sendClientAction("gene-select", action);
}
}
});
}
@Override
public IGene getValue() {
return this.gene;
}
@Override
public void setValue(final IGene value) {
this.gene = value;
}
@Override
public void onRenderForeground() {
}
@Override
public void onRenderBackground() {
if (this.isMouseOver() && this.canFill(Window.get(this).getHeldItemStack())) {
CraftGUI.Render.solid(this.getArea(), -1);
CraftGUI.Render.solid(this.getArea().inset(1), -12303292);
}
CraftGUI.Render.colour(-1);
CraftGUI.Render.iconItem(IPoint.ZERO, GeneticsTexture.dnaIcon.getIcon());
}
}
@@ -0,0 +1,87 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.controls.ControlText;
import binnie.core.genetics.Gene;
import java.util.ArrayList;
import forestry.api.genetics.IAllele;
import java.util.List;
import forestry.api.genetics.IChromosomeType;
import java.util.Map;
import binnie.Binnie;
import binnie.genetics.genetics.GeneTracker;
import binnie.core.craftgui.minecraft.Window;
import binnie.core.craftgui.IWidget;
import binnie.core.genetics.BreedingSystem;
import binnie.core.craftgui.controls.core.IControlValue;
import binnie.core.craftgui.controls.core.Control;
public class ControlGeneScroll extends Control implements IControlValue<BreedingSystem>
{
private String filter;
private BreedingSystem system;
protected ControlGeneScroll(final IWidget parent, final float x, final float y, final float w, final float h) {
super(parent, x, y, w, h);
this.filter = "";
this.system = null;
}
public void setFilter(final String filter) {
this.filter = filter.toLowerCase();
this.refresh();
}
public void setGenes(final BreedingSystem system) {
this.system = system;
this.refresh();
}
public void refresh() {
this.deleteAllChildren();
final GeneTracker tracker = GeneTracker.getTracker(Window.get(this).getWorld(), Window.get(this).getUsername());
final Map<IChromosomeType, List<IAllele>> genes = Binnie.Genetics.getChromosomeMap(this.system.getSpeciesRoot());
int x = 0;
int y = 0;
final boolean isNEI = ((WindowGeneBank) Window.get(this)).isNei;
for (final Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) {
final List<IAllele> discovered = new ArrayList<IAllele>();
for (final IAllele allele : entry.getValue()) {
final Gene gene = new Gene(allele, entry.getKey(), this.system.getSpeciesRoot());
if ((isNEI || tracker.isSequenced(new Gene(allele, entry.getKey(), this.system.getSpeciesRoot()))) && gene.getName().toLowerCase().contains(this.filter)) {
discovered.add(allele);
}
}
if (discovered.size() == 0) {
continue;
}
x = 0;
new ControlText(this, new IPoint(x, y), this.system.getChromosomeName(entry.getKey()));
y += 12;
for (final IAllele allele : discovered) {
if (x + 18 > this.getSize().x()) {
y += 20;
x = 0;
}
new ControlGene(this, x, y).setValue(new Gene(allele, entry.getKey(), this.system.getSpeciesRoot()));
x += 18;
}
y += 24;
}
this.setSize(new IPoint(this.getSize().x(), y));
}
@Override
public void setValue(final BreedingSystem system) {
this.setGenes(system);
}
@Override
public BreedingSystem getValue() {
return this.system;
}
}
@@ -0,0 +1,26 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.minecraft.control.ControlMachineProgress;
public class ControlProcessTemporary extends ControlMachineProgress
{
public ControlProcessTemporary(final IWidget parent, final int x, final int y, final int width, final int height) {
super(parent, x, y, null, null, null);
this.setSize(new IPoint(width, height));
}
@Override
public void onRenderBackground() {
CraftGUI.Render.solid(this.getArea(), -4868683);
final float w = this.getSize().y() * this.progress / 100.0f;
CraftGUI.Render.solid(new IArea(this.getArea().x(), this.getArea().y(), w, this.getArea().h()), -65536);
}
}
@@ -0,0 +1,55 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import net.minecraft.item.ItemStack;
import java.util.Random;
import binnie.core.machines.Machine;
import binnie.core.craftgui.minecraft.Window;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.window.Panel;
import binnie.core.craftgui.minecraft.MinecraftGUI;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.controls.ControlText;
import binnie.core.craftgui.minecraft.control.ControlProgressBase;
public class ControlSequencerProgress extends ControlProgressBase
{
ControlText textControl;
public ControlSequencerProgress(final IWidget parent, final int x, final int y) {
super(parent, x, y, 100.0f, 52.0f);
final Panel panel = new Panel(this, 0.0f, 0.0f, 100.0f, 52.0f, MinecraftGUI.PanelType.Gray);
this.textControl = new ControlText(panel, new IArea(4.0f, 4.0f, 92.0f, 44.0f), "", TextJustification.MiddleCenter);
}
@Override
public void onUpdateClient() {
super.onUpdateClient();
final ItemStack stack = Machine.getMachine(Window.get(this).getInventory()).getMachineUtil().getStack(5);
if (stack == null) {
this.textControl.setValue("");
}
else {
final Random rand = new Random(stack.getDisplayName().length());
String text = "";
final String[] codes = { "A", "T", "G", "C" };
final String[] colors = { "a", "d", "b", "c" };
for (int i = 0; i < 65; ++i) {
final int k = rand.nextInt(4);
final String code = codes[k];
if (rand.nextFloat() < this.progress) {
final String col = "§" + colors[k];
text = text + "§r" + col + "§l" + code;
}
else {
text = text + "§r§7§k§l" + code;
}
}
this.textControl.setValue(text);
}
}
}
@@ -0,0 +1,55 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.minecraft.control.ControlProgressBase;
public class ControlSplicerProgress extends ControlProgressBase
{
float strength;
public ControlSplicerProgress(final IWidget parent, final float x, final float y, final float w, final float h) {
super(parent, x, y, w, h);
this.strength = 0.0f;
this.strength = 0.0f;
}
@Override
public void onRenderBackground() {
final float progress = this.getProcess().getCurrentProgress() / 100.0f;
final float n = this.getProcess().getProcessTime() / 12.0f;
final float spacing = 10.0f;
final float range = this.w();
final float h = 8.0f;
final float ooy = -((n - 1.0f) * spacing) - range / 2.0f;
final float ddy = (n - 1.0f) * spacing + range;
final float oy = ooy + ddy * progress;
for (int i = 0; i < n; ++i) {
final int seed = 432523;
final int[] colours = { 10027008, 30464, 255, 10057472 };
int c1 = colours[(int) Math.abs(13.0 * Math.sin(i) + 48.0 * Math.cos(i) + 25.0 * Math.sin(7 * i)) % 4];
int c2 = colours[(int) Math.abs(23.0 * Math.sin(i) + 28.0 * Math.cos(i) + 15.0 * Math.sin(7 * i)) % 4];
int c3 = colours[(int) Math.abs(43.0 * Math.sin(i) + 38.0 * Math.cos(i) + 55.0 * Math.sin(7 * i)) % 4];
int c4 = colours[(int) Math.abs(3.0 * Math.sin(i) + 18.0 * Math.cos(i) + 35.0 * Math.sin(7 * i)) % 4];
final float y = oy + i * spacing;
if (y > -range / 2.0f && y < range / 2.0f) {
final float percentView = (float) Math.sqrt(1.0f - Math.abs(2.0f * y / range));
final float offMovement = (this.h() - 2.0f * h) / 2.0f;
final int alpha = 16777216 * (int) (255.0f * percentView);
c1 += alpha;
c2 += alpha;
c3 += alpha;
c4 += alpha;
CraftGUI.Render.solidAlpha(new IArea(this.w() / 2.0f + y, offMovement * percentView, 4.0f, h / 2.0f), c1);
CraftGUI.Render.solidAlpha(new IArea(this.w() / 2.0f + y, offMovement * percentView + 4.0f, 4.0f, h / 2.0f), (y < 0.0f) ? c2 : c3);
CraftGUI.Render.solidAlpha(new IArea(this.w() / 2.0f + y, this.h() - offMovement * percentView - 8.0f, 4.0f, h / 2.0f), (y < 0.0f) ? c3 : c2);
CraftGUI.Render.solidAlpha(new IArea(this.w() / 2.0f + y, this.h() - offMovement * percentView - 4.0f, 4.0f, h / 2.0f), c4);
}
}
}
}
@@ -0,0 +1,79 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlErrorState;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.genetics.machine.Acclimatiser;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.resource.Texture;
public class WindowAcclimatiser extends WindowMachine
{
static Texture ProgressBase;
static Texture Progress;
public static final int[] slotReserve;
public static final int slotTarget = 4;
public static final int[] slotAcclimatiser;
public static final int[] slotDone;
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowAcclimatiser(player, inventory, side);
}
public WindowAcclimatiser(final EntityPlayer player, final IInventory inventory, final Side side) {
super(280, 198, player, inventory, side);
}
@Override
public void initialiseClient() {
this.setTitle("Acclimatiser");
int x = 16;
final int y = 32;
new ControlSlotArray(this, x, y, 2, 2).create(Acclimatiser.slotReserve);
x += 54;
new ControlSlot(this, x + 18, y).assign(4);
new ControlSlotArray(this, x, y + 18 + 18, 3, 1).create(Acclimatiser.slotAcclimatiser);
x += 72;
new ControlSlotArray(this, x, y, 2, 2).create(Acclimatiser.slotDone);
new ControlEnergyBar(this, 21, 115, 16, 60, Position.Bottom);
new ControlErrorState(this, 181.0f, 83.0f);
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Acclimatiser";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "Acclimatiser";
}
static {
WindowAcclimatiser.ProgressBase = new StandardTexture(64, 0, 130, 21, ExtraBeeTexture.GUIProgress.getTexture());
WindowAcclimatiser.Progress = new StandardTexture(64, 21, 130, 21, ExtraBeeTexture.GUIProgress.getTexture());
slotReserve = new int[] { 0, 1, 2, 3 };
slotAcclimatiser = new int[] { 5, 6, 7 };
slotDone = new int[] { 8, 9, 10, 11 };
}
}
@@ -0,0 +1,89 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlProgress;
import binnie.core.craftgui.minecraft.MinecraftGUI;
import binnie.core.craftgui.window.Panel;
import binnie.core.craftgui.minecraft.GUIIcon;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.core.craftgui.minecraft.control.ControlErrorState;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.genetics.machine.Analyser;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.genetics.core.GeneticsTexture;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.resource.Texture;
public class WindowAnalyser extends WindowMachine
{
static Texture ProgressBase;
static Texture Progress;
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowAnalyser(player, inventory, side);
}
public WindowAnalyser(final EntityPlayer player, final IInventory inventory, final Side side) {
super(220, 210, player, inventory, side);
}
@Override
public void initialiseClient() {
WindowAnalyser.ProgressBase = new StandardTexture(0, 51, 66, 40, GeneticsTexture.GUIProcess.getTexture());
WindowAnalyser.Progress = new StandardTexture(66, 51, 66, 40, GeneticsTexture.GUIProcess.getTexture());
int x = 16;
final int y = 32;
new ControlSlotArray(this, x, y, 2, 3).create(Analyser.slotReserve);
x += 28;
new ControlSlot(this, x, y + 54 + 8).assign(13);
new ControlSlotCharge(this, x + 20, y + 54 + 8, 13).setColor(10040319);
new ControlEnergyBar(this, x + 24 + 16, y + 54 + 8 + 1, 60, 16, Position.Left);
new ControlErrorState(this, x + 24 + 16 + 60 + 16, y + 54 + 8 + 1);
x -= 28;
new ControlIconDisplay(this, x + 36 + 2, y + 18, GUIIcon.ArrowRight.getIcon());
x += 56;
new Panel(this, x, y, 76.0f, 50.0f, MinecraftGUI.PanelType.Tinted);
new ControlProgress(this, x + 5, y + 5, WindowAnalyser.ProgressBase, WindowAnalyser.Progress, Position.Left);
new ControlSlot(this, x + 38 - 9, y + 25 - 9).assign(6);
new ControlIconDisplay(this, x + 76 + 2, y + 18, GUIIcon.ArrowRight.getIcon());
x += 96;
new ControlSlotArray(this, x, y, 2, 3).create(Analyser.slotFinished);
x += 52;
this.setTitle("Analyser");
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Analyser";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "Analyser";
}
static {
WindowAnalyser.ProgressBase = new StandardTexture(0, 218, 142, 17, ExtraBeeTexture.GUIProgress.getTexture());
WindowAnalyser.Progress = new StandardTexture(0, 201, 142, 17, ExtraBeeTexture.GUIProgress.getTexture());
}
}
@@ -0,0 +1,194 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.controls.ControlText;
import java.util.Arrays;
import forestry.api.genetics.IAllele;
import java.util.List;
import forestry.api.genetics.IChromosomeType;
import java.util.Map;
import binnie.core.craftgui.Tooltip;
import binnie.core.craftgui.minecraft.control.ControlTabIcon;
import binnie.core.craftgui.controls.tab.ControlTab;
import binnie.core.craftgui.controls.tab.ControlTabBar;
import binnie.core.craftgui.geometry.Position;
import binnie.Binnie;
import binnie.core.craftgui.events.EventTextEdit;
import binnie.core.craftgui.controls.ControlTextEdit;
import binnie.core.craftgui.controls.scroll.ControlScrollableContent;
import binnie.core.craftgui.minecraft.MinecraftGUI;
import binnie.core.craftgui.window.Panel;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.events.EventHandler;
import binnie.core.genetics.BreedingSystem;
import binnie.core.craftgui.events.EventValueChanged;
import binnie.genetics.genetics.GeneTracker;
import binnie.core.craftgui.minecraft.Window;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.player.EntityPlayerMP;
import binnie.genetics.genetics.Engineering;
import binnie.core.genetics.Gene;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.util.IIcon;
public class WindowGeneBank extends WindowMachine
{
public static IIcon[] iconsDNA;
public boolean isNei;
ControlGeneScroll genes;
@Override
public void recieveGuiNBT(final Side side, final EntityPlayer player, final String name, final NBTTagCompound nbt) {
super.recieveGuiNBT(side, player, name, nbt);
if (side == Side.SERVER && name.equals("gene-select")) {
final Gene gene = new Gene(nbt.getCompoundTag("gene"));
if (gene != null && !gene.isCorrupted()) {
final ItemStack held = this.getHeldItemStack();
final ItemStack converted = Engineering.addGene(held, gene);
this.getPlayer().inventory.setItemStack(converted);
this.getPlayer().inventory.markDirty();
if (this.getPlayer() instanceof EntityPlayerMP) {
((EntityPlayerMP) this.getPlayer()).sendContainerToPlayer(player.inventoryContainer);
}
}
}
}
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowGeneBank(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());
if (tracker != null) {
tracker.synchToPlayer(this.getPlayer());
}
}
@Override
public void initialiseClient() {
this.setTitle("Gene Bank");
this.addEventHandler(new EventValueChanged.Handler() {
@Override
public void onEvent(final EventValueChanged event) {
if (event.value instanceof BreedingSystem) {
WindowGeneBank.this.genes.setValue((BreedingSystem) event.value);
}
}
});
int boxX = 100;
int x = 16;
final int y = 32;
new ControlPlayerInventory(this, x, y);
x += 124;
boxX = x;
final int geneBoxWidth = 120;
new Panel(this, boxX + 24, 32.0f, geneBoxWidth, 120.0f, MinecraftGUI.PanelType.Black);
new Panel(this, boxX + 24 + geneBoxWidth, 32.0f, 14.0f, 120.0f, MinecraftGUI.PanelType.Gray);
final ControlScrollableContent scroll = new ControlScrollableContent(this, boxX + 24 + 2, 34.0f, geneBoxWidth + 10, 116.0f, 12.0f);
final ControlTextEdit edit = new ControlTextEdit(this, boxX + 27 + geneBoxWidth - 70, 18.0f, 80.0f, 12.0f);
this.addEventHandler(new EventTextEdit.Handler() {
@Override
public void onEvent(final EventTextEdit event) {
WindowGeneBank.this.genes.setFilter(event.getValue());
}
}.setOrigin(EventHandler.Origin.Self, edit));
scroll.setScrollableContent(this.genes = new ControlGeneScroll(scroll, 1.0f, 1.0f, geneBoxWidth, 116.0f));
this.genes.setGenes(Binnie.Genetics.beeBreedingSystem);
final ControlTabBar<BreedingSystem> tabBar = new ControlTabBar<BreedingSystem>(this, boxX, 32.0f, 24.0f, 120.0f, Position.Left) {
@Override
public ControlTab<BreedingSystem> createTab(final float x, final float y, final float w, final float h, final BreedingSystem value) {
return new ControlTabIcon<BreedingSystem>(this, x, y, w, h, value) {
@Override
public void getTooltip(final Tooltip tooltip) {
tooltip.add(this.getValue().toString());
int totalGenes = 0;
int seqGenes = 0;
final GeneTracker tracker = GeneTracker.getTracker(WindowGeneBank.this.getWorld(), WindowGeneBank.this.getUsername());
final Map<IChromosomeType, List<IAllele>> genes = Binnie.Genetics.getChromosomeMap(this.getValue().getSpeciesRoot());
for (final Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) {
totalGenes += entry.getValue().size();
for (final IAllele allele : entry.getValue()) {
final Gene gene = new Gene(allele, entry.getKey(), this.getValue().getSpeciesRoot());
if (tracker.isSequenced(gene)) {
++seqGenes;
}
}
}
tooltip.add("" + seqGenes + "/" + totalGenes + " Genes");
}
};
}
};
tabBar.setValues(Binnie.Genetics.getActiveSystems());
tabBar.setValue(Binnie.Genetics.beeBreedingSystem);
boxX -= 8;
final ControlTabBar<String> infoTabs = new ControlTabBar<String>(this, boxX + 8, 160.0f, 16.0f, 50.0f, Position.Left);
infoTabs.setValues(Arrays.asList("Stats", "Ranking"));
infoTabs.setValue("Info");
final Panel panelProject = new Panel(this, boxX + 24, 160.0f, geneBoxWidth + 20, 50.0f, MinecraftGUI.PanelType.Black);
int totalGenes = 0;
int seqGenes = 0;
for (final BreedingSystem system : Binnie.Genetics.getActiveSystems()) {
final GeneTracker tracker = GeneTracker.getTracker(this.getWorld(), this.getUsername());
final Map<IChromosomeType, List<IAllele>> genes = Binnie.Genetics.getChromosomeMap(system.getSpeciesRoot());
for (final Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) {
totalGenes += entry.getValue().size();
for (final IAllele allele : entry.getValue()) {
final Gene gene = new Gene(allele, entry.getKey(), system.getSpeciesRoot());
if (tracker.isSequenced(gene)) {
++seqGenes;
}
}
}
}
new ControlText(panelProject, new IPoint(4.0f, 4.0f), "§nFull Genome Project");
new ControlText(panelProject, new IPoint(4.0f, 18.0f), "§oSequenced §r" + seqGenes + "/" + totalGenes + " §oGenes");
}
@Override
public String getTitle() {
return "Gene Bank";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "GeneBank";
}
public static class ChromosomeType
{
IChromosomeType chromosome;
BreedingSystem system;
public ChromosomeType(final IChromosomeType chromosome, final BreedingSystem system) {
this.chromosome = chromosome;
this.system = system;
}
@Override
public String toString() {
return this.system.getChromosomeName(this.chromosome);
}
}
}
@@ -0,0 +1,17 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
public class WindowGeneBankNEI
{
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowGeneBank(player, inventory, side, true);
}
}
@@ -0,0 +1,34 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.minecraft.Window;
public class WindowGeneProject extends Window
{
public WindowGeneProject(final EntityPlayer player, final IInventory inventory, final Side side) {
super(100.0f, 100.0f, player, inventory, side);
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "GeneProjects";
}
@Override
public void initialiseClient() {
this.setTitle("Gene Projects");
}
}
@@ -0,0 +1,84 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlErrorState;
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.minecraft.control.ControlMachineProgress;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.GUIIcon;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.genetics.machine.Genepool;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.resource.Texture;
public class WindowGenepool extends WindowMachine
{
static Texture ProgressBase;
static Texture Progress;
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowGenepool(player, inventory, side);
}
public WindowGenepool(final EntityPlayer player, final IInventory inventory, final Side side) {
super(280, 198, player, inventory, side);
}
@Override
public void initialiseClient() {
this.setTitle("Genepool");
int x = 16;
final int y = 32;
new ControlLiquidTank(this, x, y).setTankID(1);
x += 26;
new ControlSlotArray(this, x, y + 3, 2, 3).create(Genepool.slotReserve);
x += 38;
new ControlIconDisplay(this, x, y + 3 + 18 + 1, GUIIcon.ArrowRight.getIcon());
x += 18;
new ControlSlot(this, x, y + 3 + 18).assign(0);
x += 18;
new ControlMachineProgress(this, x, y + 19, WindowGenepool.ProgressBase, WindowGenepool.Progress, Position.Left);
x += 130;
new ControlLiquidTank(this, x, y).setTankID(0);
new ControlEnergyBar(this, 21, 115, 16, 60, Position.Bottom);
new ControlSlot(this, 121.0f, 82.0f).assign(7);
new ControlSlotCharge(this, 143, 82, 7).setColor(15722671);
new ControlErrorState(this, 181.0f, 83.0f);
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Genepool";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "Genepool";
}
static {
WindowGenepool.ProgressBase = new StandardTexture(64, 0, 130, 21, ExtraBeeTexture.GUIProgress.getTexture());
WindowGenepool.Progress = new StandardTexture(64, 21, 130, 21, ExtraBeeTexture.GUIProgress.getTexture());
}
}
@@ -0,0 +1,38 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
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);
}
@Override
public String getTitle() {
return "Genome Assembler";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "GenomeAssembler";
}
}
@@ -0,0 +1,85 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlErrorState;
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.minecraft.control.ControlMachineProgress;
import binnie.core.craftgui.minecraft.GUIIcon;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.genetics.machine.Incubator;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.resource.Texture;
public class WindowIncubator extends WindowMachine
{
static Texture ProgressBase;
static Texture Progress;
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowIncubator(player, inventory, side);
}
public WindowIncubator(final EntityPlayer player, final IInventory inventory, final Side side) {
super(228, 196, player, inventory, side);
}
@Override
public void initialiseClient() {
this.setTitle("Incubator");
int x = 16;
final int y = 32;
new ControlLiquidTank(this, x, y).setTankID(0);
x += 26;
new ControlSlotArray(this, x, y + 3, 1, 3).create(Incubator.slotQueue);
x += 20;
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon());
x += 18;
new ControlMachineProgress(this, x, y + 6, WindowIncubator.ProgressBase, WindowIncubator.Progress, Position.Left);
new ControlSlot(this, x + 11, y + 3 + 10).assign(3);
x += 40;
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon());
x += 18;
new ControlSlotArray(this, x, y + 3, 1, 3).create(Incubator.slotOutput);
x += 26;
new ControlLiquidTank(this, x, y).setTankID(1);
x += 34;
new ControlEnergyBar(this, x, y + 3, 16, 54, Position.Bottom);
new ControlErrorState(this, 91.0f, 82.0f);
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Incubator";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "Incubator";
}
static {
WindowIncubator.ProgressBase = new StandardTexture(0, 91, 38, 32, GeneticsTexture.GUIProcess);
WindowIncubator.Progress = new StandardTexture(38, 91, 38, 32, GeneticsTexture.GUIProcess);
}
}
@@ -0,0 +1,80 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.minecraft.control.ControlErrorState;
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.minecraft.control.ControlMachineProgress;
import binnie.core.craftgui.geometry.CraftGUIUtil;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.core.craftgui.minecraft.GUIIcon;
import binnie.genetics.machine.Inoculator;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.resource.Texture;
public class WindowInoculator extends WindowMachine
{
static Texture ProgressBase;
static Texture Progress;
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowInoculator(player, inventory, side);
}
public WindowInoculator(final EntityPlayer player, final IInventory inventory, final Side side) {
super(266, 240, player, inventory, side);
}
@Override
public void initialiseClient() {
this.setTitle("Inoculator");
int x = 16;
final int y = 32;
new ControlLiquidTank(this, x, y + 18 + 16).setTankID(0);
CraftGUIUtil.horizontalGrid(x, y, new ControlSlotArray(this, 0, 0, 2, 1).create(Inoculator.slotSerumReserve), new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()), new ControlSlot(this, 0.0f, 0.0f).assign(0), new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()), new ControlSlotArray(this, 0, 0, 2, 1).create(Inoculator.slotSerumExpended));
x += 18;
new ControlMachineProgress(this, x, y + 24, WindowInoculator.ProgressBase, WindowInoculator.Progress, Position.Left);
new ControlEnergyBar(this, 91, 118, 60, 16, Position.Left);
new ControlErrorState(this, 161.0f, 118.0f);
x += 142;
CraftGUIUtil.verticalGrid(x, y, TextJustification.MiddleLeft, 8.0f, new ControlSlotArray(this, x, y, 4, 1).create(Inoculator.slotReserve), new ControlSlot(this, x, y + 18 + 8).assign(9), new ControlSlotArray(this, x, y + 18 + 8 + 18 + 8, 4, 1).create(Inoculator.slotFinished));
new ControlIconDisplay(this, x + 18, y + 18 + 2, GUIIcon.ArrowUpLeft.getIcon());
new ControlIconDisplay(this, x + 18, y + 18 + 18, GUIIcon.ArrowLeftDown.getIcon());
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Inoculator";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "Inoculator";
}
static {
WindowInoculator.ProgressBase = new StandardTexture(0, 72, 142, 72, GeneticsTexture.GUIProcess2.getTexture());
WindowInoculator.Progress = new StandardTexture(0, 0, 142, 72, GeneticsTexture.GUIProcess2.getTexture());
}
}
@@ -0,0 +1,90 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlErrorState;
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.minecraft.control.ControlProgress;
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.GUIIcon;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.genetics.machine.Isolator;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.resource.Texture;
public class WindowIsolator extends WindowMachine
{
static Texture ProgressBase;
static Texture Progress;
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowIsolator(player, inventory, side);
}
public WindowIsolator(final EntityPlayer player, final IInventory inventory, final Side side) {
super(330, 208, player, inventory, side);
}
@Override
public void initialiseClient() {
this.setTitle("Isolator");
int x = 16;
final int y = 32;
new ControlLiquidTank(this, x, y).setTankID(0);
x += 26;
new ControlSlotArray(this, x, y + 3, 1, 3).create(Isolator.slotReserve);
x += 20;
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon());
x += 18;
new ControlSlot(this, x, y + 3).assign(5);
new ControlSlot(this, x, y + 36 + 3).assign(0);
new ControlSlotCharge(this, x + 18 + 2, y + 36 + 3, 0).setColor(15722671);
x += 18;
new ControlProgress(this, x, y + 3, WindowIsolator.ProgressBase, WindowIsolator.Progress, Position.Left);
x += 142;
new ControlSlot(this, x, y + 3).assign(6);
new ControlSlot(this, x, y + 3 + 36).assign(1);
new ControlIconDisplay(this, x + 1, y + 3 + 19, GUIIcon.ArrowUp.getIcon());
x += 20;
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon());
x += 18;
new ControlSlotArray(this, x, y + 3, 2, 3).create(Isolator.slotFinished);
new ControlEnergyBar(this, 260, 130, 16, 60, Position.Bottom);
new ControlErrorState(this, 153.0f, 81.0f);
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Incubator";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "Isolator";
}
static {
WindowIsolator.ProgressBase = new StandardTexture(0, 218, 142, 17, ExtraBeeTexture.GUIProgress.getTexture());
WindowIsolator.Progress = new StandardTexture(0, 201, 142, 17, ExtraBeeTexture.GUIProgress.getTexture());
}
}
@@ -0,0 +1,24 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.minecraft.Window;
public abstract class WindowMachine extends Window
{
public WindowMachine(final int width, final int height, final EntityPlayer player, final IInventory inventory, final Side side) {
super(width, height, player, inventory, side);
}
public abstract String getTitle();
@Override
public void initialiseClient() {
this.setTitle(this.getTitle());
}
}
@@ -0,0 +1,83 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlErrorState;
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
import binnie.core.craftgui.minecraft.control.ControlLiquidTank;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.minecraft.control.ControlMachineProgress;
import binnie.core.craftgui.minecraft.GUIIcon;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.genetics.machine.Polymeriser;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.resource.Texture;
public class WindowPolymeriser extends WindowMachine
{
static Texture ProgressBase;
static Texture Progress;
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowPolymeriser(player, inventory, side);
}
public WindowPolymeriser(final EntityPlayer player, final IInventory inventory, final Side side) {
super(278, 212, player, inventory, side);
}
@Override
public void initialiseClient() {
super.initialiseClient();
int x = 16;
final int y = 38;
new ControlSlotArray(this, x, y, 1, 4).create(Polymeriser.slotSerumReserve);
new ControlIconDisplay(this, x + 18, y + 1, GUIIcon.ArrowRight.getIcon());
x += 34;
new ControlMachineProgress(this, x + 18, y - 6, WindowPolymeriser.ProgressBase, WindowPolymeriser.Progress, Position.Left);
new ControlSlot(this, x, y).assign(0);
new ControlLiquidTank(this, x, y + 18 + 16, true).setTankID(0);
new ControlLiquidTank(this, x, y + 18 + 16 + 18 + 8, true).setTankID(1);
new ControlEnergyBar(this, x + 120, 96, 64, 16, Position.Left);
x += 40;
new ControlSlot(this, x + 30, y + 18 + 8).assign(1);
new ControlSlotCharge(this, x + 30 + 20, y + 18 + 8, 1).setColor(16766976);
x += 138;
new ControlSlotArray(this, x, y + 9, 2, 2).create(Polymeriser.slotSerumFinished);
final ControlErrorState errorState = new ControlErrorState(this, 244.0f, 97.0f);
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Polymeriser";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "Polymeriser";
}
static {
WindowPolymeriser.ProgressBase = new StandardTexture(76, 170, 160, 79, GeneticsTexture.GUIProcess.getTexture());
WindowPolymeriser.Progress = new StandardTexture(76, 91, 160, 79, GeneticsTexture.GUIProcess.getTexture());
}
}
@@ -0,0 +1,96 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlErrorState;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
import binnie.core.craftgui.minecraft.control.ControlSlotCharge;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.geometry.CraftGUIUtil;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.core.craftgui.minecraft.GUIIcon;
import binnie.genetics.machine.Sequencer;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.geometry.TextJustification;
import net.minecraft.nbt.NBTTagCompound;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.controls.ControlText;
import binnie.core.craftgui.resource.Texture;
public class WindowSequencer extends WindowMachine
{
static Texture ProgressBase;
static Texture Progress;
ControlText slotText;
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowSequencer(player, inventory, side);
}
public WindowSequencer(final EntityPlayer player, final IInventory inventory, final Side side) {
super(226, 224, player, inventory, side);
}
@Override
public void recieveGuiNBT(final Side side, final EntityPlayer player, final String name, final NBTTagCompound nbt) {
if (side == Side.CLIENT && name.equals("username")) {
this.slotText.setValue("§8Genes will be sequenced by " + nbt.getString("username"));
}
super.recieveGuiNBT(side, player, name, nbt);
}
@Override
public void initialiseClient() {
this.setTitle("Sequencer");
int x = 16;
int y = 32;
CraftGUIUtil.horizontalGrid(x, y, TextJustification.MiddleCenter, 2.0f, new ControlSlotArray(this, 0, 0, 2, 2).create(Sequencer.slotReserve), new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()), new ControlSequencerProgress(this, 0, 0), new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()), new ControlSlot(this, 0.0f, 0.0f).assign(6));
final ControlSlot slotTarget = new ControlSlot(this, x + 96, y + 16);
slotTarget.assign(5);
x = 34;
y = 92;
this.slotText = new ControlText(this, new IArea(0.0f, y, this.w(), 12.0f), "§8Userless. Will not save sequences", TextJustification.MiddleCenter);
y += 20;
final ControlSlot slotDye = new ControlSlot(this, x, y);
slotDye.assign(0);
x += 20;
new ControlSlotCharge(this, x, y, 0).setColor(16750848);
x += 32;
new ControlEnergyBar(this, x, y, 60, 16, Position.Left);
x += 92;
final ControlErrorState errorState = new ControlErrorState(this, x, y + 1);
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Incubator";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "Sequencer";
}
static {
WindowSequencer.ProgressBase = new StandardTexture(64, 114, 98, 9, ExtraBeeTexture.GUIProgress.getTexture());
WindowSequencer.Progress = new StandardTexture(64, 123, 98, 9, ExtraBeeTexture.GUIProgress.getTexture());
}
}
@@ -0,0 +1,76 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.genetics.craftgui;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.Genetics;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.genetics.machine.Inoculator;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.minecraft.control.ControlErrorState;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
import binnie.core.craftgui.geometry.CraftGUIUtil;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.core.craftgui.minecraft.GUIIcon;
import binnie.genetics.machine.Splicer;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.minecraft.Window;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.craftgui.resource.Texture;
public class WindowSplicer extends WindowMachine
{
static Texture ProgressBase;
static Texture Progress;
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
return new WindowSplicer(player, inventory, side);
}
public WindowSplicer(final EntityPlayer player, final IInventory inventory, final Side side) {
super(280, 240, player, inventory, side);
}
@Override
public void initialiseClient() {
this.setTitle("Splicer");
int x = 16;
new ControlSplicerProgress(this, 84.0f, 32.0f, this.w() - 172.0f, 102.0f);
CraftGUIUtil.horizontalGrid(x, 62.0f, new ControlSlotArray(this, 0, 0, 2, 1).create(Splicer.slotSerumReserve), new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()), new ControlSlot(this, 0.0f, 0.0f).assign(0));
new ControlSlotArray(this, x + 12, 84, 2, 1).create(Splicer.slotSerumExpended);
new ControlIconDisplay(this, x + 12 + 36 + 4, 86.0f, GUIIcon.ArrowUpLeft.getIcon());
new ControlEnergyBar(this, 196, 64, 60, 16, Position.Left);
new ControlErrorState(this, 218.0f, 86.0f);
x += 142;
CraftGUIUtil.verticalGrid((this.w() - 72.0f) / 2.0f, 32.0f, TextJustification.MiddleCenter, 4.0f, new ControlSlotArray(this, 0, 0, 4, 1).create(Inoculator.slotReserve), new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowDown.getIcon()), new ControlSlot(this, 0.0f, 0.0f).assign(9), new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowDown.getIcon()), new ControlSlotArray(this, 0, 0, 4, 1).create(Inoculator.slotFinished));
new ControlPlayerInventory(this);
}
@Override
public String getTitle() {
return "Inoculator";
}
@Override
protected AbstractMod getMod() {
return Genetics.instance;
}
@Override
protected String getName() {
return "Inoculator";
}
static {
WindowSplicer.ProgressBase = new StandardTexture(0, 72, 142, 72, GeneticsTexture.GUIProcess2.getTexture());
WindowSplicer.Progress = new StandardTexture(0, 0, 142, 72, GeneticsTexture.GUIProcess2.getTexture());
}
}
@@ -6,24 +6,24 @@ package binnie.genetics.gui;
import forestry.api.genetics.IAlleleSpecies;
import binnie.botany.api.EnumFlowerStage;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.core.CraftGUI;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.CraftGUI;
import org.lwjgl.opengl.GL11;
import binnie.craftgui.minecraft.control.ControlIconDisplay;
import binnie.craftgui.botany.ControlColourDisplay;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.botany.craftgui.ControlColourDisplay;
import binnie.core.craftgui.controls.ControlTextCentered;
import binnie.botany.api.IFlower;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageAppearance extends ControlAnalystPage
{
public AnalystPageAppearance(final IWidget parent, final IArea area, final IFlower ind) {
super(parent, area);
this.setColour(3355443);
this.setColor(3355443);
int y = 4;
final IAlleleSpecies species = ind.getGenome().getPrimary();
new ControlTextCentered(this, y, "§nAppearance").setColour(this.getColour());
new ControlTextCentered(this, y, "§nAppearance").setColor(this.getColor());
y += 12;
final ControlColourDisplay a = new ControlColourDisplay(this, this.w() / 2.0f - 28.0f, y);
a.setValue(ind.getGenome().getPrimaryColor());
@@ -6,63 +6,62 @@ package binnie.genetics.gui;
import forestry.api.lepidopterology.IAlleleButterflyEffect;
import forestry.api.apiculture.IAlleleBeeEffect;
import forestry.api.genetics.IChromosomeType;
import forestry.api.lepidopterology.EnumButterflyChromosome;
import binnie.Binnie;
import forestry.api.lepidopterology.IButterfly;
import binnie.craftgui.core.CraftGUI;
import binnie.craftgui.controls.ControlText;
import binnie.craftgui.core.geometry.TextJustification;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.controls.ControlText;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.BinnieCore;
import forestry.plugins.PluginApiculture;
import forestry.api.apiculture.IBee;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageBehaviour extends ControlAnalystPage
{
public AnalystPageBehaviour(final IWidget parent, final IArea area, final IIndividual ind) {
super(parent, area);
this.setColour(6684723);
this.setColor(6684723);
int y = 4;
new ControlTextCentered(this, y, "§nBehaviour").setColour(this.getColour());
new ControlTextCentered(this, y, "§nBehaviour").setColor(this.getColor());
y += 12;
if (ind instanceof IBee) {
final IBee bee = (IBee) ind;
y += 8;
final int fertility = bee.getGenome().getFlowering();
new ControlTextCentered(this, y, "Pollinates nearby\n" + bee.getGenome().getFlowerProvider().getDescription()).setColour(this.getColour());
new ControlTextCentered(this, y, "Pollinates nearby\n" + bee.getGenome().getFlowerProvider().getDescription()).setColor(this.getColor());
y += 20;
new ControlTextCentered(this, y, "§oEvery " + this.getTimeString(PluginApiculture.ticksPerBeeWorkCycle * 100.0f / fertility)).setColour(this.getColour());
new ControlTextCentered(this, y, "§oEvery " + this.getTimeString(PluginApiculture.ticksPerBeeWorkCycle * 100.0f / fertility)).setColor(this.getColor());
y += 22;
final IAlleleBeeEffect effect = bee.getGenome().getEffect();
final int[] t = bee.getGenome().getTerritory();
if (!effect.getUID().contains("None")) {
final String effectDesc = BinnieCore.proxy.localiseOrBlank("allele." + effect.getUID() + ".desc");
final String loc = effectDesc.equals("") ? ("Effect: " + effect.getName()) : effectDesc;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 0.0f), loc, TextJustification.TopCenter).setColour(this.getColour());
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 0.0f), loc, TextJustification.TopCenter).setColor(this.getColor());
y += (int) (CraftGUI.Render.textHeight(loc, this.w() - 8.0f) + 1.0f);
new ControlTextCentered(this, y, "§oWithin " + (int) (t[0] / 2.0f) + " blocks").setColour(this.getColour());
new ControlTextCentered(this, y, "§oWithin " + (int) (t[0] / 2.0f) + " blocks").setColor(this.getColor());
y += 22;
}
new ControlTextCentered(this, y, "Territory: §o" + t[0] + "x" + t[1] + "x" + t[2]).setColour(this.getColour());
new ControlTextCentered(this, y, "Territory: §o" + t[0] + "x" + t[1] + "x" + t[2]).setColor(this.getColor());
y += 22;
}
if (ind instanceof IButterfly) {
final IButterfly bee2 = (IButterfly) ind;
new ControlTextCentered(this, y, "§oMetabolism: " + Binnie.Genetics.mothBreedingSystem.getAlleleName(EnumButterflyChromosome.METABOLISM, ind.getGenome().getActiveAllele(EnumButterflyChromosome.METABOLISM))).setColour(this.getColour());
new ControlTextCentered(this, y, "§oMetabolism: " + Binnie.Genetics.mothBreedingSystem.getAlleleName(EnumButterflyChromosome.METABOLISM, ind.getGenome().getActiveAllele(EnumButterflyChromosome.METABOLISM))).setColor(this.getColor());
y += 20;
new ControlTextCentered(this, y, "Pollinates nearby\n" + bee2.getGenome().getFlowerProvider().getDescription()).setColour(this.getColour());
new ControlTextCentered(this, y, "Pollinates nearby\n" + bee2.getGenome().getFlowerProvider().getDescription()).setColor(this.getColor());
y += 20;
new ControlTextCentered(this, y, "§oEvery " + this.getTimeString(1500.0f)).setColour(this.getColour());
new ControlTextCentered(this, y, "§oEvery " + this.getTimeString(1500.0f)).setColor(this.getColor());
y += 22;
final IAlleleButterflyEffect effect2 = bee2.getGenome().getEffect();
if (!effect2.getUID().contains("None")) {
final String effectDesc2 = BinnieCore.proxy.localiseOrBlank("allele." + effect2.getUID() + ".desc");
final String loc2 = effectDesc2.equals("") ? ("Effect: " + effect2.getName()) : effectDesc2;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 0.0f), loc2, TextJustification.TopCenter).setColour(this.getColour());
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 0.0f), loc2, TextJustification.TopCenter).setColor(this.getColor());
y += (int) (CraftGUI.Render.textHeight(loc2, this.w() - 8.0f) + 1.0f);
y += 22;
}
@@ -5,30 +5,29 @@
package binnie.genetics.gui;
import java.text.DecimalFormat;
import binnie.craftgui.core.geometry.IPoint;
import binnie.core.craftgui.geometry.IPoint;
import binnie.botany.api.IFlower;
import net.minecraftforge.common.EnumPlantType;
import forestry.plugins.PluginApiculture;
import forestry.api.genetics.IChromosomeType;
import forestry.api.arboriculture.EnumTreeChromosome;
import binnie.Binnie;
import forestry.api.arboriculture.ITree;
import forestry.api.lepidopterology.IButterfly;
import binnie.craftgui.minecraft.control.ControlIconDisplay;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.genetics.item.ModuleItem;
import forestry.api.apiculture.IBee;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageBiology extends ControlAnalystPage
{
public AnalystPageBiology(final IWidget parent, final IArea area, final IIndividual ind) {
super(parent, area);
this.setColour(26214);
this.setColor(26214);
int y = 4;
new ControlTextCentered(this, y, "§nBiology").setColour(this.getColour());
new ControlTextCentered(this, y, "§nBiology").setColor(this.getColor());
y += 12;
if (ind instanceof IBee) {
final IBee bee = (IBee) ind;
@@ -81,7 +80,7 @@ public class AnalystPageBiology extends ControlAnalystPage
y += 30;
}
else if (ind instanceof ITree) {
new ControlTextCentered(this, y, "§oSappiness: " + Binnie.Genetics.treeBreedingSystem.getAlleleName(EnumTreeChromosome.SAPPINESS, ind.getGenome().getActiveAllele(EnumTreeChromosome.SAPPINESS))).setColour(this.getColour());
new ControlTextCentered(this, y, "§oSappiness: " + Binnie.Genetics.treeBreedingSystem.getAlleleName(EnumTreeChromosome.SAPPINESS, ind.getGenome().getActiveAllele(EnumTreeChromosome.SAPPINESS))).setColor(this.getColor());
y += 20;
}
else {
@@ -90,49 +89,49 @@ public class AnalystPageBiology extends ControlAnalystPage
if (ind instanceof IBee) {
final IBee bee = (IBee) ind;
final int fertility = bee.getGenome().getFertility();
new ControlTextCentered(this, y, "§l" + fertility + "§r drone" + ((fertility > 1) ? "s" : "") + " per hive").setColour(this.getColour());
new ControlTextCentered(this, y, "§l" + fertility + "§r drone" + ((fertility > 1) ? "s" : "") + " per hive").setColor(this.getColor());
y += 22;
final int lifespan = bee.getGenome().getLifespan() * PluginApiculture.ticksPerBeeWorkCycle;
new ControlTextCentered(this, y, "Average Lifespan").setColour(this.getColour());
new ControlTextCentered(this, y, "Average Lifespan").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§l" + this.getMCDayString(lifespan * (bee.getGenome().getNocturnal() ? 1.0f : 2.0f))).setColour(this.getColour());
new ControlTextCentered(this, y, "§l" + this.getMCDayString(lifespan * (bee.getGenome().getNocturnal() ? 1.0f : 2.0f))).setColor(this.getColor());
y += 22;
}
if (ind instanceof IButterfly) {
final IButterfly bee2 = (IButterfly) ind;
final int fertility = bee2.getGenome().getFertility();
new ControlTextCentered(this, y, "Lays §l" + fertility + "§r caterpillar" + ((fertility > 1) ? "s" : "") + " before dying").setColour(this.getColour());
new ControlTextCentered(this, y, "Lays §l" + fertility + "§r caterpillar" + ((fertility > 1) ? "s" : "") + " before dying").setColor(this.getColor());
y += 32;
final float caterpillarMatureTime = 1365.3999f * Math.round(bee2.getGenome().getLifespan() / (bee2.getGenome().getFertility() * 2));
new ControlTextCentered(this, y, "Caterpillar Gestation").setColour(this.getColour());
new ControlTextCentered(this, y, "Caterpillar Gestation").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§l" + this.getMCDayString(caterpillarMatureTime)).setColour(this.getColour());
new ControlTextCentered(this, y, "§l" + this.getMCDayString(caterpillarMatureTime)).setColor(this.getColor());
y += 22;
final int speed = (int) (20.0f * bee2.getGenome().getSpeed());
new ControlTextCentered(this, y, "Flight Speed").setColour(this.getColour());
new ControlTextCentered(this, y, "Flight Speed").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§l" + speed + "§r blocks per second").setColour(this.getColour());
new ControlTextCentered(this, y, "§l" + speed + "§r blocks per second").setColor(this.getColor());
y += 22;
}
if (ind instanceof ITree) {
final ITree tree = (ITree) ind;
final int fertility = (int) (1.0f / tree.getGenome().getFertility());
new ControlTextCentered(this, y, "1 Sapling per §l" + fertility + "§r leave" + ((fertility > 1) ? "s" : "")).setColour(this.getColour());
new ControlTextCentered(this, y, "1 Sapling per §l" + fertility + "§r leave" + ((fertility > 1) ? "s" : "")).setColor(this.getColor());
y += 22;
final float butterflySpawn = 1365.3999f / (tree.getGenome().getSappiness() * tree.getGenome().getYield() * 0.5f);
new ControlTextCentered(this, y, "Butterfies spawn every\n" + this.getTimeString(butterflySpawn) + " per leaf").setColour(this.getColour());
new ControlTextCentered(this, y, "Butterfies spawn every\n" + this.getTimeString(butterflySpawn) + " per leaf").setColor(this.getColor());
y += 34;
new ControlTextCentered(this, y, "Plant Types").setColour(this.getColour());
new ControlTextCentered(this, y, "Plant Types").setColor(this.getColor());
y += 12;
for (final EnumPlantType type : tree.getGenome().getPlantTypes()) {
new ControlTextCentered(this, y, "§o" + type.name()).setColour(this.getColour());
new ControlTextCentered(this, y, "§o" + type.name()).setColor(this.getColor());
y += 12;
}
}
if (ind instanceof IFlower) {
final IFlower flower = (IFlower) ind;
final float butterflySpawn2 = 1365.3999f / (flower.getGenome().getSappiness() * 0.2f);
new ControlTextCentered(this, y, "Butterfies spawn every\n" + this.getTimeString(butterflySpawn2)).setColour(this.getColour());
new ControlTextCentered(this, y, "Butterfies spawn every\n" + this.getTimeString(butterflySpawn2)).setColor(this.getColor());
y += 30;
float CHANCE_DISPERSAL = 0.8f;
CHANCE_DISPERSAL += 0.2f * flower.getGenome().getFertility();
@@ -150,17 +149,17 @@ public class AnalystPageBiology extends ControlAnalystPage
final float lifespan2 = flower.getMaxAge() * 20.0f * 68.27f / flower.getGenome().getAgeChance();
float floweringLifespan = (flower.getMaxAge() - 1) * 20.0f * 68.27f / flower.getGenome().getAgeChance();
floweringLifespan -= 1365.3999f;
new ControlTextCentered(this, y, "Average Lifespan").setColour(this.getColour());
new ControlTextCentered(this, y, "Average Lifespan").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§l" + this.getMCDayString(lifespan2)).setColour(this.getColour());
new ControlTextCentered(this, y, "§l" + this.getMCDayString(lifespan2)).setColor(this.getColor());
y += 22;
new ControlTextCentered(this, y, "Seed Dispersal").setColour(this.getColour());
new ControlTextCentered(this, y, "Seed Dispersal").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§o" + (int) (floweringLifespan / dispersalTime) + " per lifetime").setColour(this.getColour());
new ControlTextCentered(this, y, "§o" + (int) (floweringLifespan / dispersalTime) + " per lifetime").setColor(this.getColor());
y += 22;
new ControlTextCentered(this, y, "Pollination").setColour(this.getColour());
new ControlTextCentered(this, y, "Pollination").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§o" + (int) (floweringLifespan / pollinateTime) + " per lifetime").setColour(this.getColour());
new ControlTextCentered(this, y, "§o" + (int) (floweringLifespan / pollinateTime) + " per lifetime").setColor(this.getColor());
y += 22;
}
this.setSize(new IPoint(this.w(), y));
@@ -5,34 +5,33 @@
package binnie.genetics.gui;
import java.util.List;
import binnie.craftgui.core.geometry.IPoint;
import binnie.core.craftgui.geometry.IPoint;
import forestry.api.core.EnumHumidity;
import binnie.core.genetics.Tolerance;
import forestry.api.core.EnumTemperature;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.ArrayList;
import binnie.craftgui.controls.ControlText;
import binnie.craftgui.core.geometry.TextJustification;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlText;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.lepidopterology.EnumButterflyChromosome;
import forestry.api.lepidopterology.IButterfly;
import binnie.botany.api.EnumFlowerChromosome;
import binnie.botany.api.IFlower;
import forestry.api.genetics.IChromosomeType;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.genetics.IAlleleTolerance;
import forestry.api.apiculture.IBee;
import forestry.api.genetics.EnumTolerance;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageClimate extends ControlAnalystPage
{
public AnalystPageClimate(final IWidget parent, final IArea area, final IIndividual ind) {
super(parent, area);
this.setColour(26163);
this.setColor(26163);
final EnumTemperature temp = ind.getGenome().getPrimary().getTemperature();
EnumTolerance tempTol = EnumTolerance.NONE;
final EnumHumidity humid = ind.getGenome().getPrimary().getHumidity();
@@ -50,19 +49,19 @@ public class AnalystPageClimate extends ControlAnalystPage
humidTol = ((IAlleleTolerance) ind.getGenome().getActiveAllele(EnumButterflyChromosome.HUMIDITY_TOLERANCE)).getValue();
}
int y = 4;
new ControlTextCentered(this, y, "§nClimate").setColour(this.getColour());
new ControlTextCentered(this, y, "§nClimate").setColor(this.getColor());
y += 16;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Temp. Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Temp. Tolerance", TextJustification.MiddleCenter).setColor(this.getColor());
y += 12;
this.createTemperatureBar(this, (this.w() - 100.0f) / 2.0f, y, 100.0f, 10.0f, temp, tempTol);
y += 16;
if (!(ind instanceof IFlower)) {
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Humidity Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Humidity Tolerance", TextJustification.MiddleCenter).setColor(this.getColor());
y += 12;
this.createHumidity(this, (this.w() - 100.0f) / 2.0f, y, 100.0f, 10.0f, humid, humidTol);
y += 16;
}
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Biomes", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Biomes", TextJustification.MiddleCenter).setColor(this.getColor());
y += 12;
final List<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>();
for (final BiomeGenBase biome : BiomeGenBase.getBiomeGenArray()) {
@@ -4,28 +4,27 @@
package binnie.genetics.gui;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.events.EventMouse;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.events.EventMouse;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.controls.scroll.ControlScrollBar;
import binnie.craftgui.core.geometry.TextJustification;
import binnie.craftgui.controls.core.Control;
import binnie.craftgui.controls.listbox.ControlListBox;
import forestry.api.genetics.IChromosomeType;
import binnie.core.craftgui.controls.scroll.ControlScrollBar;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.controls.core.Control;
import binnie.core.craftgui.controls.listbox.ControlListBox;
import forestry.api.arboriculture.EnumTreeChromosome;
import binnie.craftgui.window.Panel;
import binnie.craftgui.minecraft.MinecraftGUI;
import binnie.craftgui.resource.minecraft.CraftGUITexture;
import binnie.craftgui.core.CraftGUI;
import binnie.core.craftgui.window.Panel;
import binnie.core.craftgui.minecraft.MinecraftGUI;
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
import binnie.core.craftgui.CraftGUI;
import java.util.Collection;
import forestry.api.genetics.IAlleleSpecies;
import java.util.ArrayList;
import binnie.craftgui.controls.ControlTextEdit;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextEdit;
import binnie.core.craftgui.controls.ControlTextCentered;
import binnie.core.genetics.BreedingSystem;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.controls.scroll.ControlScrollableContent;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.controls.scroll.ControlScrollableContent;
public class AnalystPageDatabase extends ControlAnalystPage
{
@@ -46,9 +45,9 @@ public class AnalystPageDatabase extends ControlAnalystPage
brightness = 1.0f;
}
final int newColour = (int) (cr * brightness) * 65536 + (int) (cg * brightness) * 256 + (int) (cb * brightness);
this.setColour(newColour);
this.setColor(newColour);
int y = 4;
new ControlTextCentered(this, y, "§nRegistry").setColour(this.getColour());
new ControlTextCentered(this, y, "§nRegistry").setColor(this.getColor());
y += 16;
new ControlTextEdit(this, 20.0f, y, this.w() - 40.0f, 16.0f) {
@Override
@@ -73,13 +72,13 @@ public class AnalystPageDatabase extends ControlAnalystPage
public void onRenderBackground() {
CraftGUI.Render.colour(5592405);
CraftGUI.Render.texture(CraftGUITexture.TabSolid, this.getArea().inset(1));
CraftGUI.Render.colour(AnalystPageDatabase.this.getColour());
CraftGUI.Render.colour(AnalystPageDatabase.this.getColor());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea());
super.renderTextField();
}
};
y += 22;
new Panel(this, 3.0f, y - 1, this.w() - 6.0f, this.h() - y - 8.0f + 2.0f, MinecraftGUI.PanelType.TabOutline).setColour(this.getColour());
new Panel(this, 3.0f, y - 1, this.w() - 6.0f, this.h() - y - 8.0f + 2.0f, MinecraftGUI.PanelType.TabOutline).setColor(this.getColor());
final boolean textView = false;
final Collection<IAlleleSpecies> options = this.getSpecies(system);
for (final IAlleleSpecies species : options) {
@@ -119,8 +118,8 @@ public class AnalystPageDatabase extends ControlAnalystPage
if (!this.isEnabled()) {
return;
}
CraftGUI.Render.gradientRect(this.getArea(), 1140850688 + AnalystPageDatabase.this.getColour(), 1140850688 + AnalystPageDatabase.this.getColour());
CraftGUI.Render.solid(this.getRenderArea(), AnalystPageDatabase.this.getColour());
CraftGUI.Render.gradientRect(this.getArea(), 1140850688 + AnalystPageDatabase.this.getColor(), 1140850688 + AnalystPageDatabase.this.getColor());
CraftGUI.Render.solid(this.getRenderArea(), AnalystPageDatabase.this.getColor());
}
};
}
@@ -153,7 +152,7 @@ public class AnalystPageDatabase extends ControlAnalystPage
if (window.getIndividual() != null && window.getIndividual().getGenome().getPrimary() == species) {
CraftGUI.Render.colour(15658734);
CraftGUI.Render.texture(CraftGUITexture.TabSolid, this.getArea().outset(1));
CraftGUI.Render.colour(AnalystPageDatabase.this.getColour());
CraftGUI.Render.colour(AnalystPageDatabase.this.getColor());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea().outset(1));
}
else if (this.calculateIsMouseOver()) {
@@ -5,20 +5,20 @@
package binnie.genetics.gui;
import forestry.api.genetics.IAlleleSpecies;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.controls.ControlText;
import binnie.craftgui.core.geometry.TextJustification;
import binnie.craftgui.core.CraftGUI;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.controls.ControlText;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageDescription extends ControlAnalystPage
{
public AnalystPageDescription(final IWidget parent, final IArea area, final IIndividual ind) {
super(parent, area);
this.setColour(3355443);
this.setColor(3355443);
int y = 4;
final IAlleleSpecies species = ind.getGenome().getPrimary();
final String branchBinomial = (species.getBranch() != null) ? species.getBranch().getScientific() : "<Unknown>";
@@ -49,20 +49,20 @@ public class AnalystPageDescription extends ControlAnalystPage
if (authority.contains("MysteriousAges")) {
authority = "§5§l" + authority;
}
new ControlTextCentered(this, y, "§nDescription").setColour(this.getColour());
new ControlTextCentered(this, y, "§nDescription").setColor(this.getColor());
y += 16;
new ControlTextCentered(this, y, species.getName() + "§r").setColour(this.getColour());
new ControlTextCentered(this, y, species.getName() + "§r").setColor(this.getColor());
y += 10;
new ControlTextCentered(this, y, "§o" + branchBinomial + " " + species.getBinomial() + "§r").setColour(this.getColour());
new ControlTextCentered(this, y, "§o" + branchBinomial + " " + species.getBinomial() + "§r").setColor(this.getColor());
y += 20;
new ControlTextCentered(this, y, "Discovered by §l" + authority + "§r").setColour(this.getColour());
new ControlTextCentered(this, y, "Discovered by §l" + authority + "§r").setColor(this.getColor());
y += (int) (3.0f + CraftGUI.Render.textHeight("Discovered by §l" + authority + "§r", this.w()));
new ControlTextCentered(this, y, "Genetic Complexity: " + species.getComplexity()).setColour(this.getColour());
new ControlTextCentered(this, y, "Genetic Complexity: " + species.getComplexity()).setColor(this.getColor());
y += 26;
final ControlText descText = new ControlText(this, new IArea(8.0f, y, this.w() - 16.0f, 0.0f), descBody + "§r", TextJustification.TopCenter);
final IWidget signatureText = new ControlText(this, new IArea(8.0f, y, this.w() - 16.0f, 0.0f), descSig + "§r", TextJustification.BottomRight);
descText.setColour(this.getColour());
signatureText.setColour(this.getColour());
descText.setColor(this.getColor());
signatureText.setColor(this.getColor());
final float descHeight = CraftGUI.Render.textHeight(descText.getValue(), descText.getSize().x());
signatureText.setPosition(new IPoint(signatureText.pos().x(), descText.getPosition().y() + descHeight + 10.0f));
this.setSize(new IPoint(this.w(), 20.0f + signatureText.y()));
@@ -6,35 +6,33 @@ package binnie.genetics.gui;
import java.lang.reflect.Field;
import forestry.api.arboriculture.ITreeGenome;
import binnie.craftgui.core.geometry.IPoint;
import binnie.core.craftgui.geometry.IPoint;
import net.minecraft.init.Items;
import forestry.api.arboriculture.IAlleleFruit;
import forestry.api.genetics.IFruitFamily;
import forestry.api.genetics.ISpeciesRoot;
import forestry.api.genetics.IAllele;
import java.util.Collection;
import binnie.craftgui.minecraft.control.ControlItemDisplay;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import net.minecraft.item.ItemStack;
import forestry.arboriculture.FruitProviderPod;
import binnie.core.util.UniqueItemStackSet;
import forestry.api.genetics.IChromosomeType;
import forestry.api.arboriculture.EnumTreeChromosome;
import binnie.Binnie;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.arboriculture.ITree;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageFruit extends AnalystPageProduce
{
public AnalystPageFruit(final IWidget parent, final IArea area, final ITree ind) {
super(parent, area);
this.setColour(13382400);
this.setColor(13382400);
final ITreeGenome genome = ind.getGenome();
int y = 4;
new ControlTextCentered(this, y, "§nFruit").setColour(this.getColour());
new ControlTextCentered(this, y, "§nFruit").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§oYield: " + Binnie.Genetics.treeBreedingSystem.getAlleleName(EnumTreeChromosome.YIELD, ind.getGenome().getActiveAllele(EnumTreeChromosome.YIELD))).setColour(this.getColour());
new ControlTextCentered(this, y, "§oYield: " + Binnie.Genetics.treeBreedingSystem.getAlleleName(EnumTreeChromosome.YIELD, ind.getGenome().getActiveAllele(EnumTreeChromosome.YIELD))).setColor(this.getColor());
y += 20;
final Collection<ItemStack> products = new UniqueItemStackSet();
final Collection<ItemStack> specialties = new UniqueItemStackSet();
@@ -58,7 +56,7 @@ public class AnalystPageFruit extends AnalystPageProduce
e.printStackTrace();
}
if (products.size() > 0) {
new ControlTextCentered(this, y, "Natural Fruit").setColour(this.getColour());
new ControlTextCentered(this, y, "Natural Fruit").setColor(this.getColor());
y += 10;
final int w = products.size() * 18 - 2;
final int i = 0;
@@ -70,7 +68,7 @@ public class AnalystPageFruit extends AnalystPageProduce
y += 26;
}
if (specialties.size() > 0) {
new ControlTextCentered(this, y, "Specialty Fruit").setColour(this.getColour());
new ControlTextCentered(this, y, "Specialty Fruit").setColor(this.getColor());
y += 10;
final int w = products.size() * 18 - 2;
final int i = 0;
@@ -95,10 +93,10 @@ public class AnalystPageFruit extends AnalystPageProduce
y += 8;
}
if (products.size() == 0 && specialties.size() == 0) {
new ControlTextCentered(this, y, "This tree has no \nfruits or nuts").setColour(this.getColour());
new ControlTextCentered(this, y, "This tree has no \nfruits or nuts").setColor(this.getColor());
y += 28;
}
new ControlTextCentered(this, y, "Possible Fruits").setColour(this.getColour());
new ControlTextCentered(this, y, "Possible Fruits").setColor(this.getColor());
y += 12;
final Collection<IAllele> fruitAlleles = Binnie.Genetics.getChromosomeMap(Binnie.Genetics.getTreeRoot()).get(EnumTreeChromosome.FRUITS);
for (final IFruitFamily fam : ind.getGenome().getPrimary().getSuitableFruit()) {
@@ -7,19 +7,19 @@ package binnie.genetics.gui;
import forestry.api.genetics.IAllele;
import binnie.core.genetics.BreedingSystem;
import forestry.api.genetics.ISpeciesRoot;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.controls.ControlText;
import binnie.craftgui.core.geometry.TextJustification;
import binnie.craftgui.core.CraftGUI;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.controls.ControlText;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.CraftGUI;
import forestry.api.genetics.IChromosomeType;
import org.lwjgl.opengl.GL11;
import binnie.craftgui.controls.core.Control;
import binnie.core.craftgui.controls.core.Control;
import binnie.Binnie;
import forestry.api.genetics.AlleleManager;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageGenome extends ControlAnalystPage
{
@@ -28,9 +28,9 @@ public class AnalystPageGenome extends ControlAnalystPage
public AnalystPageGenome(final IWidget parent, final IArea area, final boolean active, final IIndividual ind) {
super(parent, area);
this.active = active;
this.setColour(26265);
this.setColor(26265);
int y = 4;
new ControlTextCentered(this, y, "§n" + this.getTitle()).setColour(this.getColour());
new ControlTextCentered(this, y, "§n" + this.getTitle()).setColor(this.getColor());
y += 16;
final ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(ind.getClass());
final BreedingSystem system = Binnie.Genetics.getSystem(root);
@@ -51,8 +51,8 @@ public class AnalystPageGenome extends ControlAnalystPage
final IAllele allele = active ? ind.getGenome().getActiveAllele(chromo) : ind.getGenome().getInactiveAllele(chromo);
final String alleleName = system.getAlleleName(chromo, allele);
final float height = CraftGUI.Render.textHeight(alleleName, this.w() / 2.0f - 2.0f);
new ControlText(scaled, new IArea(0.0f, y + (height - 9.0f) / 2.0f, this.w() / 2.0f - 2.0f, 0.0f), system.getChromosomeShortName(chromo) + " :", TextJustification.TopRight).setColour(this.getColour());
new ControlText(scaled, new IArea(this.w() / 2.0f + 2.0f, y, this.w() / 2.0f - 2.0f, 0.0f), alleleName, TextJustification.TopLeft).setColour(this.getColour());
new ControlText(scaled, new IArea(0.0f, y + (height - 9.0f) / 2.0f, this.w() / 2.0f - 2.0f, 0.0f), system.getChromosomeShortName(chromo) + " :", TextJustification.TopRight).setColor(this.getColor());
new ControlText(scaled, new IArea(this.w() / 2.0f + 2.0f, y, this.w() / 2.0f - 2.0f, 0.0f), alleleName, TextJustification.TopLeft).setColor(this.getColor());
y += (int) (3.0f + height);
}
this.setSize(new IPoint(this.w(), y + 8));
@@ -5,41 +5,40 @@
package binnie.genetics.gui;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IChromosomeType;
import forestry.api.arboriculture.EnumTreeChromosome;
import binnie.Binnie;
import forestry.api.arboriculture.ITree;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageGrowth extends ControlAnalystPage
{
public AnalystPageGrowth(final IWidget parent, final IArea area, final IIndividual ind) {
super(parent, area);
this.setColour(3355443);
this.setColor(3355443);
int y = 4;
final IAlleleSpecies species = ind.getGenome().getPrimary();
new ControlTextCentered(this, y, "§nGrowth").setColour(this.getColour());
new ControlTextCentered(this, y, "§nGrowth").setColor(this.getColor());
y += 12;
if (ind instanceof ITree) {
final ITree tree = (ITree) ind;
final int mat = tree.getGenome().getMaturationTime();
new ControlTextCentered(this, y, "Saplings mature in").setColour(this.getColour());
new ControlTextCentered(this, y, "Saplings mature in").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§l" + this.getTimeString(1373.3999f * mat)).setColour(this.getColour());
new ControlTextCentered(this, y, "§l" + this.getTimeString(1373.3999f * mat)).setColor(this.getColor());
y += 22;
new ControlTextCentered(this, y, "§oHeight: " + Binnie.Genetics.treeBreedingSystem.getAlleleName(EnumTreeChromosome.HEIGHT, ind.getGenome().getActiveAllele(EnumTreeChromosome.HEIGHT))).setColour(this.getColour());
new ControlTextCentered(this, y, "§oHeight: " + Binnie.Genetics.treeBreedingSystem.getAlleleName(EnumTreeChromosome.HEIGHT, ind.getGenome().getActiveAllele(EnumTreeChromosome.HEIGHT))).setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§oGirth: " + Binnie.Genetics.treeBreedingSystem.getAlleleName(EnumTreeChromosome.GIRTH, ind.getGenome().getActiveAllele(EnumTreeChromosome.GIRTH))).setColour(this.getColour());
new ControlTextCentered(this, y, "§oGirth: " + Binnie.Genetics.treeBreedingSystem.getAlleleName(EnumTreeChromosome.GIRTH, ind.getGenome().getActiveAllele(EnumTreeChromosome.GIRTH))).setColor(this.getColor());
y += 20;
new ControlTextCentered(this, y, "Growth Conditions").setColour(this.getColour());
new ControlTextCentered(this, y, "Growth Conditions").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§o" + tree.getGenome().getGrowthProvider().getDescription()).setColour(this.getColour());
new ControlTextCentered(this, y, "§o" + tree.getGenome().getGrowthProvider().getDescription()).setColor(this.getColor());
y += 12;
for (final String s : tree.getGenome().getGrowthProvider().getInfo()) {
new ControlTextCentered(this, y, "§o" + s).setColour(this.getColour());
new ControlTextCentered(this, y, "§o" + s).setColor(this.getColor());
y += 12;
}
}
@@ -9,18 +9,18 @@ import forestry.api.genetics.ISpeciesRoot;
import forestry.api.genetics.IChromosomeType;
import binnie.Binnie;
import forestry.api.genetics.AlleleManager;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageKaryogram extends ControlAnalystPage
{
public AnalystPageKaryogram(final IWidget parent, final IArea area, final IIndividual ind) {
super(parent, area);
this.setColour(10040319);
this.setColor(10040319);
int y = 4;
new ControlTextCentered(this, y, "§nKaryogram").setColour(this.getColour());
new ControlTextCentered(this, y, "§nKaryogram").setColor(this.getColor());
y += 16;
y += 8;
final ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(ind.getClass());
@@ -4,21 +4,20 @@
package binnie.genetics.gui;
import binnie.craftgui.core.geometry.TextJustification;
import binnie.craftgui.core.Attribute;
import binnie.craftgui.minecraft.EnumColor;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.WidgetAttribute;
import binnie.core.craftgui.minecraft.EnumColor;
import java.util.Collection;
import java.util.List;
import forestry.api.genetics.IAllele;
import binnie.genetics.item.ModuleItem;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.core.CraftGUI;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.CraftGUI;
import forestry.api.genetics.IAlleleSpecies;
import binnie.core.genetics.BreedingSystem;
import binnie.craftgui.controls.core.Control;
import binnie.core.craftgui.controls.core.Control;
import forestry.api.genetics.IMutation;
import binnie.craftgui.minecraft.control.ControlItemDisplay;
import net.minecraft.block.Block;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import net.minecraft.init.Blocks;
import binnie.core.Mods;
import binnie.core.genetics.ForestryAllele;
@@ -26,20 +25,20 @@ import net.minecraft.item.ItemStack;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.genetics.ExtraBeesSpecies;
import forestry.api.apiculture.IBee;
import binnie.craftgui.minecraft.Window;
import binnie.core.craftgui.minecraft.Window;
import binnie.Binnie;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageMutations extends ControlAnalystPage
{
public AnalystPageMutations(final IWidget parent, final IArea area, final IIndividual ind, final boolean isMaster) {
super(parent, area);
this.setColour(3355392);
this.setColor(3355392);
int y = 4;
new ControlTextCentered(this, y, "§nMutations").setColour(this.getColour());
new ControlTextCentered(this, y, "§nMutations").setColor(this.getColor());
y += 18;
final BreedingSystem system = Binnie.Genetics.getSystem(ind.getGenome().getSpeciesRoot());
final List<IMutation> discovered = system.getDiscoveredMutations(Window.get(this).getWorld(), Window.get(this).getUsername());
@@ -82,19 +81,19 @@ public class AnalystPageMutations extends ControlAnalystPage
hive = new ItemStack(Blocks.chest);
}
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Valiant.getAllele()) {
new ControlTextCentered(this, y, "Natural Habitat").setColour(this.getColour());
new ControlTextCentered(this, y, "Natural Habitat").setColor(this.getColor());
y += 10;
new ControlTextCentered(this, y, "§oFound in any Hive").setColour(this.getColour());
new ControlTextCentered(this, y, "§oFound in any Hive").setColor(this.getColor());
y += 22;
}
else if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Monastic.getAllele()) {
new ControlTextCentered(this, y, "Natural Habitat").setColour(this.getColour());
new ControlTextCentered(this, y, "Natural Habitat").setColor(this.getColor());
y += 10;
new ControlTextCentered(this, y, "§oBought from Villagers").setColour(this.getColour());
new ControlTextCentered(this, y, "§oBought from Villagers").setColor(this.getColor());
y += 22;
}
else if (hive != null) {
new ControlTextCentered(this, y, "Natural Habitat").setColour(this.getColour());
new ControlTextCentered(this, y, "Natural Habitat").setColor(this.getColor());
y += 10;
final ControlItemDisplay display = new ControlItemDisplay(this, (this.w() - 16.0f) / 2.0f, y);
if (ind.getGenome().getPrimary() == ForestryAllele.BeeSpecies.Steadfast.getAllele()) {
@@ -113,7 +112,7 @@ public class AnalystPageMutations extends ControlAnalystPage
if (resultant.size() == 1) {
ox = (this.w() - 44.0f) / 2.0f;
}
new ControlTextCentered(this, y, "Resultant Mutations").setColour(this.getColour());
new ControlTextCentered(this, y, "Resultant Mutations").setColor(this.getColor());
y += 10;
for (final IMutation mutation : resultant) {
final float specificChance = this.getSpecificChance(ind, mutation, system);
@@ -171,7 +170,7 @@ public class AnalystPageMutations extends ControlAnalystPage
if (further.size() == 1) {
ox = (this.w() - 44.0f) / 2.0f;
}
new ControlTextCentered(this, y, "Further Mutations").setColour(this.getColour());
new ControlTextCentered(this, y, "Further Mutations").setColor(this.getColor());
y += 10;
for (final IMutation mutation : further) {
final IAllele speciesComb = mutation.getPartner(speciesCurrent);
@@ -265,7 +264,7 @@ public class AnalystPageMutations extends ControlAnalystPage
{
public ControlUnknownMutation(final IWidget parent, final float x, final float y, final float w, final float h) {
super(parent, x, y, w, h);
this.addAttribute(Attribute.MouseOver);
this.addAttribute(WidgetAttribute.MouseOver);
this.addTooltip("Unknown Mutation");
}
@@ -4,8 +4,8 @@
package binnie.genetics.gui;
import binnie.craftgui.minecraft.control.ControlItemDisplay;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import binnie.core.craftgui.controls.ControlTextCentered;
import net.minecraft.init.Items;
import net.minecraftforge.fluids.FluidContainerRegistry;
import binnie.extratrees.machines.Distillery;
@@ -25,8 +25,8 @@ import net.minecraft.item.crafting.FurnaceRecipes;
import binnie.core.util.UniqueItemStackSet;
import java.util.Collection;
import net.minecraft.item.ItemStack;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public abstract class AnalystPageProduce extends ControlAnalystPage
{
@@ -218,7 +218,7 @@ public abstract class AnalystPageProduce extends ControlAnalystPage
}
protected int getRefined(final String string, int y, final Collection<ItemStack> products) {
new ControlTextCentered(this, y, string).setColour(this.getColour());
new ControlTextCentered(this, y, string).setColor(this.getColor());
y += 10;
final int maxBiomePerLine = (int) ((this.w() + 2.0f - 16.0f) / 18.0f);
final float biomeListX = (this.w() - (Math.min(maxBiomePerLine, products.size()) * 18 - 2)) / 2.0f;
@@ -4,17 +4,17 @@
package binnie.genetics.gui;
import binnie.craftgui.controls.ControlText;
import binnie.core.craftgui.controls.ControlText;
import forestry.plugins.PluginApiculture;
import binnie.craftgui.core.geometry.CraftGUIUtil;
import binnie.core.craftgui.geometry.CraftGUIUtil;
import net.minecraft.nbt.NBTTagCompound;
import binnie.craftgui.core.Tooltip;
import binnie.core.craftgui.Tooltip;
import forestry.api.apiculture.IBeeGenome;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.extratrees.kitchen.ControlFluidDisplay;
import binnie.core.craftgui.geometry.IPoint;
import binnie.extratrees.craftgui.kitchen.ControlFluidDisplay;
import net.minecraft.init.Items;
import net.minecraftforge.fluids.FluidContainerRegistry;
import binnie.craftgui.minecraft.control.ControlItemDisplay;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import net.minecraftforge.fluids.FluidStack;
import java.util.ArrayList;
import java.util.Collection;
@@ -22,27 +22,26 @@ import java.util.Map;
import net.minecraft.item.ItemStack;
import java.util.HashMap;
import binnie.core.util.UniqueItemStackSet;
import forestry.api.genetics.IChromosomeType;
import forestry.api.apiculture.EnumBeeChromosome;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import binnie.core.BinnieCore;
import binnie.Binnie;
import forestry.api.apiculture.IBee;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageProducts extends AnalystPageProduce
{
public AnalystPageProducts(final IWidget parent, final IArea area, final IBee ind) {
super(parent, area);
this.setColour(13382400);
this.setColor(13382400);
final IBeeGenome genome = ind.getGenome();
final float speed = genome.getSpeed();
final float modeSpeed = Binnie.Genetics.getBeeRoot().getBeekeepingMode(BinnieCore.proxy.getWorld()).getBeeModifier().getProductionModifier(genome, 1.0f);
int y = 4;
new ControlTextCentered(this, y, "§nProduce").setColour(this.getColour());
new ControlTextCentered(this, y, "§nProduce").setColor(this.getColor());
y += 12;
new ControlTextCentered(this, y, "§oRate: " + Binnie.Genetics.beeBreedingSystem.getAlleleName(EnumBeeChromosome.SPEED, ind.getGenome().getActiveAllele(EnumBeeChromosome.SPEED))).setColour(this.getColour());
new ControlTextCentered(this, y, "§oRate: " + Binnie.Genetics.beeBreedingSystem.getAlleleName(EnumBeeChromosome.SPEED, ind.getGenome().getActiveAllele(EnumBeeChromosome.SPEED))).setColor(this.getColor());
y += 20;
final Collection<ItemStack> refinedProducts = new UniqueItemStackSet();
final Collection<ItemStack> productList = new UniqueItemStackSet();
@@ -51,7 +50,7 @@ public class AnalystPageProducts extends AnalystPageProduce
products.putAll(genome.getPrimary().getProductChances());
products.putAll(genome.getSecondary().getProductChances());
if (!products.isEmpty()) {
new ControlTextCentered(this, y, "Natural Products").setColour(this.getColour());
new ControlTextCentered(this, y, "Natural Products").setColor(this.getColor());
y += 12;
for (final Map.Entry<ItemStack, Float> entry : products.entrySet()) {
if (!productList.add(entry.getKey())) {
@@ -65,7 +64,7 @@ public class AnalystPageProducts extends AnalystPageProduce
}
products = genome.getPrimary().getSpecialtyChances();
if (!products.isEmpty()) {
new ControlTextCentered(this, y, "Specialty Products").setColour(this.getColour());
new ControlTextCentered(this, y, "Specialty Products").setColor(this.getColor());
y += 12;
for (final Map.Entry<ItemStack, Float> entry : products.entrySet()) {
refinedProducts.addAll(this.getAllProducts(entry.getKey()));
@@ -74,7 +73,7 @@ public class AnalystPageProducts extends AnalystPageProduce
}
y += 12;
}
new ControlTextCentered(this, y, "Refined Products").setColour(this.getColour());
new ControlTextCentered(this, y, "Refined Products").setColor(this.getColor());
y += 12;
Collection<ItemStack> level2Products = new UniqueItemStackSet();
for (final ItemStack stack : refinedProducts) {
@@ -176,7 +175,7 @@ public class AnalystPageProducts extends AnalystPageProduce
};
item.setTooltip();
final ControlText textWidget = new ControlTextCentered(this, y + 4, "");
textWidget.setColour(this.getColour());
textWidget.setColor(this.getColor());
CraftGUIUtil.moveWidget(textWidget, new IPoint(12.0f, 0.0f));
item.setItemStack(key);
final float time = (int) (PluginApiculture.ticksPerBeeWorkCycle * 100.0 / (speed * value));
@@ -9,42 +9,41 @@ import java.util.List;
import forestry.api.genetics.EnumTolerance;
import java.util.EnumSet;
import java.util.ArrayList;
import binnie.craftgui.minecraft.control.ControlItemDisplay;
import net.minecraft.block.Block;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import net.minecraft.item.ItemStack;
import binnie.botany.gardening.BlockSoil;
import binnie.botany.Botany;
import binnie.botany.api.EnumAcidity;
import binnie.core.genetics.Tolerance;
import binnie.botany.api.EnumMoisture;
import binnie.craftgui.controls.ControlText;
import binnie.craftgui.core.geometry.TextJustification;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlText;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.controls.ControlTextCentered;
import binnie.botany.api.IFlower;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageSoil extends ControlAnalystPage
{
public AnalystPageSoil(final IWidget parent, final IArea area, final IFlower flower) {
super(parent, area);
this.setColour(6697728);
this.setColor(6697728);
final EnumMoisture moisture = flower.getGenome().getPrimary().getMoisture();
final EnumTolerance moistureTol = flower.getGenome().getToleranceMoisture();
final EnumAcidity pH = flower.getGenome().getPrimary().getPH();
final EnumTolerance pHTol = flower.getGenome().getTolerancePH();
int y = 4;
new ControlTextCentered(this, y, "§nSoil").setColour(this.getColour());
new ControlTextCentered(this, y, "§nSoil").setColor(this.getColor());
y += 16;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Moisture Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Moisture Tolerance", TextJustification.MiddleCenter).setColor(this.getColor());
y += 12;
this.createMoisture(this, (this.w() - 100.0f) / 2.0f, y, 100.0f, 10.0f, moisture, moistureTol);
y += 16;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "pH Tolerance", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "pH Tolerance", TextJustification.MiddleCenter).setColor(this.getColor());
y += 12;
this.createAcidity(this, (this.w() - 100.0f) / 2.0f, y, 100.0f, 10.0f, pH, pHTol);
y += 16;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Recommended Soil", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Recommended Soil", TextJustification.MiddleCenter).setColor(this.getColor());
y += 12;
EnumMoisture recomMoisture = EnumMoisture.Normal;
final boolean canTolNormal = Tolerance.canTolerate(moisture, EnumMoisture.Normal, moistureTol);
@@ -91,7 +90,7 @@ public class AnalystPageSoil extends ControlAnalystPage
recomSoil.setItemStack(stack);
recomSoil.setTooltip();
y += 32;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Other Soils", TextJustification.MiddleCenter).setColour(this.getColour());
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 14.0f), "Other Soils", TextJustification.MiddleCenter).setColor(this.getColor());
y += 12;
final List<ItemStack> stacks = new ArrayList<ItemStack>();
for (final EnumAcidity a : EnumSet.range(EnumAcidity.Acid, EnumAcidity.Alkaline)) {
@@ -4,19 +4,18 @@
package binnie.genetics.gui;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.lepidopterology.IButterfly;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
public class AnalystPageSpecimen extends ControlAnalystPage
{
public AnalystPageSpecimen(final IWidget parent, final IArea area, final IButterfly ind) {
super(parent, area);
this.setColour(3355443);
this.setColor(3355443);
int y = 4;
new ControlTextCentered(this, y, "§nSpecimen").setColour(this.getColour());
new ControlTextCentered(this, y, "§nSpecimen").setColor(this.getColor());
y += 12;
final float w = (this.w() - 16.0f) * ind.getSize();
new ControlIndividualDisplay(this, (this.w() - w) / 2.0f, y + (this.w() - w) / 2.0f, w, ind);
@@ -5,36 +5,35 @@
package binnie.genetics.gui;
import forestry.api.arboriculture.ITreeGenome;
import binnie.craftgui.core.geometry.IPoint;
import binnie.core.craftgui.geometry.IPoint;
import java.util.Collection;
import binnie.craftgui.minecraft.control.ControlItemDisplay;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import binnie.core.util.UniqueItemStackSet;
import binnie.craftgui.minecraft.control.ControlIconDisplay;
import binnie.core.craftgui.minecraft.control.ControlIconDisplay;
import binnie.genetics.item.ModuleItem;
import forestry.api.genetics.IChromosomeType;
import forestry.api.arboriculture.EnumTreeChromosome;
import forestry.api.genetics.IAlleleBoolean;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.controls.ControlTextCentered;
import forestry.api.arboriculture.ITree;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
import binnie.extratrees.FakeWorld;
public class AnalystPageWood extends AnalystPageProduce
{
public AnalystPageWood(final IWidget parent, final IArea area, final ITree ind) {
super(parent, area);
this.setColour(6697728);
this.setColor(6697728);
final ITreeGenome genome = ind.getGenome();
int y = 4;
new ControlTextCentered(this, y, "§nWood").setColour(this.getColour());
new ControlTextCentered(this, y, "§nWood").setColor(this.getColor());
y += 12;
if (((IAlleleBoolean) ind.getGenome().getActiveAllele(EnumTreeChromosome.FIREPROOF)).getValue()) {
new ControlIconDisplay(this, (this.w() - 16.0f) / 2.0f, y, ModuleItem.iconNoFire.getIcon()).addTooltip("Fireproof");
@@ -55,7 +54,7 @@ public class AnalystPageWood extends AnalystPageProduce
// products.add(stack);
// }
if (products.size() > 0) {
new ControlTextCentered(this, y, "Logs").setColour(this.getColour());
new ControlTextCentered(this, y, "Logs").setColor(this.getColor());
y += 10;
final int w = products.size() * 18 - 2;
final int i = 0;
@@ -77,7 +76,7 @@ public class AnalystPageWood extends AnalystPageProduce
y += 8;
}
if (products.size() == 0) {
new ControlTextCentered(this, y, "This tree has no \nfruits or nuts").setColour(this.getColour());
new ControlTextCentered(this, y, "This tree has no \nfruits or nuts").setColor(this.getColor());
y += 28;
}
this.setSize(new IPoint(this.w(), y + 8));
@@ -6,19 +6,19 @@ package binnie.genetics.gui;
import binnie.core.genetics.BreedingSystem;
import binnie.Binnie;
import binnie.craftgui.core.Tooltip;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.core.CraftGUI;
import binnie.craftgui.core.Attribute;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.core.craftgui.Tooltip;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.WidgetAttribute;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.core.texture.BinnieCoreTexture;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.resource.Texture;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.resource.Texture;
import forestry.api.genetics.ISpeciesRoot;
import forestry.api.genetics.IChromosomeType;
import forestry.api.genetics.IAllele;
import binnie.craftgui.core.ITooltip;
import binnie.craftgui.controls.core.Control;
import binnie.core.craftgui.ITooltip;
import binnie.core.craftgui.controls.core.Control;
public class ControlAnalystChromosome extends Control implements ITooltip
{
@@ -33,7 +33,7 @@ public class ControlAnalystChromosome extends Control implements ITooltip
super(parent, x, y, 16.0f, 22.0f);
this.Homozygous = new StandardTexture(0, 0, 16, 22, BinnieCoreTexture.GUIAnalyst);
this.Heterozygous = new StandardTexture(16, 0, 16, 22, BinnieCoreTexture.GUIAnalyst);
this.addAttribute(Attribute.MouseOver);
this.addAttribute(WidgetAttribute.MouseOver);
this.root = root;
this.chromosomeType = type;
this.allele0 = allele0;
@@ -5,9 +5,9 @@
package binnie.genetics.gui;
import java.text.DecimalFormat;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.controls.core.Control;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.controls.core.Control;
public abstract class ControlAnalystPage extends Control
{
@@ -4,16 +4,16 @@
package binnie.genetics.gui;
import binnie.craftgui.core.Tooltip;
import binnie.core.craftgui.Tooltip;
import net.minecraft.util.IIcon;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.core.CraftGUI;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.CraftGUI;
import forestry.core.render.TextureManager;
import net.minecraftforge.common.BiomeDictionary;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.IWidget;
import net.minecraft.world.biome.BiomeGenBase;
import binnie.craftgui.core.ITooltip;
import binnie.craftgui.controls.core.Control;
import binnie.core.craftgui.ITooltip;
import binnie.core.craftgui.controls.core.Control;
public class ControlBiome extends Control implements ITooltip
{
@@ -5,18 +5,18 @@
package binnie.genetics.gui;
import binnie.Binnie;
import binnie.craftgui.core.Tooltip;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.core.CraftGUI;
import binnie.craftgui.events.EventValueChanged;
import binnie.craftgui.events.EventWidget;
import binnie.craftgui.core.Attribute;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.core.craftgui.Tooltip;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.events.EventValueChanged;
import binnie.core.craftgui.events.EventWidget;
import binnie.core.craftgui.WidgetAttribute;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.extrabees.core.ExtraBeeTexture;
import forestry.api.genetics.IChromosomeType;
import binnie.craftgui.resource.Texture;
import binnie.craftgui.core.ITooltip;
import binnie.craftgui.controls.core.Control;
import binnie.core.craftgui.resource.Texture;
import binnie.core.craftgui.ITooltip;
import binnie.core.craftgui.controls.core.Control;
public class ControlChromoPicker extends Control implements ITooltip
{
@@ -30,7 +30,7 @@ public class ControlChromoPicker extends Control implements ITooltip
this.Selected = new StandardTexture(160, 18, 16, 16, ExtraBeeTexture.GUIPunnett);
this.Texture = new StandardTexture(160, 34, 16, 16, ExtraBeeTexture.GUIPunnett);
this.type = chromo;
this.addAttribute(Attribute.MouseOver);
this.addAttribute(WidgetAttribute.MouseOver);
this.parent = parent;
this.addSelfEventHandler(new EventWidget.StartMouseOver.Handler() {
@Override
@@ -4,21 +4,21 @@
package binnie.genetics.gui;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.core.CraftGUI;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.CraftGUI;
import forestry.api.lepidopterology.EnumButterflyChromosome;
import binnie.botany.api.EnumFlowerChromosome;
import forestry.api.arboriculture.EnumTreeChromosome;
import forestry.api.apiculture.EnumBeeChromosome;
import binnie.Binnie;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.core.texture.BinnieCoreTexture;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.IWidget;
import forestry.api.genetics.ISpeciesRoot;
import binnie.craftgui.resource.Texture;
import binnie.core.craftgui.resource.Texture;
import forestry.api.genetics.IChromosomeType;
import binnie.craftgui.controls.core.IControlValue;
import binnie.craftgui.controls.core.Control;
import binnie.core.craftgui.controls.core.IControlValue;
import binnie.core.craftgui.controls.core.Control;
public class ControlChromosome extends Control implements IControlValue<IChromosomeType>
{
@@ -4,12 +4,12 @@
package binnie.genetics.gui;
import binnie.craftgui.core.geometry.TextJustification;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.CraftGUI;
import binnie.craftgui.controls.listbox.ControlList;
import binnie.core.craftgui.geometry.TextJustification;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.controls.listbox.ControlList;
import binnie.core.genetics.Gene;
import binnie.craftgui.controls.listbox.ControlOption;
import binnie.core.craftgui.controls.listbox.ControlOption;
public class ControlGenesisOption extends ControlOption<Gene>
{
@@ -28,9 +28,9 @@ public class ControlGenesisOption extends ControlOption<Gene>
@Override
public void onRenderBackground() {
super.onRenderBackground();
CraftGUI.Render.text(new IArea(0.0f, 0.0f, 70.0f, 22.0f), TextJustification.MiddleCenter, this.getChromosomeName(), this.getColour());
CraftGUI.Render.text(new IArea(75.0f, 0.0f, 80.0f, 22.0f), TextJustification.MiddleCenter, this.getAlleleName(), this.getColour());
CraftGUI.Render.solid(new IArea(70.0f, 2.0f, 1.0f, 16.0f), -16777216 + this.getColour());
CraftGUI.Render.text(new IArea(0.0f, 0.0f, 70.0f, 22.0f), TextJustification.MiddleCenter, this.getChromosomeName(), this.getColor());
CraftGUI.Render.text(new IArea(75.0f, 0.0f, 80.0f, 22.0f), TextJustification.MiddleCenter, this.getAlleleName(), this.getColor());
CraftGUI.Render.solid(new IArea(70.0f, 2.0f, 1.0f, 16.0f), -16777216 + this.getColor());
}
}
@@ -6,13 +6,13 @@ package binnie.genetics.gui;
import net.minecraft.item.ItemStack;
import forestry.api.genetics.AlleleManager;
import binnie.craftgui.core.Tooltip;
import binnie.core.craftgui.Tooltip;
import binnie.core.genetics.BreedingSystem;
import binnie.Binnie;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.core.ITooltip;
import binnie.craftgui.minecraft.control.ControlItemDisplay;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.ITooltip;
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
public class ControlIndividualDisplay extends ControlItemDisplay implements ITooltip
{
@@ -6,16 +6,16 @@ package binnie.genetics.gui;
import binnie.core.genetics.Tolerance;
import forestry.api.genetics.EnumTolerance;
import binnie.craftgui.core.geometry.IArea;
import binnie.craftgui.core.geometry.IBorder;
import binnie.craftgui.core.CraftGUI;
import binnie.craftgui.core.Tooltip;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.geometry.IBorder;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.Tooltip;
import forestry.api.core.EnumTemperature;
import binnie.craftgui.core.Attribute;
import binnie.craftgui.core.IWidget;
import binnie.core.craftgui.WidgetAttribute;
import binnie.core.craftgui.IWidget;
import java.util.EnumSet;
import binnie.craftgui.core.ITooltip;
import binnie.craftgui.controls.core.Control;
import binnie.core.craftgui.ITooltip;
import binnie.core.craftgui.controls.core.Control;
public abstract class ControlToleranceBar<T extends Enum<T>> extends Control implements ITooltip
{
@@ -25,7 +25,7 @@ public abstract class ControlToleranceBar<T extends Enum<T>> extends Control imp
public ControlToleranceBar(final IWidget parent, final float x, final float y, final float width, final float height, final Class<T> clss) {
super(parent, x, y, width, height);
this.addAttribute(Attribute.MouseOver);
this.addAttribute(WidgetAttribute.MouseOver);
this.enumClass = clss;
this.tolerated = EnumSet.noneOf(this.enumClass);
this.fullSet = EnumSet.allOf(this.enumClass);
@@ -35,12 +35,12 @@ public abstract class ControlToleranceBar<T extends Enum<T>> extends Control imp
}
@Override
public void getTooltip(final Tooltip list) {
public void getTooltip(final Tooltip tooltip) {
final int types = this.fullSet.size();
final int type = (int) ((int) this.getRelativeMousePosition().x() / (this.getSize().x() / types));
for (final T tol : this.fullSet) {
if (tol.ordinal() - ((this.enumClass == EnumTemperature.class) ? 1 : 0) == type) {
list.add((this.tolerated.contains(tol) ? "" : "§8") + this.getName(tol));
tooltip.add((this.tolerated.contains(tol) ? "" : "§8") + this.getName(tol));
}
}
}
@@ -4,10 +4,10 @@
package binnie.genetics.gui;
import binnie.craftgui.core.Tooltip;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.core.ITooltip;
import binnie.craftgui.controls.core.Control;
import binnie.core.craftgui.Tooltip;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.ITooltip;
import binnie.core.craftgui.controls.core.Control;
public class ControlTooltip extends Control implements ITooltip
{
@@ -9,21 +9,21 @@ import forestry.api.lepidopterology.IButterfly;
import binnie.botany.api.IFlower;
import forestry.api.apiculture.IBee;
import forestry.api.arboriculture.ITree;
import binnie.craftgui.controls.ControlTextCentered;
import binnie.craftgui.events.EventKey;
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.craftgui.core.geometry.Position;
import binnie.craftgui.controls.scroll.ControlScrollBar;
import binnie.craftgui.minecraft.MinecraftGUI;
import binnie.craftgui.minecraft.InventoryType;
import binnie.craftgui.minecraft.control.ControlSlot;
import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.resource.minecraft.CraftGUITexture;
import binnie.craftgui.core.CraftGUI;
import binnie.craftgui.core.Tooltip;
import binnie.craftgui.events.EventMouse;
import binnie.craftgui.core.Attribute;
import binnie.craftgui.core.Widget;
import binnie.core.craftgui.controls.ControlTextCentered;
import binnie.core.craftgui.events.EventKey;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.geometry.Position;
import binnie.core.craftgui.controls.scroll.ControlScrollBar;
import binnie.core.craftgui.minecraft.MinecraftGUI;
import binnie.core.craftgui.minecraft.InventoryType;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.Tooltip;
import binnie.core.craftgui.events.EventMouse;
import binnie.core.craftgui.WidgetAttribute;
import binnie.core.craftgui.Widget;
import forestry.api.genetics.IBreedingTracker;
import binnie.Binnie;
import binnie.genetics.machine.ModuleMachine;
@@ -39,14 +39,14 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.entity.player.EntityPlayer;
import binnie.core.genetics.BreedingSystem;
import forestry.api.genetics.IIndividual;
import binnie.craftgui.minecraft.control.ControlSlide;
import binnie.craftgui.core.geometry.IArea;
import binnie.core.craftgui.minecraft.control.ControlSlide;
import binnie.core.craftgui.geometry.IArea;
import java.util.List;
import binnie.craftgui.window.Panel;
import binnie.craftgui.controls.core.Control;
import binnie.craftgui.controls.scroll.ControlScrollableContent;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.minecraft.Window;
import binnie.core.craftgui.window.Panel;
import binnie.core.craftgui.controls.core.Control;
import binnie.core.craftgui.controls.scroll.ControlScrollableContent;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.minecraft.Window;
public class WindowAnalyst extends Window
{
@@ -129,7 +129,7 @@ public class WindowAnalyst extends Window
new Control(this, x, y, 20.0f, 20.0f) {
@Override
public void initialise() {
this.addAttribute(Attribute.MouseOver);
this.addAttribute(WidgetAttribute.MouseOver);
this.addSelfEventHandler(new EventMouse.Down.Handler() {
@Override
public void onEvent(final EventMouse.Down event) {
@@ -175,7 +175,7 @@ public class WindowAnalyst extends Window
@Override
public void initialise() {
this.setColour(4473924);
this.setColor(4473924);
final float sectionWidth = (this.w() - 8.0f - 4.0f) / 2.0f;
WindowAnalyst.this.leftPage = new ControlScrollableContent<IWidget>(this, 3.0f, 3.0f, sectionWidth + 2.0f, this.h() - 8.0f + 2.0f, 0.0f) {
@Override
@@ -183,7 +183,7 @@ public class WindowAnalyst extends Window
if (this.getContent() == null) {
return;
}
CraftGUI.Render.colour(this.getContent().getColour());
CraftGUI.Render.colour(this.getContent().getColor());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea());
}
};
@@ -196,8 +196,8 @@ public class WindowAnalyst extends Window
if (WindowAnalyst.this.leftPage.getContent() == null) {
return;
}
CraftGUI.Render.gradientRect(this.getArea(), 1140850688 + WindowAnalyst.this.leftPage.getContent().getColour(), 1140850688 + WindowAnalyst.this.leftPage.getContent().getColour());
CraftGUI.Render.solid(this.getRenderArea(), WindowAnalyst.this.leftPage.getContent().getColour());
CraftGUI.Render.gradientRect(this.getArea(), 1140850688 + WindowAnalyst.this.leftPage.getContent().getColor(), 1140850688 + WindowAnalyst.this.leftPage.getContent().getColor());
CraftGUI.Render.solid(this.getRenderArea(), WindowAnalyst.this.leftPage.getContent().getColor());
}
};
WindowAnalyst.this.rightPage = new ControlScrollableContent<IWidget>(this, 3.0f + sectionWidth + 4.0f, 3.0f, sectionWidth + 2.0f, this.h() - 8.0f + 2.0f, 0.0f) {
@@ -206,7 +206,7 @@ public class WindowAnalyst extends Window
if (this.getContent() == null) {
return;
}
CraftGUI.Render.colour(this.getContent().getColour());
CraftGUI.Render.colour(this.getContent().getColor());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea());
}
};
@@ -219,8 +219,8 @@ public class WindowAnalyst extends Window
if (WindowAnalyst.this.rightPage.getContent() == null) {
return;
}
CraftGUI.Render.gradientRect(this.getArea(), 1140850688 + WindowAnalyst.this.rightPage.getContent().getColour(), 1140850688 + WindowAnalyst.this.rightPage.getContent().getColour());
CraftGUI.Render.solid(this.getRenderArea(), WindowAnalyst.this.rightPage.getContent().getColour());
CraftGUI.Render.gradientRect(this.getArea(), 1140850688 + WindowAnalyst.this.rightPage.getContent().getColor(), 1140850688 + WindowAnalyst.this.rightPage.getContent().getColor());
CraftGUI.Render.solid(this.getRenderArea(), WindowAnalyst.this.rightPage.getContent().getColor());
}
};
WindowAnalyst.this.analystPageSize = new IArea(1.0f, 1.0f, sectionWidth, this.h() - 8.0f);
@@ -246,7 +246,7 @@ public class WindowAnalyst extends Window
this.analystNone = new Control(this.analystPanel, 0.0f, 0.0f, this.analystPanel.w(), this.analystPanel.h()) {
@Override
public void initialise() {
new ControlTextCentered(this, 20.0f, "Add a bee, tree, flower or butterfly to the top left slot. DNA Dye is required if it has not been analysed yet. This dye can also convert vanilla items to breedable individuals.").setColour(4473924);
new ControlTextCentered(this, 20.0f, "Add a bee, tree, flower or butterfly to the top left slot. DNA Dye is required if it has not been analysed yet. This dye can also convert vanilla items to breedable individuals.").setColor(4473924);
new ControlPlayerInventory(this);
}
};
@@ -352,7 +352,7 @@ public class WindowAnalyst extends Window
@Override
protected void initialise() {
super.initialise();
this.addAttribute(Attribute.MouseOver);
this.addAttribute(WidgetAttribute.MouseOver);
this.value = page;
this.addSelfEventHandler(new EventMouse.Down.Handler() {
@Override
@@ -383,9 +383,9 @@ public class WindowAnalyst extends Window
@Override
public void onRenderBackground() {
final boolean active = this.value == WindowAnalyst.this.leftPage.getContent() || this.value == WindowAnalyst.this.rightPage.getContent();
CraftGUI.Render.colour((active ? -16777216 : 1140850688) + this.value.getColour());
CraftGUI.Render.colour((active ? -16777216 : 1140850688) + this.value.getColor());
CraftGUI.Render.texture(CraftGUITexture.TabSolid, this.getArea().inset(1));
CraftGUI.Render.colour(this.value.getColour());
CraftGUI.Render.colour(this.value.getColor());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea().inset(1));
super.onRenderBackground();
}
@@ -23,13 +23,12 @@ import binnie.core.machines.inventory.ComponentInventorySlots;
import binnie.genetics.core.GeneticsGUI;
import binnie.core.machines.Machine;
import binnie.genetics.core.GeneticsTexture;
import binnie.craftgui.minecraft.IMachineInformation;
import binnie.core.craftgui.minecraft.IMachineInformation;
import java.util.HashMap;
import java.util.ArrayList;
import forestry.api.genetics.EnumTolerance;
import binnie.core.genetics.Tolerance;
import binnie.core.Mods;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import binnie.botany.api.EnumFlowerChromosome;
@@ -4,7 +4,6 @@
package binnie.genetics.machine;
import net.minecraft.nbt.NBTBase;
import net.minecraft.entity.player.EntityPlayer;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.entity.RenderItem;
@@ -34,7 +33,7 @@ import binnie.core.machines.inventory.ComponentInventorySlots;
import binnie.genetics.core.GeneticsGUI;
import binnie.core.machines.Machine;
import binnie.genetics.core.GeneticsTexture;
import binnie.craftgui.minecraft.IMachineInformation;
import binnie.core.craftgui.minecraft.IMachineInformation;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.nbt.NBTTagCompound;
import forestry.api.genetics.IIndividual;
@@ -37,7 +37,7 @@ import binnie.core.machines.inventory.ComponentInventorySlots;
import binnie.genetics.core.GeneticsGUI;
import binnie.core.machines.Machine;
import binnie.genetics.core.GeneticsTexture;
import binnie.craftgui.minecraft.IMachineInformation;
import binnie.core.craftgui.minecraft.IMachineInformation;
public class Genepool
{
@@ -18,10 +18,9 @@ import binnie.core.machines.inventory.ComponentInventorySlots;
import binnie.genetics.core.GeneticsGUI;
import binnie.core.machines.Machine;
import binnie.genetics.core.GeneticsTexture;
import binnie.craftgui.minecraft.IMachineInformation;
import binnie.core.craftgui.minecraft.IMachineInformation;
import java.util.ArrayList;
import forestry.api.apiculture.IBee;
import forestry.api.genetics.IIndividual;
import binnie.core.machines.MachineUtil;
import forestry.api.apiculture.EnumBeeType;
import binnie.core.BinnieCore;
@@ -6,7 +6,6 @@ package binnie.genetics.machine;
import forestry.api.genetics.ISpeciesRoot;
import binnie.Binnie;
import net.minecraft.nbt.NBTBase;
import net.minecraft.entity.player.EntityPlayer;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.entity.RenderItem;
@@ -42,7 +41,7 @@ import binnie.core.machines.inventory.ComponentInventorySlots;
import binnie.genetics.core.GeneticsGUI;
import binnie.core.machines.Machine;
import binnie.genetics.core.GeneticsTexture;
import binnie.craftgui.minecraft.IMachineInformation;
import binnie.core.craftgui.minecraft.IMachineInformation;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagCompound;
import forestry.api.genetics.IAllele;
@@ -40,7 +40,7 @@ import binnie.core.machines.inventory.ComponentInventorySlots;
import binnie.genetics.core.GeneticsGUI;
import binnie.core.machines.Machine;
import binnie.genetics.core.GeneticsTexture;
import binnie.craftgui.minecraft.IMachineInformation;
import binnie.core.craftgui.minecraft.IMachineInformation;
public class Isolator
{
@@ -35,7 +35,7 @@ import binnie.core.machines.inventory.ComponentInventorySlots;
import binnie.genetics.core.GeneticsGUI;
import binnie.core.machines.Machine;
import binnie.genetics.core.GeneticsTexture;
import binnie.craftgui.minecraft.IMachineInformation;
import binnie.core.craftgui.minecraft.IMachineInformation;
public class Polymeriser
{
@@ -33,7 +33,7 @@ import binnie.core.machines.Machine;
import binnie.genetics.Genetics;
import binnie.Binnie;
import binnie.genetics.core.GeneticsTexture;
import binnie.craftgui.minecraft.IMachineInformation;
import binnie.core.craftgui.minecraft.IMachineInformation;
import binnie.core.resource.BinnieIcon;
public class Sequencer
@@ -6,7 +6,6 @@ package binnie.genetics.machine;
import forestry.api.genetics.ISpeciesRoot;
import binnie.Binnie;
import net.minecraft.nbt.NBTBase;
import net.minecraft.entity.player.EntityPlayer;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.renderer.entity.RenderItem;
@@ -38,7 +37,7 @@ import binnie.core.machines.inventory.ComponentInventorySlots;
import binnie.genetics.core.GeneticsGUI;
import binnie.core.machines.Machine;
import binnie.genetics.core.GeneticsTexture;
import binnie.craftgui.minecraft.IMachineInformation;
import binnie.core.craftgui.minecraft.IMachineInformation;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagCompound;
import forestry.api.genetics.IAllele;