diff --git a/src/main/java/binnie/botany/gui/database/ControlColorMixSymbol.java b/src/main/java/binnie/botany/gui/database/ControlColorMixSymbol.java index 82856698..e6c92fba 100644 --- a/src/main/java/binnie/botany/gui/database/ControlColorMixSymbol.java +++ b/src/main/java/binnie/botany/gui/database/ControlColorMixSymbol.java @@ -18,8 +18,8 @@ import binnie.core.gui.resource.minecraft.StandardTexture; import binnie.core.util.I18N; public class ControlColorMixSymbol extends Control implements ITooltip { - static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2); - static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2); + static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.CONTROLS_2); + static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.CONTROLS_2); IColorMix value; int type; diff --git a/src/main/java/binnie/core/genetics/Tolerance.java b/src/main/java/binnie/core/genetics/Tolerance.java index 3781e3f2..b2a6145f 100644 --- a/src/main/java/binnie/core/genetics/Tolerance.java +++ b/src/main/java/binnie/core/genetics/Tolerance.java @@ -5,22 +5,22 @@ import forestry.api.genetics.EnumTolerance; import forestry.api.genetics.IAllele; public enum Tolerance { - None(0, 0), - Both1(-1, 1), - Both2(-2, 2), - Both3(-3, 3), - Both4(-4, 4), - Both5(-5, 5), - Up1(0, 1), - Up2(0, 2), - Up3(0, 3), - Up4(0, 4), - Up5(0, 5), - Down1(-1, 0), - Down2(-2, 0), - Down3(-3, 0), - Down4(-4, 0), - Down5(-5, 0); + NONE(0, 0), + BOTH_1(-1, 1), + BOTH_2(-2, 2), + BOTH_3(-3, 3), + BOTH_4(-4, 4), + BOTH_5(-5, 5), + UP_1(0, 1), + UP_2(0, 2), + UP_3(0, 3), + UP_4(0, 4), + UP_5(0, 5), + DOWN_1(-1, 0), + DOWN_2(-2, 0), + DOWN_3(-3, 0), + DOWN_4(-4, 0), + DOWN_5(-5, 0); private int[] bounds; diff --git a/src/main/java/binnie/core/gui/BinnieGUIHandler.java b/src/main/java/binnie/core/gui/BinnieGUIHandler.java index 9e1e1c1c..0a40d4c3 100644 --- a/src/main/java/binnie/core/gui/BinnieGUIHandler.java +++ b/src/main/java/binnie/core/gui/BinnieGUIHandler.java @@ -23,7 +23,7 @@ public final class BinnieGUIHandler implements IGuiHandler { @Override @Nullable public final Object getServerGuiElement(final int id, final EntityPlayer player, final World world, final int x, final int y, final int z) { - final Window window = this.getWindow(id, player, world, x, y, z, Side.SERVER); + Window window = this.getWindow(id, player, world, x, y, z, Side.SERVER); if (window == null) { return null; } @@ -38,7 +38,7 @@ public final class BinnieGUIHandler implements IGuiHandler { if (BinnieCore.getBinnieProxy().isSimulating(world)) { return this.getServerGuiElement(id, player, world, x, y, z); } - final Window window = this.getWindow(id, player, world, x, y, z, Side.CLIENT); + Window window = this.getWindow(id, player, world, x, y, z, Side.CLIENT); if (window == null) { return null; } @@ -47,7 +47,7 @@ public final class BinnieGUIHandler implements IGuiHandler { @Nullable public Window getWindow(final int id, final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) { - for (final IBinnieGUID guid : this.mod.getGUIDs()) { + for (IBinnieGUID guid : this.mod.getGUIDs()) { if (guid.ordinal() == id) { return guid.getWindow(player, world, x, y, z, side); } diff --git a/src/main/java/binnie/core/gui/IBinnieGUID.java b/src/main/java/binnie/core/gui/IBinnieGUID.java index d5fb5836..ad741799 100644 --- a/src/main/java/binnie/core/gui/IBinnieGUID.java +++ b/src/main/java/binnie/core/gui/IBinnieGUID.java @@ -12,5 +12,5 @@ import binnie.core.network.IOrdinaled; public interface IBinnieGUID extends IOrdinaled { @Nullable - Window getWindow(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side); + Window getWindow(EntityPlayer player, World world, int x, int y, int z, Side side); } diff --git a/src/main/java/binnie/core/gui/ITooltip.java b/src/main/java/binnie/core/gui/ITooltip.java index 67fc2d65..71ec3ba2 100644 --- a/src/main/java/binnie/core/gui/ITooltip.java +++ b/src/main/java/binnie/core/gui/ITooltip.java @@ -1,5 +1,5 @@ package binnie.core.gui; public interface ITooltip { - void getTooltip(final Tooltip p0); + void getTooltip(Tooltip tooltip); } diff --git a/src/main/java/binnie/core/gui/ITooltipHelp.java b/src/main/java/binnie/core/gui/ITooltipHelp.java index 1e4cc685..65adbc59 100644 --- a/src/main/java/binnie/core/gui/ITooltipHelp.java +++ b/src/main/java/binnie/core/gui/ITooltipHelp.java @@ -1,5 +1,5 @@ package binnie.core.gui; public interface ITooltipHelp { - void getHelpTooltip(final Tooltip p0); + void getHelpTooltip(Tooltip tooltip); } diff --git a/src/main/java/binnie/core/gui/IWidget.java b/src/main/java/binnie/core/gui/IWidget.java index 09435ed1..c6097114 100644 --- a/src/main/java/binnie/core/gui/IWidget.java +++ b/src/main/java/binnie/core/gui/IWidget.java @@ -155,7 +155,7 @@ public interface IWidget { @Nullable Area getCroppedZone(); - void setCroppedZone(final IWidget p0, final Area p1); + void setCroppedZone(IWidget widget, Area area); boolean isCroppedWidet(); diff --git a/src/main/java/binnie/core/gui/Tooltip.java b/src/main/java/binnie/core/gui/Tooltip.java index 91aa57fa..326285a4 100644 --- a/src/main/java/binnie/core/gui/Tooltip.java +++ b/src/main/java/binnie/core/gui/Tooltip.java @@ -16,7 +16,7 @@ public class Tooltip { public Tooltip() { this.tooltip = new ArrayList<>(); - this.type = Type.Standard; + this.type = Type.STANDARD; this.maxWidth = 256; } @@ -87,11 +87,11 @@ public class Tooltip { } public enum Type implements ITooltipType { - Standard, - Help, - Information, - User, - Power + STANDARD, + HELP, + INFORMATION, + USER, + POWER } public interface ITooltipType { diff --git a/src/main/java/binnie/core/gui/WindowGenesis.java b/src/main/java/binnie/core/gui/WindowGenesis.java index c76332b2..03f57d4c 100644 --- a/src/main/java/binnie/core/gui/WindowGenesis.java +++ b/src/main/java/binnie/core/gui/WindowGenesis.java @@ -40,6 +40,7 @@ import binnie.core.gui.minecraft.control.ControlItemDisplay; import binnie.core.gui.minecraft.control.ControlPlayerInventory; import binnie.core.gui.minecraft.control.ControlTabIcon; import binnie.core.gui.window.Panel; +import binnie.core.util.I18N; import binnie.genetics.gui.ControlGenesisOption; public class WindowGenesis extends Window { @@ -66,7 +67,7 @@ public class WindowGenesis extends Window { @Override public void initialiseClient() { new ControlPlayerInventory(this); - this.setTitle("Genesis"); + this.setTitle(I18N.localise("binniecore.gui.genesis.title")); final ControlTabBar tabSystems = new ControlTabBar(this, 8, 28, 23, 100, Position.LEFT, Binnie.GENETICS.getActiveSystems()) { @Override public ControlTab createTab(final int x, final int y, final int w, final int h, final BreedingSystem value) { @@ -116,22 +117,26 @@ public class WindowGenesis extends Window { tabSystems.addEventHandler(new EventValueChanged.Handler() { @Override public void onEvent(final EventValueChanged event) { - WindowGenesis.this.root = ((BreedingSystem) event.getValue()).getSpeciesRoot(); - WindowGenesis.this.template = WindowGenesis.this.root.getDefaultTemplate(); - WindowGenesis.this.refreshTemplate(null); + root = ((BreedingSystem) event.getValue()).getSpeciesRoot(); + template = root.getDefaultTemplate(); + refreshTemplate(null); } }.setOrigin(EventHandler.Origin.SELF, tabSystems)); this.geneList.addEventHandler(new EventValueChanged.Handler() { @Override public void onEvent(final EventValueChanged event) { - final Map> map = Binnie.GENETICS.getChromosomeMap(WindowGenesis.this.root); - final List opts = new ArrayList<>(); - final IChromosomeType chromo = event.value != null ? ((Gene) event.value).getChromosome() : null; - if (chromo != null)// fix NPE - for (final IAllele allele : map.get(chromo)) { - opts.add(new Gene(allele, chromo, WindowGenesis.this.root)); - } - WindowGenesis.this.geneOptions.setOptions(opts); + if(event.value == null){ + return; + } + Map> map = Binnie.GENETICS.getChromosomeMap(root); + List options = new ArrayList<>(); + Gene gene = (Gene) event.value; + IChromosomeType chromosomeType = gene.getChromosome(); + List alleles = map.get(chromosomeType); + for (IAllele allele : alleles) { + options.add(new Gene(allele, chromosomeType, root)); + } + geneOptions.setOptions(options); } }.setOrigin(EventHandler.Origin.SELF, this.geneList)); this.geneOptions.addEventHandler(new EventValueChanged.Handler() { @@ -140,33 +145,32 @@ public class WindowGenesis extends Window { if (event.value == null) { return; } - final IChromosomeType chromo = ((Gene) event.value).getChromosome(); + Gene gene = (Gene) event.value; + IChromosomeType chromosomeType = gene.getChromosome(); IAllele allele = ((Gene) event.value).getAllele(); - WindowGenesis.this.template[chromo.ordinal()] = allele; + template[chromosomeType.ordinal()] = allele; ISpeciesRoot speciesRoot = ((Gene) event.value).getSpeciesRoot(); - if (chromo == speciesRoot.getSpeciesChromosomeType()) { - WindowGenesis.this.template = speciesRoot.getTemplate(allele.getUID()); + if (chromosomeType == speciesRoot.getSpeciesChromosomeType()) { + template = speciesRoot.getTemplate(allele.getUID()); } - WindowGenesis.this.refreshTemplate(chromo); + refreshTemplate(chromosomeType); } }.setOrigin(EventHandler.Origin.SELF, this.geneOptions)); this.panelPickup = new Panel(this, 16, 140, 60, 42, MinecraftGUI.PanelType.Black); this.refreshTemplate(null); } - private void refreshTemplate(@Nullable final IChromosomeType selection) { - final List genes = new ArrayList<>(); - final IChromosomeType[] arr$; - final IChromosomeType[] chromos = arr$ = Binnie.GENETICS.getChromosomeMap(this.root).keySet().toArray(new IChromosomeType[0]); - for (final IChromosomeType type : arr$) { - final IAllele allele = this.template[type.ordinal()]; + private void refreshTemplate(@Nullable IChromosomeType selection) { + List genes = new ArrayList<>(); + IChromosomeType[] chromosomeTypes = Binnie.GENETICS.getChromosomeMap(this.root).keySet().toArray(new IChromosomeType[0]); + for (IChromosomeType type : chromosomeTypes) { + IAllele allele = this.template[type.ordinal()]; if (allele == null) { throw new NullPointerException("Allele missing for Chromosome " + type.getName()); } genes.add(new Gene(allele, type, this.root)); } - final Map> map = Binnie.GENETICS.getChromosomeMap(this.root); - this.geneList.setOptions(genes); + geneList.setOptions(genes); if (selection != null) { this.geneList.setValue(new Gene(this.template[selection.ordinal()], selection, this.root)); } else { @@ -178,11 +182,12 @@ public class WindowGenesis extends Window { private void refreshPickup() { this.panelPickup.deleteAllChildren(); int i = 0; - for (final ISpeciesType type : Binnie.GENETICS.getSystem(this.root).getActiveTypes()) { - final IIndividual ind = this.root.templateAsIndividual(this.template); + BreedingSystem system = Binnie.GENETICS.getSystem(this.root); + for (ISpeciesType type : system.getActiveTypes()) { + IIndividual ind = this.root.templateAsIndividual(this.template); ind.analyze(); - final ItemStack stack = this.root.getMemberStack(ind, type); - final ControlItemDisplay display = new ControlItemDisplay(this.panelPickup, 4 + i % 3 * 18, 4 + i / 3 * 18); + ItemStack stack = this.root.getMemberStack(ind, type); + ControlItemDisplay display = new ControlItemDisplay(this.panelPickup, 4 + i % 3 * 18, 4 + i / 3 * 18); display.setItemStack(stack); display.setTooltip(); display.addEventHandler(new EventMouse.Down.Handler() { @@ -201,20 +206,20 @@ public class WindowGenesis extends Window { public void receiveGuiNBTOnServer(final EntityPlayer player, final String name, final NBTTagCompound nbt) { super.receiveGuiNBTOnServer(player, name, nbt); if (name.equals("genesis")) { - final ItemStack stack = new ItemStack(nbt); - final InventoryPlayer playerInv = player.inventory; + ItemStack stack = new ItemStack(nbt); + InventoryPlayer inventoryPlayer = player.inventory; + ItemStack playerStack = inventoryPlayer.getItemStack(); if (stack.isEmpty()) { return; } - if (playerInv.getItemStack().isEmpty()) { - playerInv.setItemStack(stack); - } else if (playerInv.getItemStack().isItemEqual(stack) && ItemStack.areItemStackTagsEqual(playerInv.getItemStack(), stack)) { - final int fit = stack.getMaxStackSize() - (stack.getCount() + playerInv.getItemStack().getCount()); + if (playerStack.isEmpty()) { + inventoryPlayer.setItemStack(stack); + } else if (playerStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(playerStack, stack)) { + final int fit = stack.getMaxStackSize() - (stack.getCount() + playerStack.getCount()); if (fit >= 0) { - final ItemStack itemStack; - final ItemStack rec = itemStack = stack; - itemStack.grow(playerInv.getItemStack().getCount()); - playerInv.setItemStack(rec); + ItemStack itemStack = stack; + itemStack.grow(playerStack.getCount()); + inventoryPlayer.setItemStack(itemStack); } } player.openContainer.detectAndSendChanges(); diff --git a/src/main/java/binnie/core/gui/controls/ControlCheckbox.java b/src/main/java/binnie/core/gui/controls/ControlCheckbox.java index 565d0310..5a847118 100644 --- a/src/main/java/binnie/core/gui/controls/ControlCheckbox.java +++ b/src/main/java/binnie/core/gui/controls/ControlCheckbox.java @@ -62,9 +62,9 @@ public class ControlCheckbox extends Control implements IControlValue { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - Object texture = this.getValue() ? CraftGUITexture.CheckboxChecked : CraftGUITexture.Checkbox; + Object texture = this.getValue() ? CraftGUITexture.CHECKBOX_CHECKED : CraftGUITexture.CHECKBOX; if (this.isMouseOver()) { - texture = (this.getValue() ? CraftGUITexture.CheckboxCheckedHighlighted : CraftGUITexture.CheckboxHighlighted); + texture = (this.getValue() ? CraftGUITexture.CHECKBOX_CHECKED_HIGHLIGHTED : CraftGUITexture.CHECKBOX_HIGHLIGHTED); } CraftGUI.RENDER.texture(texture, Point.ZERO); } diff --git a/src/main/java/binnie/core/gui/controls/ControlTextEdit.java b/src/main/java/binnie/core/gui/controls/ControlTextEdit.java index 3ef643e5..69845949 100644 --- a/src/main/java/binnie/core/gui/controls/ControlTextEdit.java +++ b/src/main/java/binnie/core/gui/controls/ControlTextEdit.java @@ -83,7 +83,7 @@ public class ControlTextEdit extends Control implements IControlValue { @Override public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.Slot, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.SLOT, this.getArea()); this.renderTextField(); } diff --git a/src/main/java/binnie/core/gui/controls/IControlSelection.java b/src/main/java/binnie/core/gui/controls/IControlSelection.java index c866a3cb..ed0ff66f 100644 --- a/src/main/java/binnie/core/gui/controls/IControlSelection.java +++ b/src/main/java/binnie/core/gui/controls/IControlSelection.java @@ -3,7 +3,7 @@ package binnie.core.gui.controls; public interface IControlSelection { T getSelectedValue(); - void setSelectedValue(final T p0); + void setSelectedValue(T value); - boolean isSelected(final IControlSelectionOption p0); + boolean isSelected(IControlSelectionOption option); } diff --git a/src/main/java/binnie/core/gui/controls/button/ControlButton.java b/src/main/java/binnie/core/gui/controls/button/ControlButton.java index a84f53e2..c7ea3004 100644 --- a/src/main/java/binnie/core/gui/controls/button/ControlButton.java +++ b/src/main/java/binnie/core/gui/controls/button/ControlButton.java @@ -61,11 +61,11 @@ public class ControlButton extends Control { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - Object texture = CraftGUITexture.ButtonDisabled; + Object texture = CraftGUITexture.BUTTON_DISABLED; if (this.isMouseOver()) { - texture = CraftGUITexture.ButtonHighlighted; + texture = CraftGUITexture.BUTTON_HIGHLIGHTED; } else if (this.isEnabled()) { - texture = CraftGUITexture.Button; + texture = CraftGUITexture.BUTTON; } CraftGUI.RENDER.texture(texture, this.getArea()); } diff --git a/src/main/java/binnie/core/gui/controls/listbox/ControlOption.java b/src/main/java/binnie/core/gui/controls/listbox/ControlOption.java index 16ecebe5..1e2d5323 100644 --- a/src/main/java/binnie/core/gui/controls/listbox/ControlOption.java +++ b/src/main/java/binnie/core/gui/controls/listbox/ControlOption.java @@ -56,7 +56,7 @@ public class ControlOption extends Control implements IControlValue { @SideOnly(Side.CLIENT) public void onRenderForeground(int guiWidth, int guiHeight) { if (this.isCurrentSelection()) { - CraftGUI.RENDER.texture(CraftGUITexture.Outline, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, this.getArea()); } } } diff --git a/src/main/java/binnie/core/gui/controls/scroll/ControlScrollBar.java b/src/main/java/binnie/core/gui/controls/scroll/ControlScrollBar.java index f99f302e..8555ce35 100644 --- a/src/main/java/binnie/core/gui/controls/scroll/ControlScrollBar.java +++ b/src/main/java/binnie/core/gui/controls/scroll/ControlScrollBar.java @@ -73,11 +73,11 @@ public class ControlScrollBar extends Control { @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { final Area renderArea = this.getRenderArea(); - Object texture = CraftGUITexture.ScrollDisabled; + Object texture = CraftGUITexture.SCROLL_DISABLED; if (this.isMouseOver()) { - texture = CraftGUITexture.ScrollHighlighted; + texture = CraftGUITexture.SCROLL_HIGHLIGHTED; } else if (this.isEnabled()) { - texture = CraftGUITexture.Scroll; + texture = CraftGUITexture.SCROLL; } CraftGUI.RENDER.texture(texture, renderArea); } diff --git a/src/main/java/binnie/core/gui/controls/tab/ControlTab.java b/src/main/java/binnie/core/gui/controls/tab/ControlTab.java index cd688891..258c1f27 100644 --- a/src/main/java/binnie/core/gui/controls/tab/ControlTab.java +++ b/src/main/java/binnie/core/gui/controls/tab/ControlTab.java @@ -73,17 +73,17 @@ public class ControlTab extends Control implements ITooltip, IControlValue @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - Object texture = CraftGUITexture.TabDisabled; + Object texture = CraftGUITexture.TAB_DISABLED; if (this.isMouseOver()) { - texture = CraftGUITexture.TabHighlighted; + texture = CraftGUITexture.TAB_HIGHLIGHTED; } else if (this.isCurrentSelection()) { - texture = CraftGUITexture.Tab; + texture = CraftGUITexture.TAB; } final Texture lTexture = CraftGUI.RENDER.getTexture(texture); final Position position = this.getTabPosition(); Texture iTexture = lTexture.crop(position, 8); final Area area = this.getArea(); - if (texture == CraftGUITexture.TabDisabled) { + if (texture == CraftGUITexture.TAB_DISABLED) { if (position == Position.Top || position == Position.LEFT) { area.setPosition(area.getPosition().sub(new Point(4 * position.x(), 4 * position.y()))); area.setSize(area.getSize().add(new Point(4 * position.x(), 4 * position.y()))); @@ -95,13 +95,13 @@ public class ControlTab extends Control implements ITooltip, IControlValue if (this instanceof ControlTabIcon) { final ControlTabIcon icon = (ControlTabIcon) this; final ControlItemDisplay item = (ControlItemDisplay) getFirstChild(); - if (texture == CraftGUITexture.TabDisabled) { + if (texture == CraftGUITexture.TAB_DISABLED) { item.setColor(-1431655766); } else { item.setColor(-1); } if (icon.hasOutline()) { - iTexture = CraftGUI.RENDER.getTexture(CraftGUITexture.TabOutline); + iTexture = CraftGUI.RENDER.getTexture(CraftGUITexture.TAB_OUTLINE); iTexture = iTexture.crop(position, 8); RenderUtil.setColour(icon.getOutlineColour()); CraftGUI.RENDER.texture(iTexture, area.inset(2)); diff --git a/src/main/java/binnie/core/gui/database/ControlBreedingProgress.java b/src/main/java/binnie/core/gui/database/ControlBreedingProgress.java index 5f398407..12d412ef 100644 --- a/src/main/java/binnie/core/gui/database/ControlBreedingProgress.java +++ b/src/main/java/binnie/core/gui/database/ControlBreedingProgress.java @@ -16,7 +16,7 @@ import binnie.core.gui.resource.minecraft.CraftGUITextureSheet; import binnie.core.gui.resource.minecraft.StandardTexture; class ControlBreedingProgress extends Control { - private static Texture Progress = new StandardTexture(80, 22, 4, 4, CraftGUITextureSheet.Controls2); + private static Texture Progress = new StandardTexture(80, 22, 4, 4, CraftGUITextureSheet.CONTROLS_2); private float percentage; private int colour; @@ -29,7 +29,7 @@ class ControlBreedingProgress extends Control { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.PanelBlack, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.PANEL_BLACK, this.getArea()); final Area area = this.getArea().inset(1); area.setSize(new Point(Math.round(area.size().xPos() * this.percentage), area.size().yPos())); RenderUtil.setColour(this.colour); diff --git a/src/main/java/binnie/core/gui/database/ControlMutationSymbol.java b/src/main/java/binnie/core/gui/database/ControlMutationSymbol.java index bad52569..745681bd 100644 --- a/src/main/java/binnie/core/gui/database/ControlMutationSymbol.java +++ b/src/main/java/binnie/core/gui/database/ControlMutationSymbol.java @@ -21,8 +21,8 @@ import binnie.core.gui.resource.minecraft.StandardTexture; import binnie.core.util.I18N; class ControlMutationSymbol extends Control implements ITooltip { - private static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2); - private static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2); + private static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.CONTROLS_2); + private static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.CONTROLS_2); private IMutation value; private boolean discovered; private int type; diff --git a/src/main/java/binnie/core/gui/events/EventHandler.java b/src/main/java/binnie/core/gui/events/EventHandler.java index 6fe660c5..99904c60 100644 --- a/src/main/java/binnie/core/gui/events/EventHandler.java +++ b/src/main/java/binnie/core/gui/events/EventHandler.java @@ -3,26 +3,26 @@ package binnie.core.gui.events; import binnie.core.gui.IWidget; public abstract class EventHandler { - Class eventClass; + Class eventClass; Origin origin; IWidget relative; - public EventHandler(final Class eventClass) { + public EventHandler(Class eventClass) { this.origin = Origin.ANY; this.relative = null; this.eventClass = eventClass; } - public EventHandler setOrigin(final Origin origin, final IWidget relative) { + public EventHandler setOrigin(Origin origin, IWidget relative) { this.origin = origin; this.relative = relative; return this; } - public abstract void onEvent(final E p0); + public abstract void onEvent(E event); - public final boolean handles(final Event e) { - return this.eventClass.isInstance(e) && this.origin.isOrigin(e.getOrigin(), this.relative); + public final boolean handles(Event event) { + return this.eventClass.isInstance(event) && this.origin.isOrigin(event.getOrigin(), this.relative); } public enum Origin { @@ -31,7 +31,7 @@ public abstract class EventHandler { PARENT, DIRECT_CHILD; - public boolean isOrigin(final IWidget origin, final IWidget test) { + public boolean isOrigin(IWidget origin, IWidget test) { switch (this) { case ANY: { return true; diff --git a/src/main/java/binnie/core/gui/minecraft/Dialog.java b/src/main/java/binnie/core/gui/minecraft/Dialog.java index 920fde7d..8a04718d 100644 --- a/src/main/java/binnie/core/gui/minecraft/Dialog.java +++ b/src/main/java/binnie/core/gui/minecraft/Dialog.java @@ -41,8 +41,8 @@ public abstract class Dialog extends Control { @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { RenderUtil.drawGradientRect(this.getArea().outset(400), -1442840576, -1442840576); - CraftGUI.RENDER.texture(CraftGUITexture.Window, this.getArea()); - CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, this.getArea().inset(4)); + CraftGUI.RENDER.texture(CraftGUITexture.WINDOW, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, this.getArea().inset(4)); } @Override diff --git a/src/main/java/binnie/core/gui/minecraft/GuiCraftGUI.java b/src/main/java/binnie/core/gui/minecraft/GuiCraftGUI.java index 2f6c7e2b..97a26830 100644 --- a/src/main/java/binnie/core/gui/minecraft/GuiCraftGUI.java +++ b/src/main/java/binnie/core/gui/minecraft/GuiCraftGUI.java @@ -102,10 +102,10 @@ public class GuiCraftGUI extends GuiContainer { if(draggedItem.isEmpty()) { final MinecraftTooltip tooltip = new MinecraftTooltip(); if (this.isHelpMode()) { - tooltip.setType(Tooltip.Type.Help); + tooltip.setType(Tooltip.Type.HELP); this.window.getHelpTooltip(tooltip); } else { - tooltip.setType(Tooltip.Type.Standard); + tooltip.setType(Tooltip.Type.STANDARD); this.window.getTooltip(tooltip); } if (tooltip.exists()) { diff --git a/src/main/java/binnie/core/gui/minecraft/Window.java b/src/main/java/binnie/core/gui/minecraft/Window.java index c96a5903..4177462c 100644 --- a/src/main/java/binnie/core/gui/minecraft/Window.java +++ b/src/main/java/binnie/core/gui/minecraft/Window.java @@ -230,7 +230,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG CraftGUI.RENDER.texture(this.getBackground2(), new Point(256, 0)); } RenderUtil.setColour(this.getColor()); - CraftGUI.RENDER.texture(CraftGUITexture.Window, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.WINDOW, this.getArea()); } @Override diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlEnergyBar.java b/src/main/java/binnie/core/gui/minecraft/control/ControlEnergyBar.java index aefdaf6d..5b53fb5c 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlEnergyBar.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlEnergyBar.java @@ -82,7 +82,7 @@ public class ControlEnergyBar extends Control implements ITooltip { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarBack, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_BACK, this.getArea()); final float percentage = this.getPercentage() / 100.0f; int colourFromPercentage = this.getColourFromPercentage(percentage); RenderUtil.setColour(colourFromPercentage); @@ -102,15 +102,15 @@ public class ControlEnergyBar extends Control implements ITooltip { } } if (this.isMouseOver() && Window.get(this).getGui().isHelpMode()) { - final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.Help); + final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.HELP); RenderUtil.drawGradientRect(this.getArea().inset(1), c, c); } else if (ControlEnergyBar.isError) { final int c = -1442840576 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error); RenderUtil.drawGradientRect(this.getArea().inset(1), c, c); } - CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarGlow, area); + CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_GLOW, area); GlStateManager.color(1, 1, 1, 1); - CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarGlass, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_GLASS, this.getArea()); } @Override @@ -118,12 +118,12 @@ public class ControlEnergyBar extends Control implements ITooltip { public void onRenderForeground(int guiWidth, int guiHeight) { if (this.isMouseOver() && Window.get(this).getGui().isHelpMode()) { final Area area = this.getArea(); - RenderUtil.setColour(MinecraftTooltip.getOutline(Tooltip.Type.Help)); - CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1)); + RenderUtil.setColour(MinecraftTooltip.getOutline(Tooltip.Type.HELP)); + CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1)); } else if (ControlEnergyBar.isError) { final Area area = this.getArea(); RenderUtil.setColour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error)); - CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1)); + CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1)); } } diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlErrorState.java b/src/main/java/binnie/core/gui/minecraft/control/ControlErrorState.java index 0011dfb3..6213a4ad 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlErrorState.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlErrorState.java @@ -34,11 +34,11 @@ public class ControlErrorState extends Control implements ITooltip { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - Object texture = CraftGUITexture.StateWarning; + Object texture = CraftGUITexture.STATE_WARNING; if (this.errorState == null) { - texture = CraftGUITexture.StateNone; + texture = CraftGUITexture.STATE_NONE; } else if (this.type == 0) { - texture = CraftGUITexture.StateError; + texture = CraftGUITexture.STATE_ERROR; } CraftGUI.RENDER.texture(texture, Point.ZERO); super.onRenderBackground(guiWidth, guiHeight); diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlHelp.java b/src/main/java/binnie/core/gui/minecraft/control/ControlHelp.java index 35b83b2c..1211c20f 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlHelp.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlHelp.java @@ -20,12 +20,12 @@ public class ControlHelp extends Control implements ITooltip { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.HelpButton, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.HELP_BUTTON, this.getArea()); } @Override public void getTooltip(final Tooltip tooltip) { - tooltip.setType(Tooltip.Type.Help); + tooltip.setType(Tooltip.Type.HELP); tooltip.add("Help"); tooltip.add("To activate help tooltips,"); tooltip.add("hold down the tab key and"); diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlInfo.java b/src/main/java/binnie/core/gui/minecraft/control/ControlInfo.java index 4ac58298..bcf96429 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlInfo.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlInfo.java @@ -23,12 +23,12 @@ public class ControlInfo extends Control implements ITooltip { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.InfoButton, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.INFO_BUTTON, this.getArea()); } @Override public void getTooltip(final Tooltip tooltip) { - tooltip.setType(Tooltip.Type.Information); + tooltip.setType(Tooltip.Type.INFORMATION); tooltip.add("Info"); tooltip.add(this.info); tooltip.setMaxWidth(200); diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlLiquidTank.java b/src/main/java/binnie/core/gui/minecraft/control/ControlLiquidTank.java index 4cb0bd26..45569831 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlLiquidTank.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlLiquidTank.java @@ -83,10 +83,10 @@ public class ControlLiquidTank extends Control implements ITooltip { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, Point.ZERO); + CraftGUI.RENDER.texture(this.horizontal ? CraftGUITexture.HORIZONTAL_LIQUID_TANK : CraftGUITexture.LIQUID_TANK, Point.ZERO); GuiCraftGUI gui = Window.get(this).getGui(); if (this.isMouseOver() && gui.isHelpMode()) { - final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.Help); + final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.HELP); RenderUtil.drawGradientRect(this.getArea().inset(1), c, c); } else if (ControlLiquidTank.tankError.contains(this.tankID)) { final int c = -1442840576 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error); @@ -139,17 +139,17 @@ public class ControlLiquidTank extends Control implements ITooltip { @Override @SideOnly(Side.CLIENT) public void onRenderForeground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, Point.ZERO); + CraftGUI.RENDER.texture(this.horizontal ? CraftGUITexture.HORIZONTAL_LIQUID_TANK_OVERLAY : CraftGUITexture.LIQUID_TANK_OVERLAY, Point.ZERO); GuiCraftGUI gui = Window.get(this).getGui(); if (this.isMouseOver() && gui.isHelpMode()) { final Area area = this.getArea(); - RenderUtil.setColour(MinecraftTooltip.getOutline(Tooltip.Type.Help)); - CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1)); + RenderUtil.setColour(MinecraftTooltip.getOutline(Tooltip.Type.HELP)); + CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1)); } if (ControlLiquidTank.tankError.contains(this.tankID)) { final Area area = this.getArea(); RenderUtil.setColour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error)); - CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1)); + CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1)); } } diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlPowerSystem.java b/src/main/java/binnie/core/gui/minecraft/control/ControlPowerSystem.java index b72a86bd..8775e8e5 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlPowerSystem.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlPowerSystem.java @@ -24,12 +24,12 @@ public class ControlPowerSystem extends Control implements ITooltip { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.PowerButton, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.POWER_BUTTON, this.getArea()); } @Override public void getTooltip(final Tooltip tooltip) { - tooltip.setType(Tooltip.Type.Power); + tooltip.setType(Tooltip.Type.POWER); tooltip.add("Power Supply"); tooltip.add("Powered by " + this.system.getUnitName()); tooltip.setMaxWidth(200); diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlSlide.java b/src/main/java/binnie/core/gui/minecraft/control/ControlSlide.java index 978b6927..a90dfcf8 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlSlide.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlSlide.java @@ -50,9 +50,9 @@ public class ControlSlide extends Control { Area tabArea = new Area(hor ? (-lh / 2) : (-lw / 2), hor ? (-lw / 2) : (-lh / 2), hor ? lh : lw, hor ? lw : lh); final Point shift = new Point(ar.width() * (1 - this.anchor.x()) / 2, ar.height() * (1 - this.anchor.y()) / 2); tabArea = tabArea.shift(shift.xPos() - (-3 + lh / 2) * this.anchor.x(), shift.yPos() - (-3 + lh / 2) * this.anchor.y()); - Texture texture = CraftGUI.RENDER.getTexture(this.isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(this.anchor.opposite(), 8); + Texture texture = CraftGUI.RENDER.getTexture(this.isSlideActive() ? CraftGUITexture.TAB : CraftGUITexture.TAB_DISABLED).crop(this.anchor.opposite(), 8); CraftGUI.RENDER.texture(texture, tabArea); - texture = CraftGUI.RENDER.getTexture(CraftGUITexture.TabOutline).crop(this.anchor.opposite(), 8); + texture = CraftGUI.RENDER.getTexture(CraftGUITexture.TAB_OUTLINE).crop(this.anchor.opposite(), 8); CraftGUI.RENDER.texture(texture, tabArea.inset(2)); final Area labelArea = new Area(-lw / 2, 0, lw, lh); GlStateManager.pushMatrix(); @@ -66,8 +66,8 @@ public class ControlSlide extends Control { RenderUtil.drawText(labelArea, TextJustification.MIDDLE_CENTER, this.label, 16777215); GlStateManager.popMatrix(); } - CraftGUI.RENDER.texture(CraftGUITexture.Window, this.getArea()); - final Object slideTexture = (this.anchor == Position.BOTTOM) ? CraftGUITexture.SlideDown : ((this.anchor == Position.Top) ? CraftGUITexture.SlideUp : ((this.anchor == Position.LEFT) ? CraftGUITexture.SlideLeft : CraftGUITexture.SlideRight)); + CraftGUI.RENDER.texture(CraftGUITexture.WINDOW, this.getArea()); + final Object slideTexture = (this.anchor == Position.BOTTOM) ? CraftGUITexture.SLIDE_DOWN : ((this.anchor == Position.Top) ? CraftGUITexture.SLIDE_UP : ((this.anchor == Position.LEFT) ? CraftGUITexture.SLIDE_LEFT : CraftGUITexture.SLIDE_RIGHT)); CraftGUI.RENDER.texture(slideTexture, new Point((this.anchor.x() + 1) * this.getWidth() / 2 - 8, (this.anchor.y() + 1) * this.getHeight() / 2 - 8)); } diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlSlot.java b/src/main/java/binnie/core/gui/minecraft/control/ControlSlot.java index 1d53361a..aa387ffa 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlSlot.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlSlot.java @@ -74,7 +74,7 @@ public class ControlSlot extends ControlSlotBase { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.Slot, Point.ZERO); + CraftGUI.RENDER.texture(CraftGUITexture.SLOT, Point.ZERO); final InventorySlot islot = this.getInventorySlot(); if (islot != null) { SlotValidator validator = islot.getValidator(); @@ -137,7 +137,7 @@ public class ControlSlot extends ControlSlotBase { area.setPosition(Point.ZERO.sub(this.getPosition())); } RenderUtil.setColour(c); - CraftGUI.RENDER.texture(CraftGUITexture.Outline, area.outset(1)); + CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, area.outset(1)); } } diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlSlotBase.java b/src/main/java/binnie/core/gui/minecraft/control/ControlSlotBase.java index 2666ab76..f59645db 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlSlotBase.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlSlotBase.java @@ -48,7 +48,7 @@ public abstract class ControlSlotBase extends Control implements ITooltip { @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { final int size = this.getSize().xPos(); - CraftGUI.RENDER.texture(CraftGUITexture.Slot, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.SLOT, this.getArea()); if (this.getTopParent().getMousedOverWidget() == this) { RenderUtil.drawGradientRect(new Area(new Point(1, 1), this.getArea().size().sub(new Point(2, 2))), -2130706433, -2130706433); } diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlSlotCharge.java b/src/main/java/binnie/core/gui/minecraft/control/ControlSlotCharge.java index 0c330f2e..78e9649a 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlSlotCharge.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlSlotCharge.java @@ -29,8 +29,8 @@ public class ControlSlotCharge extends Control { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.PanelBlack, this.getArea()); - CraftGUI.RENDER.texturePercentage(CraftGUI.RENDER.getTexture(CraftGUITexture.SlotCharge), this.getArea().inset(1), Position.BOTTOM, this.getCharge()); + CraftGUI.RENDER.texture(CraftGUITexture.PANEL_BLACK, this.getArea()); + CraftGUI.RENDER.texturePercentage(CraftGUI.RENDER.getTexture(CraftGUITexture.SLOT_CHARGE), this.getArea().inset(1), Position.BOTTOM, this.getCharge()); } @Override diff --git a/src/main/java/binnie/core/gui/minecraft/control/ControlUser.java b/src/main/java/binnie/core/gui/minecraft/control/ControlUser.java index e67d4f2d..c6018b9e 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/ControlUser.java +++ b/src/main/java/binnie/core/gui/minecraft/control/ControlUser.java @@ -28,12 +28,12 @@ public class ControlUser extends Control implements ITooltip { @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.UserButton, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.USER_BUTTON, this.getArea()); } @Override public void getTooltip(final Tooltip tooltip) { - tooltip.setType(Tooltip.Type.User); + tooltip.setType(Tooltip.Type.USER); tooltip.add("Owner"); if (!Objects.equals(this.username, "")) { tooltip.add(this.username); diff --git a/src/main/java/binnie/core/gui/minecraft/control/EnumHighlighting.java b/src/main/java/binnie/core/gui/minecraft/control/EnumHighlighting.java index 26af5dd7..ae2200e7 100644 --- a/src/main/java/binnie/core/gui/minecraft/control/EnumHighlighting.java +++ b/src/main/java/binnie/core/gui/minecraft/control/EnumHighlighting.java @@ -15,7 +15,7 @@ public enum EnumHighlighting { return MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error); } case Help: { - return MinecraftTooltip.getOutline(Tooltip.Type.Help); + return MinecraftTooltip.getOutline(Tooltip.Type.HELP); } case ShiftClick: { return 16776960; diff --git a/src/main/java/binnie/core/gui/resource/IStyleSheet.java b/src/main/java/binnie/core/gui/resource/IStyleSheet.java index d604e119..35ce70a0 100644 --- a/src/main/java/binnie/core/gui/resource/IStyleSheet.java +++ b/src/main/java/binnie/core/gui/resource/IStyleSheet.java @@ -5,5 +5,5 @@ import net.minecraftforge.fml.relauncher.SideOnly; public interface IStyleSheet { @SideOnly(Side.CLIENT) - Texture getTexture(final Object p0); + Texture getTexture(Object object); } diff --git a/src/main/java/binnie/core/gui/resource/StyleSheetPunnett.java b/src/main/java/binnie/core/gui/resource/StyleSheetPunnett.java index 36d91d21..f5d91cd7 100644 --- a/src/main/java/binnie/core/gui/resource/StyleSheetPunnett.java +++ b/src/main/java/binnie/core/gui/resource/StyleSheetPunnett.java @@ -8,11 +8,11 @@ import binnie.genetics.gui.punnett.ExtraBeeGUITexture; public class StyleSheetPunnett extends StyleSheet { public StyleSheetPunnett() { - this.textures.put(CraftGUITexture.Window, new PaddedTexture(0, 0, 160, 160, 0, BinnieCoreTexture.GUI_PUNNETT, 32, 32, 32, 32)); - this.textures.put(CraftGUITexture.Slot, new StandardTexture(160, 0, 18, 18, 0, BinnieCoreTexture.GUI_PUNNETT)); + this.textures.put(CraftGUITexture.WINDOW, new PaddedTexture(0, 0, 160, 160, 0, BinnieCoreTexture.GUI_PUNNETT, 32, 32, 32, 32)); + this.textures.put(CraftGUITexture.SLOT, new StandardTexture(160, 0, 18, 18, 0, BinnieCoreTexture.GUI_PUNNETT)); this.textures.put(ExtraBeeGUITexture.Chromosome, new StandardTexture(160, 36, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT)); this.textures.put(ExtraBeeGUITexture.Chromosome2, new StandardTexture(160, 52, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT)); - this.textures.put(CraftGUITexture.HelpButton, new StandardTexture(178, 0, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT)); - this.textures.put(CraftGUITexture.InfoButton, new StandardTexture(178, 16, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT)); + this.textures.put(CraftGUITexture.HELP_BUTTON, new StandardTexture(178, 0, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT)); + this.textures.put(CraftGUITexture.INFO_BUTTON, new StandardTexture(178, 16, 16, 16, 0, BinnieCoreTexture.GUI_PUNNETT)); } } diff --git a/src/main/java/binnie/core/gui/resource/minecraft/CraftGUITexture.java b/src/main/java/binnie/core/gui/resource/minecraft/CraftGUITexture.java index 0e33e134..a25116c7 100644 --- a/src/main/java/binnie/core/gui/resource/minecraft/CraftGUITexture.java +++ b/src/main/java/binnie/core/gui/resource/minecraft/CraftGUITexture.java @@ -1,48 +1,48 @@ package binnie.core.gui.resource.minecraft; public enum CraftGUITexture { - Window("window"), - PanelGray("panel.gray"), - PanelBlack("panel.black"), - PanelTinted("panel.tinted"), - ButtonDisabled("button.disabled"), - Button("button"), - ButtonHighlighted("button.highlighted"), - Slot("slot"), - SlotBorder("slot.border"), - SlotOverlay("slot.overlay"), - SlotCharge("slot.charge"), - LiquidTank("liquidtank"), - LiquidTankOverlay("liquidtank.overlay"), - StateError("errorstate.error"), - StateWarning("errorstate.warning"), - StateNone("errorstate.none"), - EnergyBarBack("energybar.back"), - EnergyBarGlow("energybar.glow"), - EnergyBarGlass("energybar.glass"), - TabDisabled("tab.disabled"), - Tab("tab"), - TabHighlighted("tab.highlighted"), - TabOutline("tab.outline"), - TabSolid("tab.solid"), - ScrollDisabled("scroll.disabled"), - Scroll("scroll"), - ScrollHighlighted("scroll.highlighted"), - Outline("outline"), - HelpButton("button.help"), - InfoButton("button.info"), - UserButton("button.user"), - PowerButton("button.power"), - HorizontalLiquidTank("horizontalliquidtank"), - HorizontalLiquidTankOverlay("horizontalliquidtank.overlay"), - SlideUp("slide.up"), - SlideDown("slide.down"), - SlideLeft("slide.left"), - SlideRight("slide.right"), - Checkbox("checkbox"), - CheckboxHighlighted("checkbox.highlighted"), - CheckboxChecked("checkbox.checked"), - CheckboxCheckedHighlighted("checkbox.checked.highlighted"); + WINDOW("window"), + PANEL_GRAY("panel.gray"), + PANEL_BLACK("panel.black"), + PANEL_TINTED("panel.tinted"), + BUTTON_DISABLED("button.disabled"), + BUTTON("button"), + BUTTON_HIGHLIGHTED("button.highlighted"), + SLOT("slot"), + SLOT_BORDER("slot.border"), + SLOT_OVERLAY("slot.overlay"), + SLOT_CHARGE("slot.charge"), + LIQUID_TANK("liquidtank"), + LIQUID_TANK_OVERLAY("liquidtank.overlay"), + STATE_ERROR("errorstate.error"), + STATE_WARNING("errorstate.warning"), + STATE_NONE("errorstate.none"), + ENERGY_BAR_BACK("energybar.back"), + ENERGY_BAR_GLOW("energybar.glow"), + ENERGY_BAR_GLASS("energybar.glass"), + TAB_DISABLED("tab.disabled"), + TAB("tab"), + TAB_HIGHLIGHTED("tab.highlighted"), + TAB_OUTLINE("tab.outline"), + TAB_SOLID("tab.solid"), + SCROLL_DISABLED("scroll.disabled"), + SCROLL("scroll"), + SCROLL_HIGHLIGHTED("scroll.highlighted"), + OUTLINE("outline"), + HELP_BUTTON("button.help"), + INFO_BUTTON("button.info"), + USER_BUTTON("button.user"), + POWER_BUTTON("button.power"), + HORIZONTAL_LIQUID_TANK("horizontalliquidtank"), + HORIZONTAL_LIQUID_TANK_OVERLAY("horizontalliquidtank.overlay"), + SLIDE_UP("slide.up"), + SLIDE_DOWN("slide.down"), + SLIDE_LEFT("slide.left"), + SLIDE_RIGHT("slide.right"), + CHECKBOX("checkbox"), + CHECKBOX_HIGHLIGHTED("checkbox.highlighted"), + CHECKBOX_CHECKED("checkbox.checked"), + CHECKBOX_CHECKED_HIGHLIGHTED("checkbox.checked.highlighted"); String name; diff --git a/src/main/java/binnie/core/gui/resource/minecraft/CraftGUITextureSheet.java b/src/main/java/binnie/core/gui/resource/minecraft/CraftGUITextureSheet.java index c21c30ed..f04c485b 100644 --- a/src/main/java/binnie/core/gui/resource/minecraft/CraftGUITextureSheet.java +++ b/src/main/java/binnie/core/gui/resource/minecraft/CraftGUITextureSheet.java @@ -10,9 +10,9 @@ import binnie.core.resource.BinnieResource; import binnie.core.resource.IBinnieTexture; public enum CraftGUITextureSheet implements IBinnieTexture { - Controls2("controls"), - Panel2("panels"), - Slots("slots"); + CONTROLS_2("controls"), + PANEL_2("panels"), + SLOTS("slots"); private final String name; diff --git a/src/main/java/binnie/core/gui/window/Panel.java b/src/main/java/binnie/core/gui/window/Panel.java index 250411ed..141f82fe 100644 --- a/src/main/java/binnie/core/gui/window/Panel.java +++ b/src/main/java/binnie/core/gui/window/Panel.java @@ -33,23 +33,23 @@ public class Panel extends Control { if (panelType instanceof MinecraftGUI.PanelType) { switch ((MinecraftGUI.PanelType) panelType) { case Black: { - CraftGUI.RENDER.texture(CraftGUITexture.PanelBlack, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.PANEL_BLACK, this.getArea()); break; } case Gray: { - CraftGUI.RENDER.texture(CraftGUITexture.PanelGray, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.PANEL_GRAY, this.getArea()); break; } case Tinted: { - CraftGUI.RENDER.texture(CraftGUITexture.PanelTinted, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.PANEL_TINTED, this.getArea()); break; } case Outline: { - CraftGUI.RENDER.texture(CraftGUITexture.Outline, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, this.getArea()); break; } case TabOutline: { - CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, this.getArea()); break; } default: { diff --git a/src/main/java/binnie/core/machines/storage/WindowCompartment.java b/src/main/java/binnie/core/machines/storage/WindowCompartment.java index e96640c2..7396f66f 100644 --- a/src/main/java/binnie/core/machines/storage/WindowCompartment.java +++ b/src/main/java/binnie/core/machines/storage/WindowCompartment.java @@ -159,7 +159,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh @Override @SideOnly(Side.CLIENT) public void onRenderForeground(int guiWidth, int guiHeight) { - final Texture iTexture = CraftGUI.RENDER.getTexture(CraftGUITexture.TabOutline); + final Texture iTexture = CraftGUI.RENDER.getTexture(CraftGUITexture.TAB_OUTLINE); RenderUtil.setColour(WindowCompartment.this.getTab(WindowCompartment.this.panels.get(this)).getColor().getColour()); CraftGUI.RENDER.texture(iTexture, this.getArea().inset(3)); } @@ -290,7 +290,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - final Object texture = this.isMouseOver() ? CraftGUITexture.TabHighlighted : CraftGUITexture.Tab; + final Object texture = this.isMouseOver() ? CraftGUITexture.TAB_HIGHLIGHTED : CraftGUITexture.TAB; CraftGUI.RENDER.texture(CraftGUI.RENDER.getTexture(texture).crop(Position.BOTTOM, 8), this.getArea()); } }; @@ -378,7 +378,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { RenderUtil.setColour(11184810); - CraftGUI.RENDER.texture(CraftGUITexture.Outline, this.getArea().inset(new Border(0, 6, 0, 0))); + CraftGUI.RENDER.texture(CraftGUITexture.OUTLINE, this.getArea().inset(new Border(0, 6, 0, 0))); } }; scroll.setScrollableContent(this.slotGrid = new Control(scroll, 1, 1, 108, 18)); diff --git a/src/main/java/binnie/extratrees/gui/machines/ControlTileSelect.java b/src/main/java/binnie/extratrees/gui/machines/ControlTileSelect.java index d1cb04d1..68e0f74b 100644 --- a/src/main/java/binnie/extratrees/gui/machines/ControlTileSelect.java +++ b/src/main/java/binnie/extratrees/gui/machines/ControlTileSelect.java @@ -166,7 +166,7 @@ public class ControlTileSelect extends Control implements IControlValue @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.Slot, Point.ZERO); + CraftGUI.RENDER.texture(CraftGUITexture.SLOT, Point.ZERO); } @Override diff --git a/src/main/java/binnie/extratrees/kitchen/craftgui/ControlSlotFluid.java b/src/main/java/binnie/extratrees/kitchen/craftgui/ControlSlotFluid.java index 6bed893d..321c5370 100644 --- a/src/main/java/binnie/extratrees/kitchen/craftgui/ControlSlotFluid.java +++ b/src/main/java/binnie/extratrees/kitchen/craftgui/ControlSlotFluid.java @@ -45,7 +45,7 @@ public class ControlSlotFluid extends Control implements ITooltip { @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { final int size = this.getSize().xPos(); - CraftGUI.RENDER.texture(CraftGUITexture.Slot, this.getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.SLOT, this.getArea()); if (this.getTopParent().getMousedOverWidget() == this) { RenderUtil.drawGradientRect(new Area(new Point(1, 1), this.getArea().size().sub(new Point(2, 2))), -2130706433, -2130706433); } diff --git a/src/main/java/binnie/genetics/gui/analyst/AnalystPageDatabase.java b/src/main/java/binnie/genetics/gui/analyst/AnalystPageDatabase.java index 7d2a1113..28512da5 100644 --- a/src/main/java/binnie/genetics/gui/analyst/AnalystPageDatabase.java +++ b/src/main/java/binnie/genetics/gui/analyst/AnalystPageDatabase.java @@ -66,9 +66,9 @@ public class AnalystPageDatabase extends ControlAnalystPage { @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { RenderUtil.setColour(5592405); - CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().inset(1)); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().inset(1)); RenderUtil.setColour(AnalystPageDatabase.this.getColor()); - CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea()); renderTextField(); } }; @@ -163,12 +163,12 @@ public class AnalystPageDatabase extends ControlAnalystPage { WindowAnalyst window = (WindowAnalyst) AnalystPageDatabase.this.getTopParent(); if (window.getIndividual() != null && window.getIndividual().getGenome().getPrimary() == species) { RenderUtil.setColour(15658734); - CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().outset(1)); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().outset(1)); RenderUtil.setColour(AnalystPageDatabase.this.getColor()); - CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea().outset(1)); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea().outset(1)); } else if (calculateIsMouseOver()) { RenderUtil.setColour(15658734); - CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().outset(1)); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().outset(1)); } super.onRenderBackground(guiWidth, guiHeight); } diff --git a/src/main/java/binnie/genetics/gui/analyst/ControlToleranceBar.java b/src/main/java/binnie/genetics/gui/analyst/ControlToleranceBar.java index 6bcf4ee7..33a135e6 100644 --- a/src/main/java/binnie/genetics/gui/analyst/ControlToleranceBar.java +++ b/src/main/java/binnie/genetics/gui/analyst/ControlToleranceBar.java @@ -37,12 +37,12 @@ public abstract class ControlToleranceBar> extends Control imp } @Override - public void getTooltip(Tooltip list) { + public void getTooltip(Tooltip tooltip) { int types = fullSet.size(); int type = getRelativeMousePosition().xPos() / (getSize().xPos() / types); for (T tol : fullSet) { if (tol.ordinal() - ((enumClass == EnumTemperature.class) ? 1 : 0) == type) { - list.add((tolerated.contains(tol) ? "" : TextFormatting.DARK_GRAY) + getName(tol)); + tooltip.add((tolerated.contains(tol) ? "" : TextFormatting.DARK_GRAY) + getName(tol)); } } } diff --git a/src/main/java/binnie/genetics/gui/analyst/WindowAnalyst.java b/src/main/java/binnie/genetics/gui/analyst/WindowAnalyst.java index 0d83d4f0..28426e99 100644 --- a/src/main/java/binnie/genetics/gui/analyst/WindowAnalyst.java +++ b/src/main/java/binnie/genetics/gui/analyst/WindowAnalyst.java @@ -180,10 +180,10 @@ public class WindowAnalyst extends Window { public void onRenderBackground(int guiWidth, int guiHeight) { RenderUtil.setColour(syst.getColour()); int outset = (getSystem() == syst) ? 1 : 0; - CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea().outset(outset)); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea().outset(outset)); if (getSystem() == syst) { RenderUtil.setColour(1140850688 + syst.getColour()); - CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().outset(outset)); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().outset(outset)); } RenderUtil.drawItem(new Point(2, 2), syst.getItemStackRepresentitive()); } @@ -218,7 +218,7 @@ public class WindowAnalyst extends Window { return; } RenderUtil.setColour(getContent().getColor()); - CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea()); } }; new ControlScrollBar(this, sectionWidth + 2 - 3, 6, 3, getHeight() - 8 + 2 - 6, leftPage) { @@ -243,7 +243,7 @@ public class WindowAnalyst extends Window { return; } RenderUtil.setColour(getContent().getColor()); - CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea()); } }; new ControlScrollBar(this, sectionWidth + 2 - 3 + sectionWidth + 4, 6, 3, getHeight() - 8 + 2 - 6, rightPage) { @@ -390,11 +390,11 @@ public class WindowAnalyst extends Window { RenderUtil.setColour((active ? -16777216 : 1140850688) + value.getColor()); GlStateManager.pushMatrix(); GlStateManager.enableBlend(); - CraftGUI.RENDER.texture(CraftGUITexture.TabSolid, getArea().inset(1)); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_SOLID, getArea().inset(1)); GlStateManager.disableBlend(); GlStateManager.popMatrix(); RenderUtil.setColour(value.getColor()); - CraftGUI.RENDER.texture(CraftGUITexture.TabOutline, getArea().inset(1)); + CraftGUI.RENDER.texture(CraftGUITexture.TAB_OUTLINE, getArea().inset(1)); super.onRenderBackground(guiWidth, guiHeight); } }; diff --git a/src/main/java/binnie/genetics/gui/database/bee/ControlBiomes.java b/src/main/java/binnie/genetics/gui/database/bee/ControlBiomes.java index f4461941..9452889d 100644 --- a/src/main/java/binnie/genetics/gui/database/bee/ControlBiomes.java +++ b/src/main/java/binnie/genetics/gui/database/bee/ControlBiomes.java @@ -32,7 +32,7 @@ public class ControlBiomes extends Control implements ITooltip { } @Override - public void getTooltip(Tooltip list) { + public void getTooltip(Tooltip tooltip) { if (tolerated.isEmpty()) { return; } @@ -46,7 +46,7 @@ public class ControlBiomes extends Control implements ITooltip { Biome biome = Biome.getBiome(tolerated.get(i)); if (biome != null) { - list.add(biome.getBiomeName()); + tooltip.add(biome.getBiomeName()); } } @@ -60,7 +60,7 @@ public class ControlBiomes extends Control implements ITooltip { //TODO FIND COLOR //CraftGUI.Render.colour(Biome.getBiome(i).color); } - CraftGUI.RENDER.texture(CraftGUITexture.Button, new Area(x, y, 16, 16)); + CraftGUI.RENDER.texture(CraftGUITexture.BUTTON, new Area(x, y, 16, 16)); } } diff --git a/src/main/java/binnie/genetics/gui/database/bee/ControlClimateBar.java b/src/main/java/binnie/genetics/gui/database/bee/ControlClimateBar.java index 1b655919..34aa6d1b 100644 --- a/src/main/java/binnie/genetics/gui/database/bee/ControlClimateBar.java +++ b/src/main/java/binnie/genetics/gui/database/bee/ControlClimateBar.java @@ -55,7 +55,7 @@ public class ControlClimateBar extends Control implements ITooltip { } @Override - public void getTooltip(Tooltip list) { + public void getTooltip(Tooltip tooltip) { if (tolerated.isEmpty()) { return; } @@ -67,16 +67,16 @@ public class ControlClimateBar extends Control implements ITooltip { } if (isHumidity) { - list.add(EnumHumidity.values()[type].name); + tooltip.add(EnumHumidity.values()[type].name); } else { - list.add(EnumTemperature.values()[type + 1].name); + tooltip.add(EnumTemperature.values()[type + 1].name); } } @Override @SideOnly(Side.CLIENT) public void onRenderBackground(int guiWidth, int guiHeight) { - CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarBack, getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_BACK, getArea()); int types = isHumidity ? 3 : 6; int w = (int) ((getSize().xPos() - 2.0f) / types); for (int i = 0; i < types; ++i) { @@ -91,7 +91,7 @@ public class ControlClimateBar extends Control implements ITooltip { RenderUtil.drawSolidRect(new Area(x + 1, 1, w, getSize().yPos() - 2), color); } } - CraftGUI.RENDER.texture(CraftGUITexture.EnergyBarGlass, getArea()); + CraftGUI.RENDER.texture(CraftGUITexture.ENERGY_BAR_GLASS, getArea()); } public void setSpecies(IAlleleBeeSpecies species) { diff --git a/src/main/java/binnie/genetics/gui/punnett/WindowPunnettSquare.java b/src/main/java/binnie/genetics/gui/punnett/WindowPunnettSquare.java index 263e71fd..52c15398 100644 --- a/src/main/java/binnie/genetics/gui/punnett/WindowPunnettSquare.java +++ b/src/main/java/binnie/genetics/gui/punnett/WindowPunnettSquare.java @@ -61,8 +61,8 @@ public class WindowPunnettSquare extends Window { static class StyleSheetPunnett extends StyleSheet { public StyleSheetPunnett() { - textures.put(CraftGUITexture.Window, new PaddedTexture(0, 0, 160, 160, 0, texture, 32, 32, 32, 32)); - textures.put(CraftGUITexture.Slot, new StandardTexture(160, 0, 18, 18, 0, texture)); + textures.put(CraftGUITexture.WINDOW, new PaddedTexture(0, 0, 160, 160, 0, texture, 32, 32, 32, 32)); + textures.put(CraftGUITexture.SLOT, new StandardTexture(160, 0, 18, 18, 0, texture)); textures.put(ExtraBeeGUITexture.Chromosome, new StandardTexture(160, 36, 16, 16, 0, texture)); textures.put(ExtraBeeGUITexture.Chromosome2, new StandardTexture(160, 52, 16, 16, 0, texture)); } diff --git a/src/main/resources/assets/binniecore/lang/en_US.lang b/src/main/resources/assets/binniecore/lang/en_US.lang index a3535a0b..15a0daf9 100644 --- a/src/main/resources/assets/binniecore/lang/en_US.lang +++ b/src/main/resources/assets/binniecore/lang/en_US.lang @@ -272,6 +272,8 @@ binniecore.gui.nottolerated=Not Tolerated binniecore.gui.design=Design +binniecore.gui.genesis.title=Genesis + binniecore.gui.fieldkit.title=Field Kit binniecore.gui.fieldkit.info=The Field Kit analyses bees, trees, flowers and butterflies. All that is required is a piece of paper to jot notes binniecore.gui.fieldkit.paper=Paper