mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 11:29:23 +00:00
[1.7.10] Added some localization (#86)
* Added some localization us_GB lang files cleanup * Fix compile errors * Some refactoring * Added some localization Some refactoring
This commit is contained in:
1 parent
0c15ee9943
commit
2f683650c0
125 files changed
+962
-2572
No files matched your search
@@ -15,7 +15,7 @@ public class ControlColorDisplay extends Control implements IControlValue<IFlowe
|
||||
|
||||
public ControlColorDisplay(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 16.0f, 16.0f);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ControlColorOption extends ControlTextOption<IFlowerColor> {
|
||||
super(controlList, option, option.getName(), y);
|
||||
setSize(new IPoint(getSize().x(), 20.0f));
|
||||
(controlBee = new ControlColorDisplay(this, 2.0f, 2.0f)).setValue(option);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
|
||||
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
|
||||
int th = (int) CraftGUI.Render.textHeight(textWidget.getValue(), textWidget.getSize().x());
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ControlColourMixSymbol extends Control implements ITooltip {
|
||||
super(parent, x, y, 16 + type * 16, 16.0f);
|
||||
this.type = type;
|
||||
value = null;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,17 +38,17 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.overview", 0));
|
||||
new PageSpeciesFlowerGenome(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "genome", 0));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.classification", 0));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.resultant", 0));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.further", 0));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.overview", 0));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.species", 0));
|
||||
createMode(FlowerMode.Colour, new ColorModeWidget());
|
||||
new PageColorMixResultant(getInfoPages(FlowerMode.Colour), new DatabaseTab(Botany.instance, "colour.resultant", 0));
|
||||
new PageColourMix(getInfoPages(FlowerMode.Colour), new DatabaseTab(Botany.instance, "colour.further", 0));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(Botany.instance, "breeder", 0));
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.overview"));
|
||||
new PageSpeciesFlowerGenome(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "genome"));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.classification"));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.resultant"));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.further"));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.overview"));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.species"));
|
||||
createMode(FlowerMode.COLOR, new ColorModeWidget());
|
||||
new PageColorMixResultant(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.resultant"));
|
||||
new PageColourMix(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.further"));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(Botany.instance, "breeder"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,7 +62,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
}
|
||||
|
||||
enum FlowerMode implements IDatabaseMode {
|
||||
Colour;
|
||||
COLOR;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
@@ -72,7 +72,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
|
||||
private class ColorModeWidget extends ModeWidgets {
|
||||
public ColorModeWidget() {
|
||||
super(FlowerMode.Colour, WindowBotanistDatabase.this);
|
||||
super(FlowerMode.COLOR, WindowBotanistDatabase.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -340,7 +340,7 @@ public class GardenLogic extends FarmLogic {
|
||||
try {
|
||||
IOwnable housing2 = (IOwnable) housing;
|
||||
GameProfile prof;
|
||||
if (Mods.Forestry.dev()) {
|
||||
if (Mods.forestry.dev()) {
|
||||
prof = (GameProfile) IOwnable.class.getMethod("getOwner", new Class[0]).invoke(housing2);
|
||||
} else {
|
||||
prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2);
|
||||
|
||||
@@ -127,7 +127,7 @@ public class ModuleGardening implements IInitializable {
|
||||
for (int insulate = 0; insulate < 6; ++insulate) {
|
||||
ItemStack tubes = new ItemStack(Botany.insulatedTube, 2, mat + 128 * insulate);
|
||||
ItemStack insulateStack = ItemInsulatedTube.getInsulateStack(tubes);
|
||||
ItemStack forestryTube = new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, mat);
|
||||
ItemStack forestryTube = new ItemStack(Mods.forestry.item("thermionicTubes"), 1, mat);
|
||||
GameRegistry.addShapelessRecipe(tubes, forestryTube, forestryTube, insulateStack);
|
||||
}
|
||||
}
|
||||
@@ -193,11 +193,11 @@ public class ModuleGardening implements IInitializable {
|
||||
new ItemStack(Items.wheat_seeds),
|
||||
new ItemStack(Items.wheat_seeds)
|
||||
);
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.AshPowder.get(4), Mods.Forestry.stack("ash"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.MulchPowder.get(4), Mods.Forestry.stack("mulch"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), Mods.Forestry.stack("fertilizerBio"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.FertiliserPowder.get(4), Mods.Forestry.stack("fertilizerCompound"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.PulpPowder.get(4), Mods.Forestry.stack("woodPulp"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.AshPowder.get(4), Mods.forestry.stack("ash"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.MulchPowder.get(4), Mods.forestry.stack("mulch"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), Mods.forestry.stack("fertilizerBio"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.FertiliserPowder.get(4), Mods.forestry.stack("fertilizerCompound"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.PulpPowder.get(4), Mods.forestry.stack("woodPulp"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
BotanyItems.SulphurPowder.get(4),
|
||||
new Object[]{"dustSulphur"}
|
||||
@@ -212,7 +212,7 @@ public class ModuleGardening implements IInitializable {
|
||||
));
|
||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.SulphurPowder.get(1), 1);
|
||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.MulchPowder.get(1), 1);
|
||||
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "mulch")), 2);
|
||||
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "mulch")), 2);
|
||||
|
||||
for (ItemStack stack : OreDictionary.getOres("dustSulfur")) {
|
||||
ModuleGardening.queuedAcidFertilisers.put(stack, 2);
|
||||
@@ -220,12 +220,12 @@ public class ModuleGardening implements IInitializable {
|
||||
|
||||
ModuleGardening.queuedAlkalineFertilisers.put(BotanyItems.AshPowder.get(1), 1);
|
||||
ModuleGardening.queuedAlkalineFertilisers.put(BotanyItems.PulpPowder.get(1), 1);
|
||||
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "ash")), 2);
|
||||
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "woodPulp")), 2);
|
||||
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "ash")), 2);
|
||||
ModuleGardening.queuedAlkalineFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "woodPulp")), 2);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.CompostPowder.get(1), 1);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(BotanyItems.FertiliserPowder.get(1), 1);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "fertilizerBio")), 2);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "fertilizerCompound")), 2);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "fertilizerBio")), 2);
|
||||
ModuleGardening.queuedNutrientFertilisers.put(new ItemStack(GameRegistry.findItem("FORESTRY", "fertilizerCompound")), 2);
|
||||
|
||||
for (Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedAcidFertilisers.entrySet()) {
|
||||
addAcidFertiliser(entry.getKey(), entry.getValue());
|
||||
|
||||
@@ -9,14 +9,14 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class Mods {
|
||||
public static Mod Forestry;
|
||||
public static Mod IC2;
|
||||
public static Mod Botania;
|
||||
private static boolean WARN;
|
||||
public static Mod forestry;
|
||||
public static Mod ic2;
|
||||
public static Mod botania;
|
||||
private static boolean warn;
|
||||
|
||||
private static Item findItem(String modId, String name) {
|
||||
Item stack = GameRegistry.findItem(modId, name);
|
||||
if (stack == null && Mods.WARN && modId.equals("Forestry")) {
|
||||
if (stack == null && Mods.warn && modId.equals("FORESTRY")) {
|
||||
throw new RuntimeException("Item not found: " + modId + ":" + name);
|
||||
}
|
||||
return stack;
|
||||
@@ -24,7 +24,7 @@ public class Mods {
|
||||
|
||||
private static ItemStack findItemStack(String modId, String name, int stackSize) {
|
||||
ItemStack stack = GameRegistry.findItemStack(modId, name, stackSize);
|
||||
if (stack == null && Mods.WARN && modId.equals("Forestry")) {
|
||||
if (stack == null && Mods.warn && modId.equals("FORESTRY")) {
|
||||
throw new RuntimeException("Stack not found: " + modId + ":" + name);
|
||||
}
|
||||
return stack;
|
||||
@@ -32,24 +32,24 @@ public class Mods {
|
||||
|
||||
private static Block findBlock(String modId, String name) {
|
||||
Block stack = GameRegistry.findBlock(modId, name);
|
||||
if (stack == null && Mods.WARN && modId.equals("Forestry")) {
|
||||
if (stack == null && Mods.warn && modId.equals("FORESTRY")) {
|
||||
throw new RuntimeException("Block not found: " + modId + ":" + name);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
static {
|
||||
Mods.Forestry = new Mod("Forestry") {
|
||||
Mods.forestry = new Mod("FORESTRY") {
|
||||
@Override
|
||||
public boolean dev() {
|
||||
String forVersion = Loader.instance().getIndexedModList().get("Forestry").getVersion();
|
||||
String forVersion = Loader.instance().getIndexedModList().get("FORESTRY").getVersion();
|
||||
Restriction rest = new Restriction(new DefaultArtifactVersion("3.6"), true, null, false);
|
||||
return rest.containsVersion(new DefaultArtifactVersion(forVersion));
|
||||
}
|
||||
};
|
||||
Mods.IC2 = new Mod("IC2");
|
||||
Mods.Botania = new Mod("Botania");
|
||||
Mods.WARN = true;
|
||||
Mods.ic2 = new Mod("IC2");
|
||||
Mods.botania = new Mod("BOTANIA");
|
||||
Mods.warn = true;
|
||||
}
|
||||
|
||||
public static class Mod {
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Tooltip {
|
||||
|
||||
public Tooltip() {
|
||||
tooltip = new ArrayList<>();
|
||||
type = Type.Standard;
|
||||
type = Type.STANDARD;
|
||||
maxWidth = 256;
|
||||
}
|
||||
|
||||
@@ -41,11 +41,6 @@ public class Tooltip {
|
||||
return tooltip.size() > 0;
|
||||
}
|
||||
|
||||
public String getLine(int index) {
|
||||
String string = getList().get(index);
|
||||
return string;
|
||||
}
|
||||
|
||||
public void add(List list) {
|
||||
for (Object obj : list) {
|
||||
tooltip.add((String) obj);
|
||||
@@ -69,11 +64,11 @@ public class Tooltip {
|
||||
}
|
||||
|
||||
public enum Type implements ITooltipType {
|
||||
Standard,
|
||||
Help,
|
||||
Information,
|
||||
User,
|
||||
Power
|
||||
STANDARD,
|
||||
HELP,
|
||||
INFORMATION,
|
||||
USER,
|
||||
POWER
|
||||
}
|
||||
|
||||
public interface ITooltipType {
|
||||
|
||||
@@ -90,7 +90,7 @@ public class Widget implements IWidget {
|
||||
|
||||
@Override
|
||||
public IWidget addWidget(IWidget widget) {
|
||||
if (subWidgets.size() != 0 && subWidgets.get(subWidgets.size() - 1).hasAttribute(WidgetAttribute.AlwaysOnTop)) {
|
||||
if (subWidgets.size() != 0 && subWidgets.get(subWidgets.size() - 1).hasAttribute(WidgetAttribute.ALWAYS_ON_TOP)) {
|
||||
subWidgets.add(subWidgets.size() - 1, widget);
|
||||
} else {
|
||||
subWidgets.add(widget);
|
||||
@@ -214,12 +214,12 @@ public class Widget implements IWidget {
|
||||
|
||||
@Override
|
||||
public boolean canMouseOver() {
|
||||
return hasAttribute(WidgetAttribute.MouseOver);
|
||||
return hasAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFocus() {
|
||||
return hasAttribute(WidgetAttribute.CanFocus);
|
||||
return hasAttribute(WidgetAttribute.CAN_FOCUS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -276,23 +276,25 @@ public class Widget implements IWidget {
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
if (isVisible()) {
|
||||
CraftGUI.Render.preRender(this);
|
||||
onRender(RenderStage.PreChildren);
|
||||
|
||||
for (IWidget widget : getWidgets()) {
|
||||
widget.render();
|
||||
}
|
||||
|
||||
for (IWidget widget : getWidgets()) {
|
||||
CraftGUI.Render.preRender(widget);
|
||||
widget.onRender(RenderStage.PostSiblings);
|
||||
CraftGUI.Render.postRender(widget);
|
||||
}
|
||||
|
||||
onRender(RenderStage.PostChildren);
|
||||
CraftGUI.Render.postRender(this);
|
||||
if (!isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
CraftGUI.Render.preRender(this);
|
||||
onRender(RenderStage.PreChildren);
|
||||
|
||||
for (IWidget widget : getWidgets()) {
|
||||
widget.render();
|
||||
}
|
||||
|
||||
for (IWidget widget : getWidgets()) {
|
||||
CraftGUI.Render.preRender(widget);
|
||||
widget.onRender(RenderStage.PostSiblings);
|
||||
CraftGUI.Render.postRender(widget);
|
||||
}
|
||||
|
||||
onRender(RenderStage.PostChildren);
|
||||
CraftGUI.Render.postRender(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -308,7 +310,7 @@ public class Widget implements IWidget {
|
||||
onUpdateClient();
|
||||
List<IWidget> deletedWidgets = new ArrayList<IWidget>();
|
||||
for (IWidget widget : getWidgets()) {
|
||||
if (widget.hasAttribute(WidgetAttribute.NeedsDeletion)) {
|
||||
if (widget.hasAttribute(WidgetAttribute.NEEDS_DELETION)) {
|
||||
deletedWidgets.add(widget);
|
||||
} else {
|
||||
widget.updateClient();
|
||||
@@ -473,10 +475,6 @@ public class Widget implements IWidget {
|
||||
return getArea().contains(position);
|
||||
}
|
||||
|
||||
public void scheduleDeletion() {
|
||||
addAttribute(WidgetAttribute.NeedsDeletion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLevel() {
|
||||
int level = (getParent() == null) ? 0 : getParent().getLevel();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package binnie.core.craftgui;
|
||||
|
||||
public enum WidgetAttribute {
|
||||
MouseOver,
|
||||
CanFocus,
|
||||
NeedsDeletion,
|
||||
AlwaysOnTop,
|
||||
BlockTooltip
|
||||
MOUSE_OVER,
|
||||
CAN_FOCUS,
|
||||
NEEDS_DELETION,
|
||||
ALWAYS_ON_TOP,
|
||||
BLOCK_TOOLTIP
|
||||
}
|
||||
@@ -56,7 +56,6 @@ public class WindowFieldKit extends Window {
|
||||
private float analyseProgress;
|
||||
private boolean isAnalysing;
|
||||
private Map<IChromosomeType, String> info;
|
||||
private ItemStack prev;
|
||||
|
||||
public WindowFieldKit(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(280.0f, 230.0f, player, inventory, side);
|
||||
@@ -68,7 +67,6 @@ public class WindowFieldKit extends Window {
|
||||
analyseProgress = 1.0f;
|
||||
isAnalysing = false;
|
||||
info = new HashMap<>();
|
||||
prev = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,7 +109,7 @@ public class WindowFieldKit extends Window {
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
setTitle("Field Kit");
|
||||
setTitle(getName());
|
||||
CraftGUI.Render.stylesheet(new StyleSheetPunnett());
|
||||
getWindowInventory().createSlot(0);
|
||||
getWindowInventory().createSlot(1);
|
||||
@@ -223,28 +221,30 @@ public class WindowFieldKit extends Window {
|
||||
((EntityPlayerMP) getPlayer()).updateHeldItem();
|
||||
}
|
||||
|
||||
if (isClient()) {
|
||||
ItemStack item = getWindowInventory().getStackInSlot(0);
|
||||
prev = item;
|
||||
text.setValue("");
|
||||
if (item != null && !Analyser.isAnalysed(item)) {
|
||||
if (getWindowInventory().getStackInSlot(1) == null) {
|
||||
text.setValue("No Paper!");
|
||||
isAnalysing = false;
|
||||
analyseProgress = 1.0f;
|
||||
} else {
|
||||
startAnalysing();
|
||||
chromo.setRoot(null);
|
||||
}
|
||||
} else if (item != null) {
|
||||
if (!isClient()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack item = getWindowInventory().getStackInSlot(0);
|
||||
text.setValue("");
|
||||
|
||||
if (item != null && !Analyser.isAnalysed(item)) {
|
||||
if (getWindowInventory().getStackInSlot(1) == null) {
|
||||
text.setValue("No Paper!");
|
||||
isAnalysing = false;
|
||||
analyseProgress = 1.0f;
|
||||
refreshSpecies();
|
||||
} else {
|
||||
isAnalysing = false;
|
||||
analyseProgress = 1.0f;
|
||||
startAnalysing();
|
||||
chromo.setRoot(null);
|
||||
}
|
||||
} else if (item != null) {
|
||||
isAnalysing = false;
|
||||
analyseProgress = 1.0f;
|
||||
refreshSpecies();
|
||||
} else {
|
||||
isAnalysing = false;
|
||||
analyseProgress = 1.0f;
|
||||
chromo.setRoot(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,10 +270,12 @@ public class WindowFieldKit extends Window {
|
||||
@Override
|
||||
public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound nbt) {
|
||||
super.recieveGuiNBT(side, player, name, nbt);
|
||||
if (side == Side.SERVER && name.equals("analyse")) {
|
||||
getWindowInventory().setInventorySlotContents(0, Analyser.analyse(getWindowInventory().getStackInSlot(0)));
|
||||
getWindowInventory().decrStackSize(1, 1);
|
||||
if (side != Side.SERVER || !name.equals("analyse")) {
|
||||
return;
|
||||
}
|
||||
|
||||
getWindowInventory().setInventorySlotContents(0, Analyser.analyse(getWindowInventory().getStackInSlot(0)));
|
||||
getWindowInventory().decrStackSize(1, 1);
|
||||
}
|
||||
|
||||
static class StyleSheetPunnett extends StyleSheet {
|
||||
|
||||
@@ -61,36 +61,9 @@ public class WindowGenesis extends Window {
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
new ControlPlayerInventory(this);
|
||||
setTitle("Genesis");
|
||||
ControlTabBar<BreedingSystem> tabSystems = new ControlTabBar<BreedingSystem>(this, 8.0f, 28.0f, 23.0f, 100.0f, Position.LEFT) {
|
||||
@Override
|
||||
public ControlTab<BreedingSystem> createTab(float x, float y, float w, float h, BreedingSystem value) {
|
||||
return new ControlTabIcon<BreedingSystem>(this, x, y, w, h, value) {
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
int type = value.getDefaultType();
|
||||
IIndividual ind = value.getDefaultIndividual();
|
||||
return value.getSpeciesRoot().getMemberStack(ind, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return value.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOutlineColour() {
|
||||
return value.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOutline() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
setTitle(getName());
|
||||
|
||||
ControlTabBar<BreedingSystem> tabSystems = new BreedingSystemControlTabBar();
|
||||
tabSystems.setValues(Binnie.Genetics.getActiveSystems());
|
||||
root = Binnie.Genetics.getActiveSystems().iterator().next().getSpeciesRoot();
|
||||
template = root.getDefaultTemplate();
|
||||
@@ -168,7 +141,6 @@ public class WindowGenesis extends Window {
|
||||
genes.add(new Gene(allele, type, root));
|
||||
}
|
||||
|
||||
Map<IChromosomeType, List<IAllele>> map = Binnie.Genetics.getChromosomeMap(root);
|
||||
geneList.setOptions(genes);
|
||||
if (selection != null) {
|
||||
geneList.setValue(new Gene(template[selection.ordinal()], selection, root));
|
||||
@@ -188,14 +160,7 @@ public class WindowGenesis extends Window {
|
||||
ControlItemDisplay display = new ControlItemDisplay(panelPickup, 4 + i % 3 * 18, 4 + i / 3 * 18);
|
||||
display.setItemStack(stack);
|
||||
display.setTooltip();
|
||||
display.addEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
stack.writeToNBT(nbt);
|
||||
Window.get(event.getOrigin()).sendClientAction("genesis", nbt);
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.Self, display));
|
||||
display.addEventHandler(new MouseDownHandler(stack).setOrigin(EventHandler.Origin.Self, display));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -228,4 +193,52 @@ public class WindowGenesis extends Window {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class MouseDownHandler extends EventMouse.Down.Handler {
|
||||
private final ItemStack stack;
|
||||
|
||||
public MouseDownHandler(ItemStack stack) {
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
stack.writeToNBT(nbt);
|
||||
Window.get(event.getOrigin()).sendClientAction("genesis", nbt);
|
||||
}
|
||||
}
|
||||
|
||||
private class BreedingSystemControlTabBar extends ControlTabBar<BreedingSystem> {
|
||||
public BreedingSystemControlTabBar() {
|
||||
super(WindowGenesis.this, 8.0f, 28.0f, 23.0f, 100.0f, Position.LEFT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ControlTab<BreedingSystem> createTab(float x, float y, float w, float h, BreedingSystem value) {
|
||||
return new ControlTabIcon<BreedingSystem>(this, x, y, w, h, value) {
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
int type = value.getDefaultType();
|
||||
IIndividual ind = value.getDefaultIndividual();
|
||||
return value.getSpeciesRoot().getMemberStack(ind, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return value.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOutlineColour() {
|
||||
return value.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOutline() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package binnie.core.craftgui.controls;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.events.EventButtonClicked;
|
||||
import binnie.core.craftgui.events.EventHandler;
|
||||
@@ -17,8 +16,7 @@ public class ControlButton extends Control {
|
||||
|
||||
public ControlButton(IWidget parent, float x, float y, float width, float height) {
|
||||
super(parent, x, y, width, height);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
mouseHandler.setOrigin(EventHandler.Origin.Self, this);
|
||||
addEventHandler(mouseHandler);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ControlCheckbox extends Control implements IControlValue<Boolean> {
|
||||
new ControlText(this, new IArea(16.0f, 1.0f, w - 16.0f, 16.0f), text, TextJustification.MiddleCenter).setColor(4473924);
|
||||
}
|
||||
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
|
||||
@@ -21,8 +21,8 @@ public class ControlTextEdit extends Control implements IControlValue<String> {
|
||||
super(parent, x, y, width, height);
|
||||
cachedValue = "";
|
||||
field = new GuiTextField(getWindow().getGui().getFontRenderer(), 0, 0, 10, 10);
|
||||
addAttribute(WidgetAttribute.CanFocus);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.CAN_FOCUS);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
field.setEnableBackgroundDrawing(false);
|
||||
|
||||
addEventHandler(new EventKey.Down.Handler() {
|
||||
|
||||
@@ -53,16 +53,10 @@ public class Control extends Widget implements ITooltipHelp, ITooltip {
|
||||
}
|
||||
|
||||
public void addTooltip(String string) {
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
tooltipStrings.add(string);
|
||||
}
|
||||
|
||||
public void addTooltip(String[] strings) {
|
||||
for (String string : strings) {
|
||||
addTooltip(string);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLevel() {
|
||||
return extraLevel + super.getLevel();
|
||||
|
||||
@@ -80,10 +80,6 @@ public class ControlList<T> extends Control implements IControlValue<T> {
|
||||
return optionWidgets.keySet();
|
||||
}
|
||||
|
||||
public Collection<T> getAllOptions() {
|
||||
return allOptions.keySet();
|
||||
}
|
||||
|
||||
public int getIndexOf(T value) {
|
||||
int index = 0;
|
||||
for (T option : getOptions()) {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ControlOption<T> extends Control implements IControlValue<T> {
|
||||
super(controlList, 0.0f, height, controlList.getSize().x(), 20.0f);
|
||||
value = option;
|
||||
if (value != null) {
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
addSelfEventHandler(mouseHandler);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ControlScrollBar extends Control {
|
||||
public ControlScrollBar(IWidget parent, float x, float y, float w, float h, IControlScrollable scrollable2) {
|
||||
super(parent, x, y, w, h);
|
||||
scrollable = scrollable2;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addSelfEventHandler(new EventMouse.Drag.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Drag event) {
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
||||
super(parent, x, y, w, h);
|
||||
setValue(value);
|
||||
tabBar = parent;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -11,6 +12,7 @@ import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.core.util.I18N;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
@@ -23,24 +25,25 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
private IAlleleSpecies species;
|
||||
|
||||
public void setSpecies(IAlleleSpecies species) {
|
||||
setSpecies(species, EnumDiscoveryState.Show);
|
||||
setSpecies(species, EnumDiscoveryState.SHOW);
|
||||
}
|
||||
|
||||
public void setSpecies(IAlleleSpecies species, EnumDiscoveryState state) {
|
||||
this.species = species;
|
||||
ISpeciesRoot speciesRoot = Binnie.Genetics.getSpeciesRoot(species);
|
||||
BreedingSystem system = Binnie.Genetics.getSystem(speciesRoot.getUID());
|
||||
IIndividual ind = system.getSpeciesRoot().templateAsIndividual(system.getSpeciesRoot().getTemplate(species.getUID()));
|
||||
super.setItemStack(system.getSpeciesRoot().getMemberStack(ind, system.getDefaultType()));
|
||||
this.species = species;
|
||||
GameProfile username = Window.get(this).getUsername();
|
||||
if (state == EnumDiscoveryState.Undetermined) {
|
||||
state = (system.isSpeciesDiscovered(species, Window.get(this).getWorld(), username) ? EnumDiscoveryState.Discovered : EnumDiscoveryState.Undiscovered);
|
||||
}
|
||||
if (Window.get(this) instanceof WindowAbstractDatabase && ((WindowAbstractDatabase) Window.get(this)).isNEI) {
|
||||
state = EnumDiscoveryState.Show;
|
||||
|
||||
if (state == EnumDiscoveryState.UNDETERMINED) {
|
||||
state = (system.isSpeciesDiscovered(species, Window.get(this).getWorld(), username) ? EnumDiscoveryState.DISCOVERED : EnumDiscoveryState.UNDISCOVERED);
|
||||
} else if (Window.get(this) instanceof WindowAbstractDatabase && ((WindowAbstractDatabase) Window.get(this)).isNEI) {
|
||||
state = EnumDiscoveryState.SHOW;
|
||||
}
|
||||
|
||||
discovered = state;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
public ControlDatabaseIndividualDisplay(IWidget parent, float x, float y) {
|
||||
@@ -50,15 +53,8 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
public ControlDatabaseIndividualDisplay(IWidget parent, float x, float y, float size) {
|
||||
super(parent, x, y, size);
|
||||
species = null;
|
||||
discovered = EnumDiscoveryState.Show;
|
||||
addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
if (event.getButton() == 0 && species != null && EnumDiscoveryState.Show == discovered) {
|
||||
((WindowAbstractDatabase) getSuperParent()).gotoSpeciesDelayed(species);
|
||||
}
|
||||
}
|
||||
});
|
||||
discovered = EnumDiscoveryState.SHOW;
|
||||
addSelfEventHandler(new MouseDownHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,15 +66,15 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
|
||||
BreedingSystem system = Binnie.Genetics.getSystem(species.getRoot());
|
||||
switch (discovered) {
|
||||
case Show:
|
||||
case SHOW:
|
||||
super.onRenderForeground();
|
||||
return;
|
||||
|
||||
case Discovered:
|
||||
case DISCOVERED:
|
||||
icon = system.getDiscoveredIcon();
|
||||
break;
|
||||
|
||||
case Undiscovered:
|
||||
case UNDISCOVERED:
|
||||
icon = system.getUndiscoveredIcon();
|
||||
break;
|
||||
}
|
||||
@@ -94,17 +90,26 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
}
|
||||
|
||||
switch (discovered) {
|
||||
case Show:
|
||||
case SHOW:
|
||||
tooltip.add(species.getName());
|
||||
break;
|
||||
|
||||
case Discovered:
|
||||
tooltip.add("Discovered Species");
|
||||
case DISCOVERED:
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.discovered.discovered"));
|
||||
break;
|
||||
|
||||
case Undiscovered:
|
||||
tooltip.add("Undiscovered Species");
|
||||
case UNDISCOVERED:
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.discovered.undiscovered"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private class MouseDownHandler extends EventMouse.Down.Handler {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
if (event.getButton() == 0 && species != null && EnumDiscoveryState.SHOW == discovered) {
|
||||
((WindowAbstractDatabase) getSuperParent()).gotoSpeciesDelayed(species);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,11 @@ public class ControlItemStackOption extends ControlTextOption<ItemStack> {
|
||||
public ControlItemStackOption(ControlList<ItemStack> controlList, ItemStack option, int y) {
|
||||
super(controlList, option, option.getDisplayName(), y);
|
||||
setSize(new IPoint(getSize().x(), 20.0f));
|
||||
(controlBee = new ControlItemDisplay(this, 2.0f, 2.0f)).setItemStack(option);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
|
||||
controlBee = new ControlItemDisplay(this, 2.0f, 2.0f);
|
||||
controlBee.setItemStack(option);
|
||||
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
|
||||
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
|
||||
int th = (int) CraftGUI.Render.textHeight(textWidget.getValue(), textWidget.getSize().x());
|
||||
|
||||
@@ -10,7 +10,6 @@ import forestry.api.genetics.IMutation;
|
||||
import java.util.List;
|
||||
|
||||
class ControlMutationBox extends ControlListBox<IMutation> {
|
||||
private int index;
|
||||
private Type type;
|
||||
private IAlleleSpecies species;
|
||||
|
||||
@@ -26,37 +25,39 @@ class ControlMutationBox extends ControlListBox<IMutation> {
|
||||
}
|
||||
|
||||
public void setSpecies(IAlleleSpecies species) {
|
||||
if (species != this.species) {
|
||||
this.species = species;
|
||||
index = 0;
|
||||
movePercentage(-100.0f);
|
||||
BreedingSystem system = ((WindowAbstractDatabase) getSuperParent()).getBreedingSystem();
|
||||
List<IMutation> discovered = system.getDiscoveredMutations(Window.get(this).getWorld(), Window.get(this).getUsername());
|
||||
if (species == this.species) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
this.species = species;
|
||||
movePercentage(-100.0f);
|
||||
BreedingSystem system = ((WindowAbstractDatabase) getSuperParent()).getBreedingSystem();
|
||||
List<IMutation> discovered = system.getDiscoveredMutations(Window.get(this).getWorld(), Window.get(this).getUsername());
|
||||
|
||||
if (type == Type.Resultant) {
|
||||
setOptions(system.getResultantMutations(species));
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == Type.RESULTANT) {
|
||||
setOptions(system.getResultantMutations(species));
|
||||
return;
|
||||
}
|
||||
|
||||
List<IMutation> mutations = system.getFurtherMutations(species);
|
||||
int i = 0;
|
||||
while (i < mutations.size()) {
|
||||
IMutation mutation = mutations.get(i);
|
||||
if (!discovered.contains(mutations) && !((IAlleleSpecies) mutation.getTemplate()[0]).isCounted()) {
|
||||
mutations.remove(i);
|
||||
} else {
|
||||
List<IMutation> mutations = system.getFurtherMutations(species);
|
||||
int i = 0;
|
||||
while (i < mutations.size()) {
|
||||
IMutation mutation = mutations.get(i);
|
||||
if (!discovered.contains(mutations) && !((IAlleleSpecies) mutation.getTemplate()[0]).isCounted()) {
|
||||
mutations.remove(i);
|
||||
} else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
setOptions(mutations);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
setOptions(mutations);
|
||||
}
|
||||
|
||||
enum Type {
|
||||
Resultant,
|
||||
Further
|
||||
RESULTANT,
|
||||
FURTHER
|
||||
}
|
||||
}
|
||||
@@ -24,21 +24,23 @@ class ControlMutationItem extends ControlOption<IMutation> {
|
||||
boolean isNEI = ((WindowAbstractDatabase) getSuperParent()).isNEI();
|
||||
BreedingSystem system = ((WindowAbstractDatabase) getSuperParent()).getBreedingSystem();
|
||||
|
||||
if (getValue() != null) {
|
||||
boolean isMutationDiscovered = system.isMutationDiscovered(getValue(), Window.get(this).getWorld(), Window.get(this).getUsername());
|
||||
IAlleleSpecies allele;
|
||||
EnumDiscoveryState state;
|
||||
allele = getValue().getAllele0();
|
||||
state = ((isNEI || isMutationDiscovered) ? EnumDiscoveryState.Show : ((species == allele) ? EnumDiscoveryState.Show : EnumDiscoveryState.Undetermined));
|
||||
itemWidget1.setSpecies(allele, state);
|
||||
allele = getValue().getAllele1();
|
||||
state = ((isNEI || isMutationDiscovered) ? EnumDiscoveryState.Show : ((species == allele) ? EnumDiscoveryState.Show : EnumDiscoveryState.Undetermined));
|
||||
itemWidget2.setSpecies(allele, state);
|
||||
allele = (IAlleleSpecies) getValue().getTemplate()[0];
|
||||
state = ((isNEI || isMutationDiscovered) ? EnumDiscoveryState.Show : ((species == allele) ? EnumDiscoveryState.Show : EnumDiscoveryState.Undetermined));
|
||||
itemWidget3.setSpecies(allele, state);
|
||||
addSymbol.setValue(getValue());
|
||||
arrowSymbol.setValue(getValue());
|
||||
if (getValue() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean isMutationDiscovered = system.isMutationDiscovered(getValue(), Window.get(this).getWorld(), Window.get(this).getUsername());
|
||||
IAlleleSpecies allele;
|
||||
EnumDiscoveryState state;
|
||||
allele = getValue().getAllele0();
|
||||
state = ((isNEI || isMutationDiscovered) ? EnumDiscoveryState.SHOW : ((species == allele) ? EnumDiscoveryState.SHOW : EnumDiscoveryState.UNDETERMINED));
|
||||
itemWidget1.setSpecies(allele, state);
|
||||
allele = getValue().getAllele1();
|
||||
state = ((isNEI || isMutationDiscovered) ? EnumDiscoveryState.SHOW : ((species == allele) ? EnumDiscoveryState.SHOW : EnumDiscoveryState.UNDETERMINED));
|
||||
itemWidget2.setSpecies(allele, state);
|
||||
allele = (IAlleleSpecies) getValue().getTemplate()[0];
|
||||
state = ((isNEI || isMutationDiscovered) ? EnumDiscoveryState.SHOW : ((species == allele) ? EnumDiscoveryState.SHOW : EnumDiscoveryState.UNDETERMINED));
|
||||
itemWidget3.setSpecies(allele, state);
|
||||
addSymbol.setValue(getValue());
|
||||
arrowSymbol.setValue(getValue());
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ class ControlMutationSymbol extends Control implements ITooltip {
|
||||
super(parent, x, y, 16 + type * 16, 16.0f);
|
||||
value = null;
|
||||
this.type = type;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
public void setValue(IMutation value) {
|
||||
|
||||
@@ -6,19 +6,17 @@ import binnie.core.craftgui.minecraft.Window;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class ControlSpeciesBox extends ControlListBox<IAlleleSpecies>
|
||||
{
|
||||
public class ControlSpeciesBox extends ControlListBox<IAlleleSpecies> {
|
||||
private IClassification branch;
|
||||
|
||||
@Override
|
||||
public IWidget createOption(IAlleleSpecies value, int y) {
|
||||
return new ControlSpeciexBoxOption(getContent(), value, y);
|
||||
return new ControlSpeciesBoxOption(getContent(), value, y);
|
||||
}
|
||||
|
||||
public ControlSpeciesBox(IWidget parent, float x, float y, float width, float height) {
|
||||
@@ -36,10 +34,11 @@ public class ControlSpeciesBox extends ControlListBox<IAlleleSpecies>
|
||||
movePercentage(-100.0f);
|
||||
setOptions(speciesList2);
|
||||
|
||||
EntityPlayer player = Window.get(this).getPlayer();
|
||||
GameProfile playerName = Window.get(this).getUsername();
|
||||
WindowAbstractDatabase db = Window.get(this);
|
||||
Collection<IAlleleSpecies> speciesList3 = db.isNEI ? db.getBreedingSystem().getAllSpecies() : db.getBreedingSystem().getDiscoveredSpecies(db.getWorld(), playerName);
|
||||
Collection<IAlleleSpecies> speciesList3 = db.isNEI
|
||||
? db.getBreedingSystem().getAllSpecies()
|
||||
: db.getBreedingSystem().getDiscoveredSpecies(db.getWorld(), playerName);
|
||||
if (branch != null) {
|
||||
for (IAlleleSpecies species : branch.getMemberSpecies()) {
|
||||
if (speciesList3.contains(species)) {
|
||||
|
||||
+12
-8
@@ -1,27 +1,31 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.listbox.ControlList;
|
||||
import binnie.core.craftgui.controls.listbox.ControlTextOption;
|
||||
import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
class ControlSpeciexBoxOption extends ControlTextOption<IAlleleSpecies> {
|
||||
class ControlSpeciesBoxOption extends ControlTextOption<IAlleleSpecies> {
|
||||
private ControlDatabaseIndividualDisplay controlBee;
|
||||
|
||||
public ControlSpeciexBoxOption(ControlList<IAlleleSpecies> controlList, IAlleleSpecies option, int y) {
|
||||
public ControlSpeciesBoxOption(ControlList<IAlleleSpecies> controlList, IAlleleSpecies option, int y) {
|
||||
super(controlList, option, option.getName(), y);
|
||||
setSize(new IPoint(getSize().x(), 20.0f));
|
||||
(controlBee = new ControlDatabaseIndividualDisplay(this, 2.0f, 2.0f)).setSpecies(getValue(), EnumDiscoveryState.Undetermined);
|
||||
if (controlBee.discovered == EnumDiscoveryState.Discovered) {
|
||||
controlBee.discovered = EnumDiscoveryState.Show;
|
||||
(controlBee = new ControlDatabaseIndividualDisplay(this, 2.0f, 2.0f)).setSpecies(getValue(), EnumDiscoveryState.UNDETERMINED);
|
||||
if (controlBee.discovered == EnumDiscoveryState.DISCOVERED) {
|
||||
controlBee.discovered = EnumDiscoveryState.SHOW;
|
||||
}
|
||||
|
||||
textWidget.setValue((controlBee.discovered == EnumDiscoveryState.Show) ? option.getName() : "Undiscovered");
|
||||
if (controlBee.discovered == EnumDiscoveryState.Show) {
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
if (controlBee.discovered == EnumDiscoveryState.SHOW) {
|
||||
textWidget.setValue(option.getName());
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
} else {
|
||||
textWidget.setValue(I18N.localise(BinnieCore.instance, "gui.database.discovered.undiscovered"));
|
||||
}
|
||||
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
|
||||
@@ -8,12 +8,10 @@ import binnie.core.util.I18N;
|
||||
public class DatabaseTab implements ITooltipHelp {
|
||||
private AbstractMod mod;
|
||||
private String unloc;
|
||||
private int colour;
|
||||
|
||||
public DatabaseTab(AbstractMod mod, String unloc, int colour) {
|
||||
public DatabaseTab(AbstractMod mod, String unloc) {
|
||||
this.mod = mod;
|
||||
this.unloc = unloc;
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
public enum EnumDiscoveryState {
|
||||
Show,
|
||||
Undetermined,
|
||||
Discovered,
|
||||
Undiscovered
|
||||
SHOW,
|
||||
UNDETERMINED,
|
||||
DISCOVERED,
|
||||
UNDISCOVERED
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
@@ -11,48 +13,60 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PageBranchOverview extends PageBranch {
|
||||
private ControlText pageBranchOverview_branchName;
|
||||
private ControlText pageBranchOverview_branchScientific;
|
||||
private ControlText pageBranchOverview_branchAuthority;
|
||||
private List<ControlText> pageBranchOverview_branchDescription;
|
||||
private ControlText branchName;
|
||||
private ControlText branchScientific;
|
||||
private ControlText branchAuthority;
|
||||
private List<ControlText> branchDescription;
|
||||
|
||||
public PageBranchOverview(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
pageBranchOverview_branchDescription = new ArrayList<>();
|
||||
pageBranchOverview_branchName = new ControlTextCentered(this, 8.0f, "");
|
||||
pageBranchOverview_branchScientific = new ControlTextCentered(this, 32.0f, "");
|
||||
pageBranchOverview_branchAuthority = new ControlTextCentered(this, 44.0f, "");
|
||||
branchDescription = new ArrayList<>();
|
||||
branchName = new ControlTextCentered(this, 8.0f, "");
|
||||
branchScientific = new ControlTextCentered(this, 32.0f, "");
|
||||
branchAuthority = new ControlTextCentered(this, 44.0f, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IClassification branch) {
|
||||
pageBranchOverview_branchName.setValue(EnumChatFormatting.UNDERLINE + branch.getName() + " Branch" + EnumChatFormatting.RESET);
|
||||
pageBranchOverview_branchScientific.setValue(EnumChatFormatting.ITALIC + "Apidae " + branch.getScientific() + EnumChatFormatting.RESET);
|
||||
pageBranchOverview_branchAuthority.setValue("Discovered by " + EnumChatFormatting.BOLD + branch.getMemberSpecies()[0].getAuthority() + EnumChatFormatting.RESET);
|
||||
for (IWidget widget : pageBranchOverview_branchDescription) {
|
||||
branchName.setValue(
|
||||
EnumChatFormatting.BOLD
|
||||
+ I18N.localise(BinnieCore.instance, "gui.database.branch.name", branch.getName())
|
||||
+ EnumChatFormatting.RESET
|
||||
);
|
||||
branchScientific.setValue(
|
||||
EnumChatFormatting.ITALIC
|
||||
+ I18N.localise(BinnieCore.instance, "gui.database.branch.apidae", branch.getScientific())
|
||||
+ EnumChatFormatting.RESET
|
||||
);
|
||||
branchAuthority.setValue(
|
||||
EnumChatFormatting.BOLD
|
||||
+ I18N.localise(BinnieCore.instance, "gui.database.branch.discoveredBy", branch.getMemberSpecies()[0].getAuthority())
|
||||
+ EnumChatFormatting.RESET);
|
||||
|
||||
for (IWidget widget : branchDescription) {
|
||||
deleteChild(widget);
|
||||
}
|
||||
|
||||
pageBranchOverview_branchDescription.clear();
|
||||
branchDescription.clear();
|
||||
String desc = branch.getDescription();
|
||||
if (desc == null || desc == "") {
|
||||
desc = "No Description Provided.";
|
||||
if (desc == null || desc.isEmpty()) {
|
||||
desc = I18N.localise(BinnieCore.instance, "gui.database.branch.noDesc");
|
||||
}
|
||||
|
||||
String line = "";
|
||||
List<String> descLines = new ArrayList<String>();
|
||||
StringBuilder line = new StringBuilder();
|
||||
List<String> descLines = new ArrayList<>();
|
||||
for (String str : desc.split(" ")) {
|
||||
if (CraftGUI.Render.textWidth(line + " " + str) > 134) {
|
||||
descLines.add(EnumChatFormatting.ITALIC + line + EnumChatFormatting.RESET);
|
||||
line = "";
|
||||
descLines.add(EnumChatFormatting.ITALIC + line.toString() + EnumChatFormatting.RESET);
|
||||
line = new StringBuilder();
|
||||
}
|
||||
line = line + " " + str;
|
||||
line.append(" ").append(str);
|
||||
}
|
||||
|
||||
descLines.add(line);
|
||||
descLines.add(line.toString());
|
||||
int i = 0;
|
||||
for (String dLine : descLines) {
|
||||
pageBranchOverview_branchDescription.add(new ControlTextCentered(this, 84 + 12 * i++, dLine));
|
||||
branchDescription.add(new ControlTextCentered(this, 84 + 12 * i++, dLine));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,18 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.events.EventValueChanged;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IClassification;
|
||||
|
||||
public class PageBranchSpecies extends PageBranch {
|
||||
private ControlText pageBranchSpecies_title;
|
||||
private ControlSpeciesBox pageBranchSpecies_speciesList;
|
||||
private ControlText title;
|
||||
private ControlSpeciesBox speciesList;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onHandleEvent(EventValueChanged<IAlleleSpecies> event) {
|
||||
@@ -19,20 +21,22 @@ public class PageBranchSpecies extends PageBranch {
|
||||
|
||||
public PageBranchSpecies(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
pageBranchSpecies_title = new ControlTextCentered(this, 8.0f, "Species");
|
||||
addEventHandler(new EventValueChanged.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventValueChanged event) {
|
||||
if (event.isOrigin(pageBranchSpecies_speciesList)) {
|
||||
((WindowAbstractDatabase) getSuperParent()).gotoSpecies((IAlleleSpecies) event.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
pageBranchSpecies_speciesList = new ControlSpeciesBox(this, 4.0f, 20.0f, 136.0f, 152.0f);
|
||||
title = new ControlTextCentered(this, 8.0f, I18N.localise(BinnieCore.instance, "gui.database.species"));
|
||||
addEventHandler(new ValueHandler());
|
||||
speciesList = new ControlSpeciesBox(this, 4.0f, 20.0f, 136.0f, 152.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IClassification branch) {
|
||||
pageBranchSpecies_speciesList.setBranch(branch);
|
||||
speciesList.setBranch(branch);
|
||||
}
|
||||
|
||||
private class ValueHandler extends EventValueChanged.Handler {
|
||||
@Override
|
||||
public void onEvent(EventValueChanged event) {
|
||||
if (event.isOrigin(speciesList)) {
|
||||
((WindowAbstractDatabase) getSuperParent()).gotoSpecies((IAlleleSpecies) event.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.controls.page.ControlPage;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.core.util.I18N;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
@@ -23,16 +25,20 @@ public class PageBreeder extends ControlPage<DatabaseTab> {
|
||||
}
|
||||
|
||||
BreedingSystem system = ((WindowAbstractDatabase) Window.get(this)).getBreedingSystem();
|
||||
String descriptor = system.getDescriptor();
|
||||
new ControlTextCentered(this, 8.0f, EnumChatFormatting.UNDERLINE + system.getDescriptor() + " Profile" + EnumChatFormatting.RESET);
|
||||
new ControlTextCentered(this, 75.0f, "" + system.discoveredSpeciesCount + "/" + system.totalSpeciesCount + " Species");
|
||||
new ControlTextCentered(this, 8.0f,
|
||||
EnumChatFormatting.BOLD
|
||||
+ I18N.localise(BinnieCore.instance, "gui.database.descriptor", system.getDescriptor())
|
||||
+ EnumChatFormatting.RESET
|
||||
);
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise(BinnieCore.instance, "gui.database.species.count", system.discoveredSpeciesCount, system.totalSpeciesCount));
|
||||
new ControlBreedingProgress(this, 20, 87, 102, 14, system, system.discoveredSpeciesPercentage);
|
||||
new ControlTextCentered(this, 115.0f, "" + system.discoveredBranchCount + "/" + system.totalBranchCount + " Branches");
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise(BinnieCore.instance, "gui.database.branches.count", system.discoveredBranchCount, system.totalBranchCount));
|
||||
new ControlBreedingProgress(this, 20, 127, 102, 14, system, system.discoveredBranchPercentage);
|
||||
|
||||
if (system.discoveredSecretCount > 0) {
|
||||
new ControlTextCentered(this, 155.0f, "" + system.discoveredSecretCount + "/" + system.totalSecretCount + " Secret Species");
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise(BinnieCore.instance, "gui.database.species.secretCount", system.discoveredSecretCount, system.totalSecretCount));
|
||||
}
|
||||
|
||||
new ControlTextCentered(this, 32.0f, player.getName());
|
||||
new ControlTextCentered(this, 44.0f, EnumChatFormatting.ITALIC + system.getEpitome() + EnumChatFormatting.RESET);
|
||||
}
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public class PageSpeciesMutations extends PageSpecies {
|
||||
private ControlText pageSpeciesFurtherTitle;
|
||||
private ControlMutationBox pageSpeciesFurtherList;
|
||||
private ControlText furtherTitle;
|
||||
private ControlMutationBox furtherList;
|
||||
|
||||
public PageSpeciesMutations(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
pageSpeciesFurtherTitle = new ControlTextCentered(this, 8.0f, "Further Mutations");
|
||||
pageSpeciesFurtherList = new ControlMutationBox(this, 4, 20, 136, 152, ControlMutationBox.Type.Further);
|
||||
furtherTitle = new ControlTextCentered(this, 8.0f, I18N.localise(BinnieCore.instance, "gui.database.furtherMutations"));
|
||||
furtherList = new ControlMutationBox(this, 4, 20, 136, 152, ControlMutationBox.Type.FURTHER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
pageSpeciesFurtherList.setSpecies(species);
|
||||
furtherList.setSpecies(species);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
@@ -7,6 +8,7 @@ import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
@@ -34,20 +36,19 @@ public class PageSpeciesOverview extends PageSpecies {
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
controlInd1.setSpecies(species, EnumDiscoveryState.Show);
|
||||
controlInd2.setSpecies(species, EnumDiscoveryState.Show);
|
||||
controlInd1.setSpecies(species, EnumDiscoveryState.SHOW);
|
||||
controlInd2.setSpecies(species, EnumDiscoveryState.SHOW);
|
||||
String branchBinomial = (species.getBranch() != null) ? species.getBranch().getScientific() : "<Unknown>";
|
||||
String branchName = (species.getBranch() != null) ? species.getBranch().getName() : "Unknown";
|
||||
controlName.setValue(EnumChatFormatting.UNDERLINE + species.getName() + EnumChatFormatting.RESET);
|
||||
controlName.setValue(EnumChatFormatting.BOLD + species.getName() + EnumChatFormatting.RESET);
|
||||
controlScientific.setValue(EnumChatFormatting.ITALIC + branchBinomial + " " + species.getBinomial() + EnumChatFormatting.RESET);
|
||||
controlAuthority.setValue("Discovered by " + EnumChatFormatting.BOLD + species.getAuthority() + EnumChatFormatting.RESET);
|
||||
controlAuthority.setValue(EnumChatFormatting.BOLD + "Discovered by " + species.getAuthority() + EnumChatFormatting.RESET);
|
||||
controlComplexity.setValue("Complexity: " + species.getComplexity());
|
||||
String desc = species.getDescription();
|
||||
String descBody = EnumChatFormatting.ITALIC.toString();
|
||||
String descSig = "";
|
||||
|
||||
if (desc == null || desc == "") {
|
||||
descBody += "No Description Provided.";
|
||||
if (desc == null || desc.isEmpty()) {
|
||||
descBody += I18N.localise(BinnieCore.instance, "gui.database.species.noDesc");
|
||||
} else {
|
||||
String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public class PageSpeciesResultant extends PageSpecies {
|
||||
private ControlText pageSpeciesResultantTitle;
|
||||
private ControlMutationBox pageSpeciesResultantList;
|
||||
private ControlText title;
|
||||
private ControlMutationBox list;
|
||||
|
||||
public PageSpeciesResultant(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
pageSpeciesResultantTitle = new ControlTextCentered(this, 8.0f, "Resultant Mutations");
|
||||
pageSpeciesResultantList = new ControlMutationBox(this, 4, 20, 136, 152, ControlMutationBox.Type.Resultant);
|
||||
title = new ControlTextCentered(this, 8.0f, I18N.localise(BinnieCore.instance, "gui.database.resultantMutations"));
|
||||
list = new ControlMutationBox(this, 4, 20, 136, 152, ControlMutationBox.Type.RESULTANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
pageSpeciesResultantList.setSpecies(species);
|
||||
list.setSpecies(species);
|
||||
}
|
||||
}
|
||||
@@ -37,11 +37,6 @@ public abstract class WindowAbstractDatabase extends Window {
|
||||
protected boolean isNEI;
|
||||
|
||||
private float selectionBoxWidth;
|
||||
private float infoBoxWidth = 144.0f;
|
||||
private float infoBoxHeight = 176.0f;
|
||||
private float infoTabWidth = 16.0f;
|
||||
private float modeTabWidth = 22.0f;
|
||||
private float searchBoxHeight = 16.0f;
|
||||
private Map<IDatabaseMode, ModeWidgets> modes;
|
||||
private BreedingSystem system;
|
||||
private Panel panelInformation;
|
||||
@@ -149,10 +144,13 @@ public abstract class WindowAbstractDatabase extends Window {
|
||||
createMode(Mode.Branches, new ModeWidgets(Mode.Branches, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
EntityPlayer player = database.getPlayer();
|
||||
GameProfile playerName = getUsername();
|
||||
Collection<IClassification> speciesList = database.isNEI ? database.system.getAllBranches() : database.system.getDiscoveredBranches(database.getWorld(), playerName);
|
||||
(listBox = new ControlBranchBox(modePage, area.x(), area.y(), area.w(), area.h())).setOptions(speciesList);
|
||||
Collection<IClassification> speciesList = database.isNEI
|
||||
? database.system.getAllBranches()
|
||||
: database.system.getDiscoveredBranches(database.getWorld(), playerName);
|
||||
|
||||
listBox = new ControlBranchBox(modePage, area.x(), area.y(), area.w(), area.h());
|
||||
listBox.setOptions(speciesList);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -195,7 +193,7 @@ public abstract class WindowAbstractDatabase extends Window {
|
||||
}
|
||||
|
||||
protected void addTabs() {
|
||||
// ignoreds
|
||||
// ignored
|
||||
}
|
||||
|
||||
public void gotoSpecies(IAlleleSpecies value) {
|
||||
@@ -237,8 +235,9 @@ public abstract class WindowAbstractDatabase extends Window {
|
||||
public abstract static class ModeWidgets {
|
||||
public WindowAbstractDatabase database;
|
||||
public ControlPage<IDatabaseMode> modePage;
|
||||
private ControlPages<DatabaseTab> infoPages;
|
||||
public ControlListBox listBox;
|
||||
|
||||
private ControlPages<DatabaseTab> infoPages;
|
||||
private ControlTabBar<DatabaseTab> infoTabs;
|
||||
|
||||
public ModeWidgets(IDatabaseMode mode, WindowAbstractDatabase database) {
|
||||
|
||||
@@ -31,8 +31,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ContainerCraftGUI extends Container
|
||||
{
|
||||
public class ContainerCraftGUI extends Container {
|
||||
private Window window;
|
||||
private Map<String, NBTTagCompound> syncedNBT;
|
||||
private Map<String, NBTTagCompound> sentNBT;
|
||||
@@ -44,9 +43,9 @@ public class ContainerCraftGUI extends Container
|
||||
private int mousedOverSlotNumber;
|
||||
|
||||
public ContainerCraftGUI(Window window) {
|
||||
syncedNBT = new HashMap<String, NBTTagCompound>();
|
||||
sentNBT = new HashMap<String, NBTTagCompound>();
|
||||
syncedTanks = new HashMap<Integer, TankInfo>();
|
||||
syncedNBT = new HashMap<>();
|
||||
sentNBT = new HashMap<>();
|
||||
syncedTanks = new HashMap<>();
|
||||
syncedPower = new PowerInfo();
|
||||
syncedProcess = new ProcessInfo();
|
||||
errorType = 0;
|
||||
@@ -106,14 +105,18 @@ public class ContainerCraftGUI extends Container
|
||||
super.onContainerClosed(par1EntityPlayer);
|
||||
WindowInventory inventory = window.getWindowInventory();
|
||||
for (int i = 0; i < inventory.getSizeInventory(); ++i) {
|
||||
if (inventory.dispenseOnClose(i)) {
|
||||
ItemStack stack = inventory.getStackInSlot(i);
|
||||
if (stack != null) {
|
||||
stack = new TransferRequest(stack, par1EntityPlayer.inventory).transfer(true);
|
||||
if (stack != null) {
|
||||
par1EntityPlayer.dropPlayerItemWithRandomChoice(stack, false);
|
||||
}
|
||||
}
|
||||
if (!inventory.dispenseOnClose(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemStack stack = inventory.getStackInSlot(i);
|
||||
if (stack == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
stack = new TransferRequest(stack, par1EntityPlayer.inventory).transfer(true);
|
||||
if (stack != null) {
|
||||
par1EntityPlayer.dropPlayerItemWithRandomChoice(stack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,8 +128,7 @@ public class ContainerCraftGUI extends Container
|
||||
((CustomSlot) slot).onSlotClick(this, mouseButton, modifier, player);
|
||||
return player.inventory.getItemStack();
|
||||
}
|
||||
ItemStack stack = super.slotClick(slotNum, mouseButton, modifier, player);
|
||||
return stack;
|
||||
return super.slotClick(slotNum, mouseButton, modifier, player);
|
||||
}
|
||||
|
||||
public void sendNBTToClient(String key, NBTTagCompound nbt) {
|
||||
@@ -148,6 +150,7 @@ public class ContainerCraftGUI extends Container
|
||||
if (request == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack itemstack = request.transfer(true);
|
||||
Slot shiftClickedSlot = (Slot) inventorySlots.get(slotnumber);
|
||||
shiftClickedSlot.putStack(itemstack);
|
||||
@@ -159,11 +162,13 @@ public class ContainerCraftGUI extends Container
|
||||
if (slotnumber < 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Slot shiftClickedSlot = (Slot) inventorySlots.get(slotnumber);
|
||||
ItemStack itemstack = null;
|
||||
if (shiftClickedSlot.getHasStack()) {
|
||||
itemstack = shiftClickedSlot.getStack().copy();
|
||||
}
|
||||
|
||||
IInventory playerInventory = player.inventory;
|
||||
IInventory containerInventory = window.getInventory();
|
||||
IInventory windowInventory = window.getWindowInventory();
|
||||
@@ -172,13 +177,14 @@ public class ContainerCraftGUI extends Container
|
||||
for (int i = 0; i < 36; ++i) {
|
||||
target[i] = i;
|
||||
}
|
||||
|
||||
TransferRequest request;
|
||||
if (shiftClickedSlot.inventory == playerInventory) {
|
||||
request = new TransferRequest(itemstack, fromPlayer).setOrigin(shiftClickedSlot.inventory);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
request = new TransferRequest(itemstack, playerInventory).setOrigin(shiftClickedSlot.inventory).setTargetSlots(target);
|
||||
}
|
||||
|
||||
if (window instanceof IWindowAffectsShiftClick) {
|
||||
((IWindowAffectsShiftClick) window).alterRequest(request);
|
||||
}
|
||||
@@ -189,8 +195,13 @@ public class ContainerCraftGUI extends Container
|
||||
if (player.inventory.getItemStack() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack heldItem = player.inventory.getItemStack().copy();
|
||||
heldItem = new TransferRequest(heldItem, window.getInventory()).setOrigin(player.inventory).setTargetSlots(new int[0]).setTargetTanks(new int[] { slotID }).transfer(true);
|
||||
heldItem = new TransferRequest(heldItem, window.getInventory())
|
||||
.setOrigin(player.inventory)
|
||||
.setTargetSlots(new int[0])
|
||||
.setTargetTanks(new int[]{slotID})
|
||||
.transfer(true);
|
||||
player.inventory.setItemStack(heldItem);
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
((EntityPlayerMP) player).updateHeldItem();
|
||||
@@ -210,22 +221,18 @@ public class ContainerCraftGUI extends Container
|
||||
getOrCreateSlot(InventoryType.values()[type % 4], index, slotNumber);
|
||||
}
|
||||
}
|
||||
|
||||
if (name.contains("tank-update")) {
|
||||
onTankUpdate(action);
|
||||
}
|
||||
else if (name.equals("power-update")) {
|
||||
} else if (name.equals("power-update")) {
|
||||
onPowerUpdate(action);
|
||||
}
|
||||
else if (name.equals("process-update")) {
|
||||
} else if (name.equals("process-update")) {
|
||||
onProcessUpdate(action);
|
||||
}
|
||||
else if (name.equals("error-update")) {
|
||||
} else if (name.equals("error-update")) {
|
||||
onErrorUpdate(action);
|
||||
}
|
||||
else if (name.equals("mouse-over-slot")) {
|
||||
} else if (name.equals("mouse-over-slot")) {
|
||||
onMouseOverSlot(player, action);
|
||||
}
|
||||
else if (name.equals("shift-click-info")) {
|
||||
} else if (name.equals("shift-click-info")) {
|
||||
onRecieveShiftClickHighlights(player, action);
|
||||
}
|
||||
return false;
|
||||
@@ -247,6 +254,7 @@ public class ContainerCraftGUI extends Container
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (powered != null && window.isServer()) {
|
||||
syncedNBT.put("power-update", createPowerNBT(powered.getPowerInfo()));
|
||||
}
|
||||
@@ -256,11 +264,13 @@ public class ContainerCraftGUI extends Container
|
||||
if (error != null && window.isServer()) {
|
||||
syncedNBT.put("error-update", createErrorNBT(error));
|
||||
}
|
||||
|
||||
INetwork.SendGuiNBT machineSync = Machine.getInterface(INetwork.SendGuiNBT.class, window.getInventory());
|
||||
if (machineSync != null) {
|
||||
machineSync.sendGuiNBT(syncedNBT);
|
||||
}
|
||||
Map<String, NBTTagCompound> sentThisTime = new HashMap<String, NBTTagCompound>();
|
||||
|
||||
Map<String, NBTTagCompound> sentThisTime = new HashMap<>();
|
||||
for (Map.Entry<String, NBTTagCompound> nbt : syncedNBT.entrySet()) {
|
||||
nbt.getValue().setString("type", nbt.getKey());
|
||||
boolean shouldSend = true;
|
||||
@@ -268,16 +278,18 @@ public class ContainerCraftGUI extends Container
|
||||
if (lastSent != null) {
|
||||
shouldSend = !lastSent.equals(nbt.getValue());
|
||||
}
|
||||
|
||||
if (shouldSend) {
|
||||
for (int j = 0; j < crafters.size(); ++j) {
|
||||
if (crafters.get(j) instanceof EntityPlayerMP) {
|
||||
EntityPlayerMP player = (EntityPlayerMP) crafters.get(j);
|
||||
for (Object crafter : crafters) {
|
||||
if (crafter instanceof EntityPlayerMP) {
|
||||
EntityPlayerMP player = (EntityPlayerMP) crafter;
|
||||
BinnieCore.proxy.sendToPlayer(new MessageContainerUpdate(nbt.getValue()), player);
|
||||
}
|
||||
}
|
||||
sentThisTime.put(nbt.getKey(), nbt.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
sentNBT.putAll(sentThisTime);
|
||||
syncedNBT.clear();
|
||||
}
|
||||
@@ -288,11 +300,11 @@ public class ContainerCraftGUI extends Container
|
||||
if (error.canWork() != null) {
|
||||
nbt.setByte("type", (byte) 0);
|
||||
state = error.canWork();
|
||||
}
|
||||
else if (error.canProgress() != null) {
|
||||
} else if (error.canProgress() != null) {
|
||||
nbt.setByte("type", (byte) 1);
|
||||
state = error.canProgress();
|
||||
}
|
||||
|
||||
if (state != null) {
|
||||
state.writeToNBT(nbt);
|
||||
}
|
||||
@@ -330,7 +342,8 @@ public class ContainerCraftGUI extends Container
|
||||
}
|
||||
|
||||
public void onPowerUpdate(NBTTagCompound nbt) {
|
||||
(syncedPower = new PowerInfo()).readFromNBT(nbt);
|
||||
syncedPower = new PowerInfo();
|
||||
syncedPower.readFromNBT(nbt);
|
||||
}
|
||||
|
||||
public PowerInfo getPowerInfo() {
|
||||
@@ -342,15 +355,17 @@ public class ContainerCraftGUI extends Container
|
||||
}
|
||||
|
||||
public TankInfo getTankInfo(int tank) {
|
||||
return syncedTanks.containsKey(tank) ? syncedTanks.get(tank) : new TankInfo();
|
||||
return syncedTanks.containsKey(tank)
|
||||
? syncedTanks.get(tank)
|
||||
: new TankInfo();
|
||||
}
|
||||
|
||||
public void onErrorUpdate(NBTTagCompound nbt) {
|
||||
errorType = nbt.getByte("type");
|
||||
if (nbt.hasKey("name")) {
|
||||
(error = new ErrorState("", "")).readFromNBT(nbt);
|
||||
}
|
||||
else {
|
||||
error = new ErrorState("", "");
|
||||
error.readFromNBT(nbt);
|
||||
} else {
|
||||
error = null;
|
||||
}
|
||||
}
|
||||
@@ -364,7 +379,7 @@ public class ContainerCraftGUI extends Container
|
||||
}
|
||||
|
||||
public CustomSlot[] getCustomSlots() {
|
||||
List<CustomSlot> slots = new ArrayList<CustomSlot>();
|
||||
List<CustomSlot> slots = new ArrayList<>();
|
||||
for (Object object : inventorySlots) {
|
||||
if (object instanceof CustomSlot) {
|
||||
slots.add((CustomSlot) object);
|
||||
@@ -374,13 +389,15 @@ public class ContainerCraftGUI extends Container
|
||||
}
|
||||
|
||||
public void setMouseOverSlot(Slot slot) {
|
||||
if (slot.slotNumber != mousedOverSlotNumber) {
|
||||
mousedOverSlotNumber = slot.slotNumber;
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ShiftClick).clear();
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setShort("slot", (short) slot.slotNumber);
|
||||
window.sendClientAction("mouse-over-slot", nbt);
|
||||
if (slot.slotNumber == mousedOverSlotNumber) {
|
||||
return;
|
||||
}
|
||||
|
||||
mousedOverSlotNumber = slot.slotNumber;
|
||||
ControlSlot.highlighting.get(EnumHighlighting.SHIFT_CLICK).clear();
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setShort("slot", (short) slot.slotNumber);
|
||||
window.sendClientAction("mouse-over-slot", nbt);
|
||||
}
|
||||
|
||||
private void onMouseOverSlot(EntityPlayer player, NBTTagCompound data) {
|
||||
@@ -389,28 +406,31 @@ public class ContainerCraftGUI extends Container
|
||||
if (request == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
request.transfer(false);
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
List<Integer> slots = new ArrayList<Integer>();
|
||||
List<Integer> slots = new ArrayList<>();
|
||||
for (TransferRequest.TransferSlot tslot : request.getInsertedSlots()) {
|
||||
Slot slot = getSlot(tslot.inventory, tslot.id);
|
||||
if (slot != null) {
|
||||
slots.add(slot.slotNumber);
|
||||
}
|
||||
}
|
||||
|
||||
int[] array = new int[slots.size()];
|
||||
for (int i = 0; i < slots.size(); ++i) {
|
||||
array[i] = slots.get(i);
|
||||
}
|
||||
|
||||
nbt.setIntArray("slots", array);
|
||||
nbt.setShort("origin", (short) slotnumber);
|
||||
syncedNBT.put("shift-click-info", nbt);
|
||||
}
|
||||
|
||||
private void onRecieveShiftClickHighlights(EntityPlayer player, NBTTagCompound data) {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ShiftClick).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.SHIFT_CLICK).clear();
|
||||
for (int slotnumber : data.getIntArray("slots")) {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ShiftClick).add(slotnumber);
|
||||
ControlSlot.highlighting.get(EnumHighlighting.SHIFT_CLICK).add(slotnumber);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,6 +449,7 @@ public class ContainerCraftGUI extends Container
|
||||
if (handleNBT(side, player, name, action)) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.recieveGuiNBT(getSide(), player, name, action);
|
||||
INetwork.RecieveGuiNBT machine = Machine.getInterface(INetwork.RecieveGuiNBT.class, window.getInventory());
|
||||
if (machine != null) {
|
||||
@@ -443,6 +464,7 @@ public class ContainerCraftGUI extends Container
|
||||
slot = new CustomSlot(inventory, index);
|
||||
addSlotToContainer(slot);
|
||||
}
|
||||
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setByte("t", (byte) type.ordinal());
|
||||
nbt.setShort("i", (short) index);
|
||||
@@ -469,6 +491,7 @@ public class ContainerCraftGUI extends Container
|
||||
if (inventorySlots.get(slotNumber) != null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Slot slot = new CustomSlot(inventory, index);
|
||||
slot.slotNumber = slotNumber;
|
||||
inventorySlots.add(slotNumber, slot);
|
||||
|
||||
@@ -8,17 +8,16 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CustomSlot extends Slot
|
||||
{
|
||||
public class CustomSlot extends Slot {
|
||||
public CustomSlot(IInventory inventory, int index) {
|
||||
super(inventory, index, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
return inventory.isItemValidForSlot(getSlotIndex(), par1ItemStack);
|
||||
}
|
||||
|
||||
public CustomSlot(IInventory inventory, int index) {
|
||||
super(inventory, index, 0, 0);
|
||||
}
|
||||
|
||||
public InventorySlot getInventorySlot() {
|
||||
IInventorySlots slots = Machine.getInterface(IInventorySlots.class, inventory);
|
||||
if (slots != null) {
|
||||
@@ -36,8 +35,7 @@ public class CustomSlot extends Slot
|
||||
ItemStack stack = player.inventory.getItemStack();
|
||||
if (stack == null || mouseButton == 2) {
|
||||
putStack(null);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
stack = stack.copy();
|
||||
stack.stackSize = 1;
|
||||
putStack(stack);
|
||||
|
||||
@@ -9,23 +9,14 @@ import binnie.core.craftgui.events.EventMouse;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
|
||||
public abstract class Dialog extends Control
|
||||
{
|
||||
public abstract class Dialog extends Control {
|
||||
public Dialog(IWidget parent, float w, float h) {
|
||||
super(parent, (parent.w() - w) / 2.0f, (parent.h() - h) / 2.0f, w, h);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.AlwaysOnTop);
|
||||
addAttribute(WidgetAttribute.BlockTooltip);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addAttribute(WidgetAttribute.ALWAYS_ON_TOP);
|
||||
addAttribute(WidgetAttribute.BLOCK_TOOLTIP);
|
||||
initialise();
|
||||
addEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
if (!getArea().contains(getRelativeMousePosition())) {
|
||||
onClose();
|
||||
getParent().deleteChild(Dialog.this);
|
||||
}
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.Any, this));
|
||||
addEventHandler(new MouseDownHandler().setOrigin(EventHandler.Origin.Any, this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,4 +35,14 @@ public abstract class Dialog extends Control
|
||||
public boolean isMouseOverWidget(IPoint relativeMouse) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private class MouseDownHandler extends EventMouse.Down.Handler {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
if (!getArea().contains(getRelativeMousePosition())) {
|
||||
onClose();
|
||||
getParent().deleteChild(Dialog.this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import binnie.core.BinnieCore;
|
||||
import binnie.core.resource.BinnieIcon;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum GUIIcon
|
||||
{
|
||||
public enum GUIIcon {
|
||||
ArrowUp("arrow-up"),
|
||||
ArrowDown("arrow-down"),
|
||||
ArrowLeft("arrow-left"),
|
||||
|
||||
@@ -33,12 +33,16 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiCraftGUI extends GuiContainer
|
||||
{
|
||||
IPoint mousePos;
|
||||
public class GuiCraftGUI extends GuiContainer {
|
||||
private Window window;
|
||||
private ItemStack draggedItem;
|
||||
|
||||
public GuiCraftGUI(Window window) {
|
||||
super(window.getContainer());
|
||||
this.window = window;
|
||||
resize(window.getSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
window.updateClient();
|
||||
@@ -48,15 +52,9 @@ public class GuiCraftGUI extends GuiContainer
|
||||
return mc;
|
||||
}
|
||||
|
||||
public GuiCraftGUI(Window window) {
|
||||
super(window.getContainer());
|
||||
mousePos = new IPoint(0.0f, 0.0f);
|
||||
this.window = window;
|
||||
resize(window.getSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,11 +102,10 @@ public class GuiCraftGUI extends GuiContainer
|
||||
GL11.glDisable(2929);
|
||||
MinecraftTooltip tooltip = new MinecraftTooltip();
|
||||
if (isHelpMode()) {
|
||||
tooltip.setType(Tooltip.Type.Help);
|
||||
tooltip.setType(Tooltip.Type.HELP);
|
||||
window.getHelpTooltip(tooltip);
|
||||
}
|
||||
else {
|
||||
tooltip.setType(Tooltip.Type.Standard);
|
||||
} else {
|
||||
tooltip.setType(Tooltip.Type.STANDARD);
|
||||
window.getTooltip(tooltip);
|
||||
}
|
||||
if (tooltip.exists()) {
|
||||
@@ -133,8 +130,7 @@ public class GuiCraftGUI extends GuiContainer
|
||||
if (string != null) {
|
||||
if (!string.contains("~~~")) {
|
||||
strings.addAll(font.listFormattedStringToWidth(string, tooltip.maxWidth));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
strings.add(string);
|
||||
}
|
||||
}
|
||||
@@ -178,8 +174,7 @@ public class GuiCraftGUI extends GuiContainer
|
||||
String s2 = strings.get(k3);
|
||||
if (k3 == 0) {
|
||||
s2 = MinecraftTooltip.getTitle(tooltip.getType()) + s2;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
s2 = MinecraftTooltip.getBody(tooltip.getType()) + s2;
|
||||
}
|
||||
if (s2.contains("~~~")) {
|
||||
@@ -239,8 +234,7 @@ public class GuiCraftGUI extends GuiContainer
|
||||
if (button == -1) {
|
||||
float dx = Mouse.getEventDX() * width / (float) mc.displayWidth;
|
||||
float dy = -(Mouse.getEventDY() * height / (float) mc.displayHeight);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
window.callEvent(new EventMouse.Up(origin, x, y, button));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
public interface IMachineInformation
|
||||
{
|
||||
public interface IMachineInformation {
|
||||
String getInformation();
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
|
||||
public interface IMinecraftTooltip extends ITooltip
|
||||
{
|
||||
public interface IMinecraftTooltip extends ITooltip {
|
||||
void getTooltip(MinecraftTooltip p0);
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.machines.transfer.TransferRequest;
|
||||
|
||||
public interface IWindowAffectsShiftClick
|
||||
{
|
||||
public interface IWindowAffectsShiftClick {
|
||||
void alterRequest(TransferRequest p0);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.core.craftgui.minecraft;
|
||||
|
||||
public enum InventoryType
|
||||
{
|
||||
public enum InventoryType {
|
||||
Player,
|
||||
Machine,
|
||||
Window,
|
||||
|
||||
@@ -7,8 +7,7 @@ import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
|
||||
class ListMap<T> implements List<T>
|
||||
{
|
||||
class ListMap<T> implements List<T> {
|
||||
private LinkedHashMap<Integer, T> map;
|
||||
|
||||
ListMap() {
|
||||
|
||||
@@ -3,8 +3,7 @@ package binnie.core.craftgui.minecraft;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class MinecraftTooltip extends Tooltip
|
||||
{
|
||||
public class MinecraftTooltip extends Tooltip {
|
||||
public static int getOutline(ITooltipType type) {
|
||||
return TypeColour.valueOf(type.toString()).getOutline();
|
||||
}
|
||||
@@ -17,14 +16,12 @@ public class MinecraftTooltip extends Tooltip
|
||||
return TypeColour.valueOf(type.toString()).getBody();
|
||||
}
|
||||
|
||||
public enum Type implements ITooltipType
|
||||
{
|
||||
Error,
|
||||
Warning
|
||||
public enum Type implements ITooltipType {
|
||||
ERROR,
|
||||
WARNING
|
||||
}
|
||||
|
||||
private enum TypeColour
|
||||
{
|
||||
private enum TypeColour {
|
||||
Standard(5243135, EnumChatFormatting.WHITE, EnumChatFormatting.GRAY),
|
||||
Help(5046016, EnumChatFormatting.GREEN, EnumChatFormatting.DARK_GREEN),
|
||||
Information(49151, EnumChatFormatting.AQUA, EnumChatFormatting.DARK_AQUA),
|
||||
|
||||
@@ -2,8 +2,7 @@ package binnie.core.craftgui.minecraft;
|
||||
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleCraftGUI implements IInitializable
|
||||
{
|
||||
public class ModuleCraftGUI implements IInitializable {
|
||||
@Override
|
||||
public void preInit() {
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
|
||||
public abstract class Window extends TopLevelWidget implements INetwork.RecieveGuiNBT {
|
||||
protected float titleButtonLeft;
|
||||
protected float titleButtonRight;
|
||||
private GuiCraftGUI gui;
|
||||
private ContainerCraftGUI container;
|
||||
private WindowInventory windowInventory;
|
||||
private ControlText title;
|
||||
protected float titleButtonLeft;
|
||||
protected float titleButtonRight;
|
||||
private StandardTexture bgText1;
|
||||
private StandardTexture bgText2;
|
||||
private boolean hasBeenInitialised;
|
||||
@@ -58,67 +58,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
private IInventory entityInventory;
|
||||
private Side side;
|
||||
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
Deque<IWidget> queue = calculateMousedOverWidgets();
|
||||
while (!queue.isEmpty()) {
|
||||
IWidget widget = queue.removeFirst();
|
||||
if (widget.isEnabled() && widget.isVisible()) {
|
||||
if (!widget.calculateIsMouseOver()) {
|
||||
continue;
|
||||
}
|
||||
if (widget instanceof ITooltip) {
|
||||
((ITooltip) widget).getTooltip(tooltip);
|
||||
if (tooltip.exists()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (widget.hasAttribute(WidgetAttribute.BlockTooltip)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void getHelpTooltip(MinecraftTooltip tooltip) {
|
||||
Deque<IWidget> queue = calculateMousedOverWidgets();
|
||||
while (!queue.isEmpty()) {
|
||||
IWidget widget = queue.removeFirst();
|
||||
if (widget.isEnabled() && widget.isVisible()) {
|
||||
if (!widget.calculateIsMouseOver()) {
|
||||
continue;
|
||||
}
|
||||
if (widget instanceof ITooltipHelp) {
|
||||
((ITooltipHelp) widget).getHelpTooltip(tooltip);
|
||||
if (tooltip.exists()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (widget.hasAttribute(WidgetAttribute.BlockTooltip)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract AbstractMod getMod();
|
||||
|
||||
protected abstract String getName();
|
||||
|
||||
public BinnieResource getBackgroundTextureFile(int i) {
|
||||
return Binnie.Resource.getPNG(getMod(), ResourceType.GUI, getName() + ((i == 1) ? "" : i));
|
||||
}
|
||||
|
||||
public boolean showHelpButton() {
|
||||
return Machine.getInterface(IInventoryMachine.class, getInventory()) != null;
|
||||
}
|
||||
|
||||
public String showInfoButton() {
|
||||
if (Machine.getInterface(IMachineInformation.class, getInventory()) != null) {
|
||||
return Machine.getInterface(IMachineInformation.class, getInventory()).getInformation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Window(float width, float height, EntityPlayer player, IInventory inventory, Side side) {
|
||||
this.side = side;
|
||||
titleButtonLeft = 8.0f;
|
||||
@@ -163,6 +102,71 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
});
|
||||
}
|
||||
|
||||
public static <T extends Window> T get(IWidget widget) {
|
||||
return (T) widget.getSuperParent();
|
||||
}
|
||||
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
Deque<IWidget> queue = calculateMousedOverWidgets();
|
||||
while (!queue.isEmpty()) {
|
||||
IWidget widget = queue.removeFirst();
|
||||
if (widget.isEnabled() && widget.isVisible()) {
|
||||
if (!widget.calculateIsMouseOver()) {
|
||||
continue;
|
||||
}
|
||||
if (widget instanceof ITooltip) {
|
||||
((ITooltip) widget).getTooltip(tooltip);
|
||||
if (tooltip.exists()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (widget.hasAttribute(WidgetAttribute.BLOCK_TOOLTIP)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void getHelpTooltip(MinecraftTooltip tooltip) {
|
||||
Deque<IWidget> queue = calculateMousedOverWidgets();
|
||||
while (!queue.isEmpty()) {
|
||||
IWidget widget = queue.removeFirst();
|
||||
if (widget.isEnabled() && widget.isVisible()) {
|
||||
if (!widget.calculateIsMouseOver()) {
|
||||
continue;
|
||||
}
|
||||
if (widget instanceof ITooltipHelp) {
|
||||
((ITooltipHelp) widget).getHelpTooltip(tooltip);
|
||||
if (tooltip.exists()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (widget.hasAttribute(WidgetAttribute.BLOCK_TOOLTIP)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract AbstractMod getMod();
|
||||
|
||||
protected abstract String getName();
|
||||
|
||||
public BinnieResource getBackgroundTextureFile(int i) {
|
||||
return Binnie.Resource.getPNG(getMod(), ResourceType.GUI, getName() + ((i == 1) ? "" : i));
|
||||
}
|
||||
|
||||
public boolean showHelpButton() {
|
||||
return Machine.getInterface(IInventoryMachine.class, getInventory()) != null;
|
||||
}
|
||||
|
||||
public String showInfoButton() {
|
||||
if (Machine.getInterface(IMachineInformation.class, getInventory()) != null) {
|
||||
return Machine.getInterface(IMachineInformation.class, getInventory()).getInformation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = new ControlTextCentered(this, 12.0f, title);
|
||||
this.title.setColor(0x404040);
|
||||
@@ -220,7 +224,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Help).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.HELP).clear();
|
||||
ControlSlot.shiftClickActive = false;
|
||||
}
|
||||
|
||||
@@ -239,6 +243,12 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setHeldItemStack(ItemStack stack) {
|
||||
if (player != null) {
|
||||
player.inventory.setItemStack(stack);
|
||||
}
|
||||
}
|
||||
|
||||
public IInventory getInventory() {
|
||||
return entityInventory;
|
||||
}
|
||||
@@ -251,12 +261,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
public void onClose() {
|
||||
}
|
||||
|
||||
public void setHeldItemStack(ItemStack stack) {
|
||||
if (player != null) {
|
||||
player.inventory.setItemStack(stack);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isServer() {
|
||||
return !isClient();
|
||||
}
|
||||
@@ -307,8 +311,4 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
public Texture getBackground2() {
|
||||
return bgText2;
|
||||
}
|
||||
|
||||
public static <T extends Window> T get(IWidget widget) {
|
||||
return (T) widget.getSuperParent();
|
||||
}
|
||||
}
|
||||
@@ -10,17 +10,16 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class WindowInventory implements IInventory
|
||||
{
|
||||
public class WindowInventory implements IInventory {
|
||||
private Window window;
|
||||
private Map<Integer, ItemStack> inventory;
|
||||
private Map<Integer, SlotValidator> validators;
|
||||
private List<Integer> disabledAutoDispenses;
|
||||
|
||||
public WindowInventory(Window window) {
|
||||
inventory = new HashMap<Integer, ItemStack>();
|
||||
validators = new HashMap<Integer, SlotValidator>();
|
||||
disabledAutoDispenses = new ArrayList<Integer>();
|
||||
inventory = new HashMap<>();
|
||||
validators = new HashMap<>();
|
||||
disabledAutoDispenses = new ArrayList<>();
|
||||
this.window = window;
|
||||
}
|
||||
|
||||
@@ -29,6 +28,7 @@ public class WindowInventory implements IInventory
|
||||
if (inventory.size() == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int max = 0;
|
||||
for (int i : inventory.keySet()) {
|
||||
if (i > max) {
|
||||
@@ -48,22 +48,24 @@ public class WindowInventory implements IInventory
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int index, int amount) {
|
||||
if (inventory.containsKey(index)) {
|
||||
ItemStack item = inventory.get(index);
|
||||
ItemStack output = item.copy();
|
||||
int available = item.stackSize;
|
||||
if (amount > available) {
|
||||
amount = available;
|
||||
}
|
||||
ItemStack itemStack = item;
|
||||
itemStack.stackSize -= amount;
|
||||
output.stackSize = amount;
|
||||
if (item.stackSize == 0) {
|
||||
setInventorySlotContents(index, null);
|
||||
}
|
||||
return output;
|
||||
if (!inventory.containsKey(index)) {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
|
||||
ItemStack item = inventory.get(index);
|
||||
ItemStack output = item.copy();
|
||||
int available = item.stackSize;
|
||||
if (amount > available) {
|
||||
amount = available;
|
||||
}
|
||||
|
||||
ItemStack itemStack = item;
|
||||
itemStack.stackSize -= amount;
|
||||
output.stackSize = amount;
|
||||
if (item.stackSize == 0) {
|
||||
setInventorySlotContents(index, null);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
public ControlEnergyBar(IWidget parent, int x, int y, int width, int height, Position direction) {
|
||||
super(parent, x, y, width, height);
|
||||
this.direction = direction;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
public IPoweredMachine getClientPower() {
|
||||
@@ -105,10 +105,10 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(Tooltip.Type.Help);
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(Tooltip.Type.HELP);
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
|
||||
} else if (ControlEnergyBar.isError) {
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR);
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
|
||||
}
|
||||
|
||||
@@ -121,11 +121,11 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
public void onRenderForeground() {
|
||||
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
IArea area = getArea();
|
||||
CraftGUI.Render.colour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
|
||||
CraftGUI.Render.colour(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
} else if (ControlEnergyBar.isError) {
|
||||
IArea area = getArea();
|
||||
CraftGUI.Render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
|
||||
CraftGUI.Render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,12 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
private ErrorState errorState;
|
||||
private int type;
|
||||
|
||||
public ControlErrorState(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 16.0f, 16.0f);
|
||||
type = 0;
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
Object texture = CraftGUITexture.StateWarning;
|
||||
@@ -38,8 +44,8 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
public void onUpdateClient() {
|
||||
errorState = getError();
|
||||
type = Window.get(this).getContainer().getErrorType();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Error).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Warning).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ERROR).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.WARNING).clear();
|
||||
ControlLiquidTank.tankError.clear();
|
||||
ControlEnergyBar.isError = false;
|
||||
|
||||
@@ -58,9 +64,9 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
}
|
||||
if (id >= 0) {
|
||||
if (type == 0) {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Error).add(id);
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ERROR).add(id);
|
||||
} else {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Warning).add(id);
|
||||
ControlSlot.highlighting.get(EnumHighlighting.WARNING).add(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,12 +79,6 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
}
|
||||
}
|
||||
|
||||
public ControlErrorState(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 16.0f, 16.0f);
|
||||
type = 0;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltipOrig) {
|
||||
MinecraftTooltip tooltip = (MinecraftTooltip) tooltipOrig;
|
||||
@@ -87,9 +87,9 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
if (type == 0) {
|
||||
tooltip.setType(MinecraftTooltip.Type.Error);
|
||||
tooltip.setType(MinecraftTooltip.Type.ERROR);
|
||||
} else {
|
||||
tooltip.setType(MinecraftTooltip.Type.Warning);
|
||||
tooltip.setType(MinecraftTooltip.Type.WARNING);
|
||||
}
|
||||
|
||||
tooltip.add(errorState.toString());
|
||||
@@ -97,8 +97,4 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
tooltip.add(errorState.getTooltip());
|
||||
}
|
||||
}
|
||||
|
||||
public ErrorState getErrorState() {
|
||||
return errorState;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import binnie.core.util.I18N;
|
||||
public class ControlHelp extends Control implements ITooltip {
|
||||
public ControlHelp(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 16.0f, 16.0f);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -23,7 +23,7 @@ public class ControlHelp extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.Help);
|
||||
tooltip.setType(Tooltip.Type.HELP);
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.help"));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.help.0"));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.help.1"));
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ControlInfo extends Control implements ITooltip {
|
||||
public ControlInfo(IWidget parent, float x, float y, String info) {
|
||||
super(parent, x, y, 16.0f, 16.0f);
|
||||
this.info = info;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -26,7 +26,7 @@ public class ControlInfo extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.Information);
|
||||
tooltip.setType(Tooltip.Type.INFORMATION);
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.info"));
|
||||
tooltip.add(info);
|
||||
tooltip.setMaxWidth(200);
|
||||
|
||||
@@ -14,15 +14,10 @@ import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ControlItemDisplay extends Control implements ITooltip {
|
||||
private ItemStack itemStack;
|
||||
public boolean hastooltip;
|
||||
private ItemStack itemStack;
|
||||
private boolean rotating;
|
||||
|
||||
public void setTooltip() {
|
||||
hastooltip = true;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
}
|
||||
|
||||
public ControlItemDisplay(IWidget parent, float x, float y) {
|
||||
this(parent, x, y, 16.0f);
|
||||
}
|
||||
@@ -42,10 +37,16 @@ public class ControlItemDisplay extends Control implements ITooltip {
|
||||
rotating = false;
|
||||
}
|
||||
|
||||
public void setTooltip() {
|
||||
hastooltip = true;
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
IPoint relativeToWindow = getAbsolutePosition().sub(getSuperParent().getPosition());
|
||||
if (relativeToWindow.x() > Window.get(this).getSize().x() + 100.0f || relativeToWindow.y() > Window.get(this).getSize().y() + 100.0f) {
|
||||
if (relativeToWindow.x() > Window.get(this).getSize().x() + 100.0f ||
|
||||
relativeToWindow.y() > Window.get(this).getSize().y() + 100.0f) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -66,14 +67,14 @@ public class ControlItemDisplay extends Control implements ITooltip {
|
||||
}
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (hastooltip && itemStack != null) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
super(parent, x, y, horizontal ? 60.0f : 18.0f, horizontal ? 18.0f : 60.0f);
|
||||
tankID = 0;
|
||||
this.horizontal = horizontal;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
@@ -74,10 +74,10 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, IPoint.ZERO);
|
||||
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(Tooltip.Type.Help);
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(Tooltip.Type.HELP);
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
|
||||
} else if (ControlLiquidTank.tankError.contains(tankID)) {
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
|
||||
int c = 0xaa000000 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR);
|
||||
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
|
||||
} else if (getSuperParent().getMousedOverWidget() == this) {
|
||||
if (Window.get(this).getGui().getDraggedItem() != null) {
|
||||
@@ -125,13 +125,13 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
CraftGUI.Render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, IPoint.ZERO);
|
||||
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
|
||||
IArea area = getArea();
|
||||
CraftGUI.Render.colour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
|
||||
CraftGUI.Render.colour(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
}
|
||||
|
||||
if (ControlLiquidTank.tankError.contains(tankID)) {
|
||||
IArea area = getArea();
|
||||
CraftGUI.Render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
|
||||
CraftGUI.Render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
|
||||
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
if (slot.isReadOnly()) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.outputOnlyTank"));
|
||||
}
|
||||
|
||||
|
||||
if (slot.getValidator() == null) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.acceptsAny"));
|
||||
} else {
|
||||
|
||||
@@ -3,8 +3,6 @@ package binnie.core.craftgui.minecraft.control;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.minecraft.InventoryType;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -66,24 +64,6 @@ public class ControlPlayerInventory extends Control {
|
||||
}
|
||||
}
|
||||
|
||||
public void addItem(ItemStack item) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (ControlSlot slot : slots) {
|
||||
if (!slot.slot.getHasStack()) {
|
||||
slot.slot.putStack(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addInventory(IInventory inventory) {
|
||||
for (int i = 0; i < inventory.getSizeInventory(); ++i) {
|
||||
addItem(inventory.getStackInSlot(i));
|
||||
}
|
||||
}
|
||||
|
||||
public ControlSlot getSlot(int i) {
|
||||
if (i < 0 || i >= slots.size()) {
|
||||
return null;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ControlPowerSystem extends Control implements ITooltip {
|
||||
|
||||
public ControlPowerSystem(IWidget parent, float x, float y, PowerSystem system) {
|
||||
super(parent, x, y, 16.0f, 16.0f);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
this.system = system;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ControlPowerSystem extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.Power);
|
||||
tooltip.setType(Tooltip.Type.POWER);
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.powerSupply"));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.poweredBy", system.getUnitName()));
|
||||
tooltip.setMaxWidth(200);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
@@ -8,6 +9,7 @@ import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.IProcess;
|
||||
import binnie.core.machines.power.ProcessInfo;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class ControlProgressBase extends Control {
|
||||
protected float progress;
|
||||
@@ -15,7 +17,37 @@ public class ControlProgressBase extends Control {
|
||||
public ControlProgressBase(IWidget parent, float x, float y, float w, float h) {
|
||||
super(parent, x, y, w, h);
|
||||
progress = 0.0f;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
public static String convertTime(int time) {
|
||||
int seconds = (int) (time / 20.0f);
|
||||
int minutes = 0;
|
||||
while (seconds >= 60) {
|
||||
minutes++;
|
||||
seconds -= 60;
|
||||
}
|
||||
|
||||
String ts = "";
|
||||
if (minutes > 0) {
|
||||
if (minutes == 1) {
|
||||
ts += I18N.localise(BinnieCore.instance, "gui.database.time.minute");
|
||||
} else {
|
||||
ts += I18N.localise(BinnieCore.instance, "gui.database.time.minutes", minutes);
|
||||
}
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
if (ts.length() > 0) {
|
||||
ts += " ";
|
||||
}
|
||||
if (seconds == 1) {
|
||||
ts += I18N.localise(BinnieCore.instance, "gui.database.time.second");
|
||||
} else {
|
||||
ts += I18N.localise(BinnieCore.instance, "gui.database.time.seconds", seconds);
|
||||
}
|
||||
}
|
||||
return ts;
|
||||
}
|
||||
|
||||
public void setProgress(float progress) {
|
||||
@@ -43,45 +75,26 @@ public class ControlProgressBase extends Control {
|
||||
public void getHelpTooltip(Tooltip tooltip) {
|
||||
ProcessInfo process = getProcess();
|
||||
IProcess machineProcess = Machine.getMachine(Window.get(this).getInventory()).getInterface(IProcess.class);
|
||||
if (process != null) {
|
||||
tooltip.add("Progress");
|
||||
if (progress == 0.0f) {
|
||||
tooltip.add("Not in Progress");
|
||||
} else if (process.getProcessTime() > 0) {
|
||||
tooltip.add(machineProcess.getTooltip() + " (" + (int) process.getCurrentProgress() + "%)");
|
||||
} else {
|
||||
tooltip.add("In Progress");
|
||||
}
|
||||
|
||||
if (process.getProcessTime() > 0) {
|
||||
tooltip.add("Time Left: " + convertTime((int) ((1.0f - progress) * process.getProcessTime())));
|
||||
tooltip.add("Total Time: " + convertTime(process.getProcessTime()));
|
||||
tooltip.add("Energy Cost: " + process.getProcessEnergy() * 10 + " RF");
|
||||
} else {
|
||||
tooltip.add("Energy Cost: " + process.getEnergyPerTick() * 10.0f + " RF / tick");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String convertTime(int time) {
|
||||
int seconds = (int) (time / 20.0f);
|
||||
int minutes = 0;
|
||||
while (seconds >= 60) {
|
||||
minutes++;
|
||||
seconds -= 60;
|
||||
if (process == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String ts = "";
|
||||
if (minutes > 0) {
|
||||
ts = ts + minutes + " minute" + ((minutes == 1) ? "" : "s");
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.time.progress"));
|
||||
|
||||
if (progress == 0.0f) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.time.notInProgress"));
|
||||
} else if (process.getProcessTime() > 0) {
|
||||
tooltip.add(machineProcess.getTooltip() + " (" + (int) process.getCurrentProgress() + "%)");
|
||||
} else {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.time.inProgress"));
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
if (ts.length() > 0) {
|
||||
ts += " ";
|
||||
}
|
||||
ts = ts + seconds + " second" + ((seconds == 1) ? "" : "s");
|
||||
if (process.getProcessTime() > 0) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.time.left", convertTime((int) ((1.0f - progress) * process.getProcessTime()))));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.time.total", convertTime(process.getProcessTime())));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.energyCost.0", process.getProcessEnergy() * 10));
|
||||
} else {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.energyCost.1", process.getEnergyPerTick() * 10.0f));
|
||||
}
|
||||
return ts;
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,8 @@ public class ControlSlide extends Control {
|
||||
super(parent, x, y, w, h);
|
||||
slideActive = true;
|
||||
label = null;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.BlockTooltip);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addAttribute(WidgetAttribute.BLOCK_TOOLTIP);
|
||||
expanded = new IArea(getPosition(), getSize());
|
||||
anchor = anchor2.opposite();
|
||||
float border = (anchor.x() != 0) ? (expanded.w() - 6.0f) : (expanded.h() - 6.0f);
|
||||
|
||||
@@ -31,6 +31,13 @@ import java.util.Map;
|
||||
public class ControlSlot extends ControlSlotBase {
|
||||
public static Map<EnumHighlighting, List<Integer>> highlighting = new HashMap<>();
|
||||
public static boolean shiftClickActive = false;
|
||||
|
||||
static {
|
||||
for (EnumHighlighting h : EnumHighlighting.values()) {
|
||||
ControlSlot.highlighting.put(h, new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
public Slot slot;
|
||||
|
||||
public ControlSlot(IWidget parent, float x, float y) {
|
||||
@@ -75,7 +82,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
|
||||
boolean highlighted = false;
|
||||
for (Map.Entry<EnumHighlighting, List<Integer>> highlight : ControlSlot.highlighting.entrySet()) {
|
||||
if (highlight.getKey() == EnumHighlighting.ShiftClick && !ControlSlot.shiftClickActive) {
|
||||
if (highlight.getKey() == EnumHighlighting.SHIFT_CLICK && !ControlSlot.shiftClickActive) {
|
||||
continue;
|
||||
}
|
||||
if (highlighted || !highlight.getValue().contains(slot.slotNumber)) {
|
||||
@@ -103,7 +110,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
|
||||
boolean highlighted = false;
|
||||
for (Map.Entry<EnumHighlighting, List<Integer>> highlight : ControlSlot.highlighting.entrySet()) {
|
||||
if (highlight.getKey() == EnumHighlighting.ShiftClick && !ControlSlot.shiftClickActive) {
|
||||
if (highlight.getKey() == EnumHighlighting.SHIFT_CLICK && !ControlSlot.shiftClickActive) {
|
||||
continue;
|
||||
}
|
||||
if (highlighted || !highlight.getValue().contains(slot.slotNumber)) {
|
||||
@@ -137,7 +144,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
if (Window.get(this).getGui().isHelpMode() && isMouseOver()) {
|
||||
for (ControlSlot slot2 : getControlSlots()) {
|
||||
if (slot2.slot != null) {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Help).add(slot2.slot.slotNumber);
|
||||
ControlSlot.highlighting.get(EnumHighlighting.HELP).add(slot2.slot.slotNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,7 +196,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
if (slot.isReadOnly()) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.slot.pickupOnly"));
|
||||
}
|
||||
|
||||
|
||||
if (slot.getValidator() == null) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.slot.accepts", I18N.localise(BinnieCore.instance, "gui.slot.anyItem")));
|
||||
} else {
|
||||
@@ -212,10 +219,4 @@ public class ControlSlot extends ControlSlotBase {
|
||||
? ((CustomSlot) slot).getInventorySlot()
|
||||
: null;
|
||||
}
|
||||
|
||||
static {
|
||||
for (EnumHighlighting h : EnumHighlighting.values()) {
|
||||
ControlSlot.highlighting.put(h, new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,22 +3,17 @@ package binnie.core.craftgui.minecraft.control;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.minecraft.InventoryType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class ControlSlotArray extends Control implements Iterable<ControlSlot> {
|
||||
private int rows;
|
||||
private int columns;
|
||||
private List<ControlSlot> slots;
|
||||
|
||||
public ControlSlotArray(IWidget parent, int x, int y, int columns, int rows) {
|
||||
super(parent, x, y, columns * 18, rows * 18);
|
||||
slots = new ArrayList<>();
|
||||
this.rows = rows;
|
||||
this.columns = columns;
|
||||
for (int row = 0; row < rows; ++row) {
|
||||
for (int column = 0; column < columns; ++column) {
|
||||
slots.add(createSlot(column * 18, row * 18));
|
||||
@@ -30,24 +25,6 @@ public class ControlSlotArray extends Control implements Iterable<ControlSlot> {
|
||||
return new ControlSlot(this, x, y);
|
||||
}
|
||||
|
||||
public void setItemStacks(ItemStack[] array) {
|
||||
int i = 0;
|
||||
for (ItemStack item : array) {
|
||||
if (i >= slots.size()) {
|
||||
return;
|
||||
}
|
||||
slots.get(i).slot.putStack(item);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public ControlSlot getControlSlot(int i) {
|
||||
if (i < 0 || i >= slots.size()) {
|
||||
return null;
|
||||
}
|
||||
return slots.get(i);
|
||||
}
|
||||
|
||||
public ControlSlotArray create(int[] index) {
|
||||
return create(InventoryType.Machine, index);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
|
||||
|
||||
public ControlSlotBase(IWidget parent, float x, float y, int size) {
|
||||
super(parent, x, y, size, size);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
itemDisplay = new ControlItemDisplay(this, 1.0f, 1.0f, size - 2);
|
||||
addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
|
||||
@Override
|
||||
|
||||
@@ -13,6 +13,11 @@ import binnie.core.machines.inventory.IChargedSlots;
|
||||
public class ControlSlotCharge extends Control {
|
||||
private int slot;
|
||||
|
||||
public ControlSlotCharge(IWidget parent, int x, int y, int slot) {
|
||||
super(parent, x, y, 4.0f, 18.0f);
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
float getCharge() {
|
||||
IChargedSlots slots = Machine.getInterface(IChargedSlots.class, Window.get(this).getInventory());
|
||||
return (slots == null) ? 0.0f : slots.getCharge(slot);
|
||||
@@ -24,11 +29,6 @@ public class ControlSlotCharge extends Control {
|
||||
CraftGUI.Render.texturePercentage(CraftGUI.Render.getTexture(CraftGUITexture.SlotCharge), getArea().inset(1), Position.BOTTOM, getCharge());
|
||||
}
|
||||
|
||||
public ControlSlotCharge(IWidget parent, int x, int y, int slot) {
|
||||
super(parent, x, y, 4.0f, 18.0f);
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHelpTooltip(Tooltip tooltip) {
|
||||
tooltip.add("Charge Remaining: " + (int) (getCharge() * 100.0f) + "%");
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ControlUser extends Control implements ITooltip {
|
||||
super(parent, x, y, 16.0f, 16.0f);
|
||||
this.username = username;
|
||||
team = "";
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -29,7 +29,7 @@ public class ControlUser extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.User);
|
||||
tooltip.setType(Tooltip.Type.USER);
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.owner"));
|
||||
|
||||
if (!username.isEmpty()) {
|
||||
|
||||
@@ -4,24 +4,24 @@ import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.minecraft.MinecraftTooltip;
|
||||
|
||||
public enum EnumHighlighting {
|
||||
Error,
|
||||
Warning,
|
||||
Help,
|
||||
ShiftClick;
|
||||
ERROR,
|
||||
WARNING,
|
||||
HELP,
|
||||
SHIFT_CLICK;
|
||||
|
||||
int getColour() {
|
||||
switch (this) {
|
||||
case Error:
|
||||
return MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
|
||||
case ERROR:
|
||||
return MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR);
|
||||
|
||||
case Help:
|
||||
return MinecraftTooltip.getOutline(Tooltip.Type.Help);
|
||||
case HELP:
|
||||
return MinecraftTooltip.getOutline(Tooltip.Type.HELP);
|
||||
|
||||
case ShiftClick:
|
||||
case SHIFT_CLICK:
|
||||
return 0xffff00;
|
||||
|
||||
case Warning:
|
||||
return MinecraftTooltip.getOutline(MinecraftTooltip.Type.Warning);
|
||||
case WARNING:
|
||||
return MinecraftTooltip.getOutline(MinecraftTooltip.Type.WARNING);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
|
||||
}
|
||||
|
||||
public String getEpitome(float discoveredPercentage) {
|
||||
// TODO refactor
|
||||
int i = 0;
|
||||
if (discoveredPercentage == 1.0f) {
|
||||
i = 6;
|
||||
@@ -223,6 +222,7 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
|
||||
discovered = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (discovered) {
|
||||
branches.add(branch);
|
||||
}
|
||||
@@ -239,6 +239,7 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
|
||||
discovered = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (discovered) {
|
||||
branches.add(branch);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
public enum EnumBeeBooleanModifier {
|
||||
Sealed,
|
||||
SelfLighted,
|
||||
SunlightStimulated,
|
||||
Hellish
|
||||
SEALED,
|
||||
SELF_LIGHTED,
|
||||
SUNLIGHT_STIMULATED,
|
||||
HELLISH
|
||||
}
|
||||
@@ -4,12 +4,12 @@ import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public enum EnumBeeModifier {
|
||||
Territory,
|
||||
Mutation,
|
||||
Lifespan,
|
||||
Production,
|
||||
Flowering,
|
||||
GeneticDecay;
|
||||
TERRITORY,
|
||||
MUTATION,
|
||||
LIFESPAN,
|
||||
PRODUCTION,
|
||||
FLOWERING,
|
||||
GENETIC_DECAY;
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise(BinnieCore.instance, "beemodifier." + name().toLowerCase());
|
||||
|
||||
@@ -45,21 +45,6 @@ public class ForestryAllele {
|
||||
}
|
||||
}
|
||||
|
||||
public enum Flowering {
|
||||
Slowest,
|
||||
Slower,
|
||||
Slow,
|
||||
Average,
|
||||
Fast,
|
||||
Faster,
|
||||
Fastest,
|
||||
Maximum;
|
||||
|
||||
public IAllele getAllele() {
|
||||
return AlleleManager.alleleRegistry.getAllele("forestry.flowering" + toString());
|
||||
}
|
||||
}
|
||||
|
||||
public enum Territory {
|
||||
Default,
|
||||
Large,
|
||||
|
||||
@@ -96,6 +96,7 @@ public class Gene implements INBTTagable, IGene {
|
||||
if (!(obj instanceof Gene)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Gene g = (Gene) obj;
|
||||
return allele == g.allele && chromosome.ordinal() == g.chromosome.ordinal() && root == g.root;
|
||||
}
|
||||
@@ -104,10 +105,6 @@ public class Gene implements INBTTagable, IGene {
|
||||
return getSystem().getAlleleName(chromosome, allele);
|
||||
}
|
||||
|
||||
public String getChromosomeName() {
|
||||
return getSystem().getChromosomeName(chromosome);
|
||||
}
|
||||
|
||||
public String getShortChromosomeName() {
|
||||
return getSystem().getChromosomeShortName(chromosome);
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
public interface IAlleleProvider {
|
||||
IAllele getAllele();
|
||||
}
|
||||
@@ -52,7 +52,6 @@ public class TreeBreedingSystem extends BreedingSystem {
|
||||
public UniqueItemStackSet allWoods = new UniqueItemStackSet();
|
||||
private UniqueItemStackSet discoveredFruits = new UniqueItemStackSet();
|
||||
private UniqueItemStackSet discoveredWoods = new UniqueItemStackSet();
|
||||
public UniqueItemStackSet discoveredPlanks = new UniqueItemStackSet();
|
||||
|
||||
public TreeBreedingSystem() {
|
||||
iconUndiscovered = Binnie.Resource.getItemIcon(ExtraTrees.instance, "icon/undiscoveredTree");
|
||||
@@ -74,7 +73,7 @@ public class TreeBreedingSystem extends BreedingSystem {
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 53006;
|
||||
return 0x00cf0e;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -264,7 +263,10 @@ public class TreeBreedingSystem extends BreedingSystem {
|
||||
|
||||
@Override
|
||||
public int[] getActiveTypes() {
|
||||
return new int[]{EnumGermlingType.SAPLING.ordinal(), EnumGermlingType.POLLEN.ordinal()};
|
||||
return new int[]{
|
||||
EnumGermlingType.SAPLING.ordinal(),
|
||||
EnumGermlingType.POLLEN.ordinal()
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -62,16 +62,16 @@ public enum FluidContainer {
|
||||
return new ItemStack(Items.bucket, 1, 0);
|
||||
|
||||
case Can:
|
||||
return Mods.Forestry.stack("canEmpty");
|
||||
return Mods.forestry.stack("canEmpty");
|
||||
|
||||
case Capsule:
|
||||
return Mods.Forestry.stack("waxCapsule");
|
||||
return Mods.forestry.stack("waxCapsule");
|
||||
|
||||
case Glass:
|
||||
return new ItemStack(Items.glass_bottle, 1, 0);
|
||||
|
||||
case Refractory:
|
||||
return Mods.Forestry.stack("refractoryEmpty");
|
||||
return Mods.forestry.stack("refractoryEmpty");
|
||||
|
||||
case Cylinder:
|
||||
return GeneticsItems.Cylinder.get(1);
|
||||
|
||||
@@ -156,7 +156,7 @@ public class ComponentPowerReceptor extends MachineComponent implements
|
||||
if (getMachine().getWorld() == null) {
|
||||
return;
|
||||
}
|
||||
if (Mods.IC2.active()) {
|
||||
if (Mods.ic2.active()) {
|
||||
do_addToEnergyNet();
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ public class ComponentPowerReceptor extends MachineComponent implements
|
||||
if (getMachine().getWorld() == null) {
|
||||
return;
|
||||
}
|
||||
if (Mods.IC2.active()) {
|
||||
if (Mods.ic2.active()) {
|
||||
do_removeFromEnergyNet();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class ControlColourSelector extends Control implements ITooltip, IControlValue<E
|
||||
public ControlColourSelector(IWidget parent, float x, float y, float w, float h, EnumColor value) {
|
||||
super(parent, x, y, w, h);
|
||||
setValue(value);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -247,7 +247,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
|
||||
tabIcon = new ControlItemDisplay(tabPropertyPanel, 58.0f, y2 - 4);
|
||||
tabIcon.setItemStack(new ItemStack(Items.paper));
|
||||
tabIcon.addAttribute(WidgetAttribute.MouseOver);
|
||||
tabIcon.addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
tabIcon.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
|
||||
@@ -33,40 +33,40 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.Lifespan, 0.75f, 0.25f);
|
||||
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.Production, 1.5f, 5.0f);
|
||||
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.Territory, 0.5f, 0.1f);
|
||||
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.Lifespan, 0.75f, 0.5f);
|
||||
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.Production, 0.75f, 0.5f);
|
||||
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.Mutation, 1.5f, 5.0f);
|
||||
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.Lifespan, 0.75f, 0.5f);
|
||||
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.Production, 0.25f, 0.1f);
|
||||
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.25f);
|
||||
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f);
|
||||
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.TERRITORY, 0.5f, 0.1f);
|
||||
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.5f);
|
||||
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.75f, 0.5f);
|
||||
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.MUTATION, 1.5f, 5.0f);
|
||||
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.5f);
|
||||
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.25f, 0.1f);
|
||||
EnumHiveFrame.Soul.setMaxDamage(80);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Lifespan, 1.5f, 5.0f);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Mutation, 0.5f, 0.2f);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Production, 0.75f, 0.2f);
|
||||
EnumHiveFrame.Debug.logic.setModifier(EnumBeeModifier.Lifespan, 1.0E-4f, 1.0E-4f);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.MUTATION, 0.5f, 0.2f);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.75f, 0.2f);
|
||||
EnumHiveFrame.Debug.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.0E-4f, 1.0E-4f);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
new ItemStack(EnumHiveFrame.Cocoa.item),
|
||||
" c ", "cFc", " c ",
|
||||
'F', Mods.Forestry.stack("frameImpregnated"),
|
||||
'F', Mods.forestry.stack("frameImpregnated"),
|
||||
'c', new ItemStack(Items.dye, 1, 3)
|
||||
);
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(EnumHiveFrame.Cage.item),
|
||||
Mods.Forestry.stack("frameImpregnated"),
|
||||
Mods.forestry.stack("frameImpregnated"),
|
||||
Blocks.iron_bars
|
||||
);
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(EnumHiveFrame.Soul.item),
|
||||
Mods.Forestry.stack("frameImpregnated"),
|
||||
Mods.forestry.stack("frameImpregnated"),
|
||||
Blocks.soul_sand
|
||||
);
|
||||
GameRegistry.addRecipe(
|
||||
new ItemStack(EnumHiveFrame.Clay.item),
|
||||
" c ", "cFc", " c ",
|
||||
'F', Mods.Forestry.stack("frameImpregnated"),
|
||||
'F', Mods.forestry.stack("frameImpregnated"),
|
||||
'c', Items.clay_ball
|
||||
);
|
||||
}
|
||||
@@ -86,52 +86,52 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Territory, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.TERRITORY, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.MUTATION, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.LIFESPAN, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Production, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.PRODUCTION, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.FLOWERING, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.GENETIC_DECAY, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.Sealed);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SEALED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SELF_LIGHTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SUNLIGHT_STIMULATED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.Hellish);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.HELLISH);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -29,13 +29,13 @@ public class ModuleApiary implements IInitializable {
|
||||
BinnieCore.proxy.registerTileEntity(TileExtraBeeAlveary.class, "extrabees.tile.alveary", BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine"));
|
||||
ModuleApiary.blockComponent = machineGroup.getBlock();
|
||||
AlvearyMutator.addMutationItem(new ItemStack(Blocks.soul_sand), 1.5f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("UranFuel"), 4.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("MOXFuel"), 10.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("Plutonium"), 8.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("smallPlutonium"), 5.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("Uran235"), 4.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("smallUran235"), 2.5f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("Uran238"), 2.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.ic2.stack("UranFuel"), 4.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.ic2.stack("MOXFuel"), 10.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.ic2.stack("Plutonium"), 8.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.ic2.stack("smallPlutonium"), 5.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.ic2.stack("Uran235"), 4.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.ic2.stack("smallUran235"), 2.5f);
|
||||
AlvearyMutator.addMutationItem(Mods.ic2.stack("Uran238"), 2.0f);
|
||||
AlvearyMutator.addMutationItem(new ItemStack(Items.ender_pearl), 2.0f);
|
||||
AlvearyMutator.addMutationItem(new ItemStack(Items.ender_eye), 4.0f);
|
||||
|
||||
@@ -51,57 +51,57 @@ public class ModuleApiary implements IInitializable {
|
||||
AlvearyMachine.Mutator.get(1),
|
||||
"g g", " a ", "t t",
|
||||
'g', Items.gold_ingot,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
'a', Mods.forestry.block("alveary"),
|
||||
't',
|
||||
new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5)
|
||||
new ItemStack(Mods.forestry.item("thermionicTubes"), 1, 5)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.Frame.get(1),
|
||||
"iii", "tat", " t ",
|
||||
'i', Items.iron_ingot,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4)
|
||||
'a', Mods.forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.forestry.item("thermionicTubes"), 1, 4)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.RainShield.get(1),
|
||||
" b ", "bab", "t t",
|
||||
'b', Items.brick,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4)
|
||||
'a', Mods.forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.forestry.item("thermionicTubes"), 1, 4)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.Lighting.get(1),
|
||||
"iii", "iai", " t ",
|
||||
'i', Items.glowstone_dust,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4)
|
||||
'a', Mods.forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.forestry.item("thermionicTubes"), 1, 4)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.Stimulator.get(1),
|
||||
"kik", "iai", " t ",
|
||||
'i', Items.gold_nugget,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4),
|
||||
'k', new ItemStack(Mods.Forestry.item("chipsets"), 1, 2)
|
||||
'a', Mods.forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.forestry.item("thermionicTubes"), 1, 4),
|
||||
'k', new ItemStack(Mods.forestry.item("chipsets"), 1, 2)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.Hatchery.get(1),
|
||||
"i i", " a ", "iti",
|
||||
'i', Blocks.glass_pane,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5)
|
||||
'a', Mods.forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.forestry.item("thermionicTubes"), 1, 5)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
AlvearyMachine.Transmission.get(1),
|
||||
new Object[]{
|
||||
" t ", "tat", " t ",
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
'a', Mods.forestry.block("alveary"),
|
||||
't', "gearTin"
|
||||
}
|
||||
));
|
||||
|
||||
@@ -41,18 +41,18 @@ public class AlvearyStimulator {
|
||||
Territory(2, 10);
|
||||
|
||||
static {
|
||||
CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.Production, 1.5f, 5.0f);
|
||||
CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.Production, 2.5f, 10.0f);
|
||||
CircuitType.Plant.logic.setModifier(EnumBeeModifier.Flowering, 1.5f, 5.0f);
|
||||
CircuitType.Death.logic.setModifier(EnumBeeModifier.Lifespan, 0.8f, 0.2f);
|
||||
CircuitType.Life.logic.setModifier(EnumBeeModifier.Lifespan, 1.5f, 5.0f);
|
||||
CircuitType.Nether.logic.setModifier(EnumBeeBooleanModifier.Hellish);
|
||||
CircuitType.Mutation.logic.setModifier(EnumBeeModifier.Mutation, 1.5f, 5.0f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.Territory, 0.4f, 0.1f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.Production, 0.9f, 0.5f);
|
||||
CircuitType.Territory.logic.setModifier(EnumBeeModifier.Territory, 1.5f, 5.0f);
|
||||
CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f);
|
||||
CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 2.5f, 10.0f);
|
||||
CircuitType.Plant.logic.setModifier(EnumBeeModifier.FLOWERING, 1.5f, 5.0f);
|
||||
CircuitType.Death.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.8f, 0.2f);
|
||||
CircuitType.Life.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f);
|
||||
CircuitType.Nether.logic.setModifier(EnumBeeBooleanModifier.HELLISH);
|
||||
CircuitType.Mutation.logic.setModifier(EnumBeeModifier.MUTATION, 1.5f, 5.0f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.TERRITORY, 0.4f, 0.1f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.9f, 0.5f);
|
||||
CircuitType.Territory.logic.setModifier(EnumBeeModifier.TERRITORY, 1.5f, 5.0f);
|
||||
for (CircuitType type : values()) {
|
||||
type.logic.setModifier(EnumBeeModifier.GeneticDecay, 1.5f, 10.0f);
|
||||
type.logic.setModifier(EnumBeeModifier.GENETIC_DECAY, 1.5f, 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,52 +87,52 @@ public class AlvearyStimulator {
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Territory, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.TERRITORY, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.MUTATION, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.LIFESPAN, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Production, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.PRODUCTION, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.FLOWERING, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
|
||||
return logic.getModifier(EnumBeeModifier.GENETIC_DECAY, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.Sealed);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SEALED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SELF_LIGHTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SUNLIGHT_STIMULATED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.Hellish);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.HELLISH);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class AlvearyStimulator {
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Forestry Circuits";
|
||||
return "FORESTRY Circuits";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ public class AlvearyStimulator {
|
||||
protected CircuitType type;
|
||||
|
||||
public StimulatorCircuit(CircuitType type, ICircuitLayout layout) {
|
||||
super("stimulator." + type.toString().toLowerCase(), 4, layout, Mods.Forestry.item("thermionicTubes"), type.recipe);
|
||||
super("stimulator." + type.toString().toLowerCase(), 4, layout, Mods.forestry.item("thermionicTubes"), type.recipe);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,9 +149,9 @@ public enum ExtraBeeItems implements IItemMisc {
|
||||
null,
|
||||
ExtraBeeItems.ScentedGear.get(1),
|
||||
" j ", "bgb", " p ",
|
||||
'j', Mods.Forestry.item("royalJelly"),
|
||||
'b', Mods.Forestry.item("beeswax"),
|
||||
'p', Mods.Forestry.item("pollen"),
|
||||
'j', Mods.forestry.item("royalJelly"),
|
||||
'b', Mods.forestry.item("beeswax"),
|
||||
'p', Mods.forestry.item("pollen"),
|
||||
'g', gear
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1641,7 +1641,7 @@ public enum ExtraBeeDefinition implements IBeeDefinition {
|
||||
protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) {
|
||||
beeSpecies
|
||||
.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 0.30f)
|
||||
.addSpecialty(Mods.Forestry.stack("pollen"), 0.20f)
|
||||
.addSpecialty(Mods.forestry.stack("pollen"), 0.20f)
|
||||
.addSpecialty(EnumHoneyComb.PURPLE.get(1), 0.15f)
|
||||
.setIsNotCounted()
|
||||
.setHasEffect();
|
||||
|
||||
@@ -162,7 +162,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
return block.getClass().getName().toLowerCase().contains("sapling");
|
||||
|
||||
case MYSTICAL:
|
||||
return block == Mods.Botania.block("flower");
|
||||
return block == Mods.botania.block("flower");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -199,9 +199,9 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
|
||||
Block block = world.getBlock(x2, y2, z2);
|
||||
if (block != null) {
|
||||
if (block == Mods.Botania.block("flower")) {
|
||||
if (block == Mods.botania.block("flower")) {
|
||||
int meta = world.getBlockMetadata(x2, y2, z2);
|
||||
Item item = Mods.Botania.item("petal");
|
||||
Item item = Mods.botania.item("petal");
|
||||
if (item != null) {
|
||||
prods.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ControlBiomes extends Control implements ITooltip {
|
||||
public ControlBiomes(IWidget parent, int x, int y, int width, int height) {
|
||||
super(parent, x, y, width * 16, height * 16);
|
||||
tolerated = new ArrayList<>();
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ControlClimateBar extends Control implements ITooltip {
|
||||
tolerated = new ArrayList<>();
|
||||
tempColours = new int[]{0x00fffb, 0x78bbff, 0x4fff30, 0xffff00, 0xffa200, 0xff0000};
|
||||
humidColours = new int[]{0xffe7a3, 0x1aff00, 0x307cff};
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
public ControlClimateBar(IWidget parent, int x, int y, int width, int height, boolean humidity) {
|
||||
@@ -38,7 +38,7 @@ public class ControlClimateBar extends Control implements ITooltip {
|
||||
tolerated = new ArrayList<>();
|
||||
tempColours = new int[]{0x00fffb, 0x78bbff, 0x4fff30, 0xffff00, 0xffa200, 0xff0000};
|
||||
humidColours = new int[]{0xffe7a3, 0x1aff00, 0x307cff};
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
isHumidity = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,16 +27,16 @@ public class WindowApiaristDatabase extends WindowAbstractDatabase {
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.overview", 0));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.classification", 0));
|
||||
new PageSpeciesGenome(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.genome", 0));
|
||||
new PageSpeciesProducts(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.products", 0));
|
||||
new PageSpeciesClimate(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.climate", 0));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.resultant", 0));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.further", 0));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.overview", 0));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.species", 0));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraBees.instance, "breeder", 0));
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.overview"));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.classification"));
|
||||
new PageSpeciesGenome(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.genome"));
|
||||
new PageSpeciesProducts(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.products"));
|
||||
new PageSpeciesClimate(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.climate"));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.resultant"));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.further"));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.overview"));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.species"));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraBees.instance, "breeder"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,8 +25,8 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
}
|
||||
|
||||
public static void addSubtypes() {
|
||||
ItemStack beeswax = Mods.Forestry.stack("beeswax");
|
||||
ItemStack honeyDrop = Mods.Forestry.stack("honeyDrop");
|
||||
ItemStack beeswax = Mods.forestry.stack("beeswax");
|
||||
ItemStack honeyDrop = Mods.forestry.stack("honeyDrop");
|
||||
OreDictionary.registerOre("ingotIron", Items.iron_ingot);
|
||||
OreDictionary.registerOre("ingotGold", Items.gold_ingot);
|
||||
OreDictionary.registerOre("gemDiamond", Items.diamond);
|
||||
@@ -88,8 +88,8 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
EnumHoneyComb.REDSTONE.addProduct(honeyDrop, 0.50f);
|
||||
|
||||
EnumHoneyComb.RESIN.addProduct(beeswax, 1.00f);
|
||||
EnumHoneyComb.RESIN.tryAddProduct(Mods.IC2.stack("itemHarz"), 1.00f);
|
||||
EnumHoneyComb.RESIN.tryAddProduct(Mods.IC2.stack("itemHarz"), 0.50f);
|
||||
EnumHoneyComb.RESIN.tryAddProduct(Mods.ic2.stack("itemHarz"), 1.00f);
|
||||
EnumHoneyComb.RESIN.tryAddProduct(Mods.ic2.stack("itemHarz"), 0.50f);
|
||||
|
||||
EnumHoneyComb.IC2ENERGY.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.IC2ENERGY.addProduct(new ItemStack(Items.redstone, 1, 0), 0.75f);
|
||||
@@ -147,7 +147,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
|
||||
EnumHoneyComb.COFFEE.addProduct(beeswax, 0.90f);
|
||||
EnumHoneyComb.COFFEE.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(Mods.IC2.stack("itemCofeePowder"), 0.75f);
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(Mods.ic2.stack("itemCofeePowder"), 0.75f);
|
||||
|
||||
EnumHoneyComb.GLACIAL.tryAddProduct(EnumHoneyDrop.ICE, 0.80f);
|
||||
EnumHoneyComb.GLACIAL.addProduct(honeyDrop, 0.75f);
|
||||
@@ -199,7 +199,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
EnumHoneyComb.SALTPETER.tryAddProduct(getOreDictionary("dustSaltpeter"), 1.00f);
|
||||
|
||||
EnumHoneyComb.COMPOST.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.COMPOST.tryAddProduct(Mods.Forestry.stack("fertilizerBio"), 1.00f);
|
||||
EnumHoneyComb.COMPOST.tryAddProduct(Mods.forestry.stack("fertilizerBio"), 1.00f);
|
||||
|
||||
EnumHoneyComb.SAWDUST.addProduct(honeyDrop, 0.25f);
|
||||
if (!OreDictionary.getOres("dustSawdust").isEmpty()) {
|
||||
@@ -338,7 +338,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
QUARTZ;
|
||||
|
||||
public ItemStack get() {
|
||||
return new ItemStack(Mods.Forestry.item("beeCombs"), 1, ordinal());
|
||||
return new ItemStack(Mods.forestry.item("beeCombs"), 1, ordinal());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class ModuleProducts implements IInitializable {
|
||||
GameRegistry.addRecipe(
|
||||
new ItemStack(ExtraBees.honeyCrystalEmpty),
|
||||
"#@#", "@#@", "#@#",
|
||||
'@', Mods.Forestry.stack("honeyDrop"),
|
||||
'@', Mods.forestry.stack("honeyDrop"),
|
||||
'#', EnumHoneyDrop.ENERGY.get(1)
|
||||
);
|
||||
for (EnumHoneyComb info : EnumHoneyComb.values()) {
|
||||
|
||||
@@ -67,11 +67,11 @@ public class ModuleBlocks implements IInitializable {
|
||||
OreDictionary.registerOre("plankWood", plank2.getStack());
|
||||
}
|
||||
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:fence");
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:gate");
|
||||
// FMLInterModComms.sendMessage("Forestry", "add-alveary-slab",
|
||||
FMLInterModComms.sendMessage("FORESTRY", "add-fence-block", "ExtraTrees:fence");
|
||||
FMLInterModComms.sendMessage("FORESTRY", "add-fence-block", "ExtraTrees:gate");
|
||||
// FMLInterModComms.sendMessage("FORESTRY", "add-alveary-slab",
|
||||
// "ExtraTrees:slab");
|
||||
FMLInterModComms.sendMessage("Forestry", "add-fence-block", "ExtraTrees:multifence");
|
||||
FMLInterModComms.sendMessage("FORESTRY", "add-fence-block", "ExtraTrees:multifence");
|
||||
ModuleBlocks.hedgeRenderID = BinnieCore.proxy.getUniqueRenderID();
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class ModuleBlocks implements IInitializable {
|
||||
|
||||
public void addSqueezer(ILogType log, ILiquidType liquid, int amount, float pulpChance) {
|
||||
FluidStack liquidStack = liquid.get(amount);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{log.getItemStack()}, liquidStack, Mods.Forestry.stack("woodPulp"), (int) (100.0f * pulpChance));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{log.getItemStack()}, liquidStack, Mods.forestry.stack("woodPulp"), (int) (100.0f * pulpChance));
|
||||
}
|
||||
|
||||
public void addSqueezer(ILogType log, ILiquidType liquid, int amount) {
|
||||
|
||||
@@ -204,7 +204,7 @@ public class PlankType {
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
Item stack = Mods.Forestry.item("planks");
|
||||
Item stack = Mods.forestry.item("planks");
|
||||
return new ItemStack(stack, 1, ordinal());
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ public class PlankType {
|
||||
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
ItemStack fence = Mods.Forestry.stack("fences");
|
||||
ItemStack fence = Mods.forestry.stack("fences");
|
||||
fence.setItemDamage(ordinal());
|
||||
return fence;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
}
|
||||
|
||||
public static boolean canConnect(Block block) {
|
||||
return block == ((ItemBlock) Mods.Forestry.item("fences")).field_150939_a || block == Blocks.fence || block == Blocks.fence_gate || block == Blocks.nether_brick_fence || block instanceof IBlockFence || block == ExtraTrees.blockGate;
|
||||
return block == ((ItemBlock) Mods.forestry.item("fences")).field_150939_a || block == Blocks.fence || block == Blocks.fence_gate || block == Blocks.nether_brick_fence || block instanceof IBlockFence || block == ExtraTrees.blockGate;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,7 @@ import binnie.core.mod.config.PropBoolean;
|
||||
public class ConfigurationMain {
|
||||
@ConfigProperty(
|
||||
key = "lemon.citrus.family",
|
||||
comment = {"Uses reflection to convert the Forestry lemon tree to the Citrus family."}
|
||||
comment = {"Uses reflection to convert the FORESTRY lemon tree to the Citrus family."}
|
||||
)
|
||||
@PropBoolean
|
||||
public static boolean alterLemon = true;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ControlBreweryProgress extends ControlProgressBase {
|
||||
|
||||
protected ControlBreweryProgress(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 34.0f, 39.0f);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ControlFruitPressProgress extends ControlProgressBase {
|
||||
|
||||
protected ControlFruitPressProgress(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, 37.0f, 69.0f);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
|
||||
@@ -126,7 +126,7 @@ public class ControlTileSelect extends Control implements IControlValue<IDesign>
|
||||
protected ControlTile(IWidget parent, float x, float y, IDesign value) {
|
||||
super(parent, x, y, 18.0f, 18.0f);
|
||||
setValue(value);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventMouse.Down event) {
|
||||
|
||||
@@ -23,6 +23,6 @@ public class PageSpeciesImage extends PageSpecies {
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
display.setSpecies(species, EnumDiscoveryState.Show);
|
||||
display.setSpecies(species, EnumDiscoveryState.SHOW);
|
||||
}
|
||||
}
|
||||
@@ -38,15 +38,15 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.overview", 0));
|
||||
new PageSpeciesTreeGenome(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.genome", 0));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.classification", 0));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.resultant", 0));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.further", 0));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.overview", 0));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.species", 0));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder", 0));
|
||||
createMode(TreeMode.Fruit, new ModeWidgets(TreeMode.Fruit, this) {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.overview"));
|
||||
new PageSpeciesTreeGenome(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.genome"));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.classification"));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.resultant"));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.further"));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.overview"));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.species"));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder"));
|
||||
createMode(TreeMode.FRUIT, new ModeWidgets(TreeMode.FRUIT, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
(listBox = new ControlListBox<ItemStack>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@@ -57,7 +57,7 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
|
||||
}).setOptions(((TreeBreedingSystem) getBreedingSystem()).allFruits);
|
||||
}
|
||||
});
|
||||
createMode(TreeMode.Wood, new ModeWidgets(TreeMode.Wood, this) {
|
||||
createMode(TreeMode.WOOD, new ModeWidgets(TreeMode.WOOD, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
(listBox = new ControlListBox<ItemStack>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@@ -68,7 +68,7 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
|
||||
}).setOptions(((TreeBreedingSystem) getBreedingSystem()).allWoods);
|
||||
}
|
||||
});
|
||||
createMode(TreeMode.Planks, new ModeWidgets(TreeMode.Planks, this) {
|
||||
createMode(TreeMode.PLANKS, new ModeWidgets(TreeMode.PLANKS, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
listBox = new ControlListBox<ItemStack>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@@ -79,11 +79,11 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
|
||||
};
|
||||
}
|
||||
});
|
||||
new PageFruit(getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.natural", 0), true);
|
||||
new PageFruit(getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.potential", 0), false);
|
||||
new PageWood(getInfoPages(TreeMode.Wood), new DatabaseTab(ExtraTrees.instance, "wood.natural", 0));
|
||||
new PagePlanksOverview(getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.overview", 0));
|
||||
new PagePlanksTrees(getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.natural", 1));
|
||||
new PageFruit(getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.natural"), true);
|
||||
new PageFruit(getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.potential"), false);
|
||||
new PageWood(getInfoPages(TreeMode.WOOD), new DatabaseTab(ExtraTrees.instance, "wood.natural"));
|
||||
new PagePlanksOverview(getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.overview"));
|
||||
new PagePlanksTrees(getInfoPages(TreeMode.PLANKS), new DatabaseTab(ExtraTrees.instance, "planks.natural"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,9 +97,9 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
|
||||
}
|
||||
|
||||
enum TreeMode implements IDatabaseMode {
|
||||
Fruit,
|
||||
Wood,
|
||||
Planks;
|
||||
FRUIT,
|
||||
WOOD,
|
||||
PLANKS;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
|
||||
+8
-8
@@ -27,14 +27,14 @@ public class WindowLepidopteristDatabase extends WindowAbstractDatabase {
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview", 0));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification", 0));
|
||||
new PageSpeciesImage(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen", 0));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant", 0));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further", 0));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview", 0));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species", 0));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder", 0));
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview"));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification"));
|
||||
new PageSpeciesImage(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen"));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant"));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further"));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview"));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species"));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,6 @@ public class ControlDropDownMenu extends Panel {
|
||||
public ControlDropDownMenu(IWidget parent, float x, float y, float width, float height) {
|
||||
super(parent, x, y, width, 2.0f, MinecraftGUI.PanelType.Gray);
|
||||
stayOpenOnChildClick = false;
|
||||
addAttribute(WidgetAttribute.CanFocus);
|
||||
addAttribute(WidgetAttribute.CAN_FOCUS);
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ public class ControlFluidDisplay extends Control implements ITooltip {
|
||||
|
||||
public void setTooltip() {
|
||||
hastooltip = true;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loaded 100 of 125 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user