mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-18 11:29:23 +00:00
[1.7.10] Some refactoring (#102)
* Some refactoring * Some refactoring Added some localization * Added some localization Fix wrong branch localization in page branch overview Simplify some localization * Simplify some localization * Removed unused localize method * Simplify some localization * Removed proxy.localise method * Simplify localization
This commit is contained in:
1 parent
81301c3bd2
commit
1ffaad9fcd
232 files changed
+1947
-2054
No files matched your search
@@ -189,54 +189,54 @@ public class Botany extends AbstractMod {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.entityPlayer != null && event.entityPlayer.getHeldItem() != null) {
|
||||
int y = event.y;
|
||||
Block block = event.world.getBlock(event.x, y, event.z);
|
||||
if (block == null || !Gardening.isSoil(block)) {
|
||||
block = event.world.getBlock(event.x, --y, event.z);
|
||||
}
|
||||
if (block == null) {
|
||||
if (event.entityPlayer == null || event.entityPlayer.getHeldItem() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int y = event.y;
|
||||
Block block = event.world.getBlock(event.x, y, event.z);
|
||||
if (block == null || !Gardening.isSoil(block)) {
|
||||
block = event.world.getBlock(event.x, --y, event.z);
|
||||
}
|
||||
if (block == null || !Gardening.isSoil(block)) {
|
||||
return;
|
||||
}
|
||||
|
||||
IBlockSoil soil = (IBlockSoil) block;
|
||||
if (Gardening.isNutrientFertiliser(event.entityPlayer.getHeldItem()) && soil.getType(event.world, event.x, y, event.z) != EnumSoilType.FLOWERBED) {
|
||||
EnumSoilType type = soil.getType(event.world, event.x, y, event.z);
|
||||
int next = Math.min(type.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
||||
if (soil.fertilise(event.world, event.x, y, event.z, EnumSoilType.values()[next]) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem = event.entityPlayer.getHeldItem();
|
||||
heldItem.stackSize--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Gardening.isSoil(block)) {
|
||||
IBlockSoil soil = (IBlockSoil) block;
|
||||
if (Gardening.isNutrientFertiliser(event.entityPlayer.getHeldItem()) && soil.getType(event.world, event.x, y, event.z) != EnumSoilType.FLOWERBED) {
|
||||
EnumSoilType type = soil.getType(event.world, event.x, y, event.z);
|
||||
int next = Math.min(type.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
||||
if (soil.fertilise(event.world, event.x, y, event.z, EnumSoilType.values()[next]) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem = event.entityPlayer.getHeldItem();
|
||||
heldItem.stackSize--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Gardening.isAcidFertiliser(event.entityPlayer.getHeldItem()) && soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ACID) {
|
||||
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
||||
int next = Math.max(pH.ordinal() - Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 0);
|
||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next]) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem2 = event.entityPlayer.getHeldItem();
|
||||
heldItem2.stackSize--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Gardening.isAlkalineFertiliser(event.entityPlayer.getHeldItem()) && soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ALKALINE) {
|
||||
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
||||
int next = Math.min(pH.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next]) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem3 = event.entityPlayer.getHeldItem();
|
||||
heldItem3.stackSize--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Gardening.isWeedkiller(event.entityPlayer.getHeldItem()) && Gardening.addWeedKiller(event.world, event.x, y, event.z) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem4 = event.entityPlayer.getHeldItem();
|
||||
--heldItem4.stackSize;
|
||||
}
|
||||
if (Gardening.isAcidFertiliser(event.entityPlayer.getHeldItem()) && soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ACID) {
|
||||
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
||||
int next = Math.max(pH.ordinal() - Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 0);
|
||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next]) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem2 = event.entityPlayer.getHeldItem();
|
||||
heldItem2.stackSize--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Gardening.isAlkalineFertiliser(event.entityPlayer.getHeldItem()) && soil.getPH(event.world, event.x, y, event.z) != EnumAcidity.ALKALINE) {
|
||||
EnumAcidity pH = soil.getPH(event.world, event.x, y, event.z);
|
||||
int next = Math.min(pH.ordinal() + Gardening.getFertiliserStrength(event.entityPlayer.getHeldItem()), 2);
|
||||
if (soil.setPH(event.world, event.x, y, event.z, EnumAcidity.values()[next]) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem3 = event.entityPlayer.getHeldItem();
|
||||
heldItem3.stackSize--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Gardening.isWeedkiller(event.entityPlayer.getHeldItem()) && Gardening.addWeedKiller(event.world, event.x, y, event.z) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem4 = event.entityPlayer.getHeldItem();
|
||||
heldItem4.stackSize--;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -275,12 +275,14 @@ public class Botany extends AbstractMod {
|
||||
py = 1;
|
||||
}
|
||||
|
||||
if (py >= 0) {
|
||||
IFlower flower = BotanyCore.getFlowerRoot().getConversion(event.entityPlayer.getHeldItem());
|
||||
if (flower != null && Gardening.plant(world, x, y + py, z, flower, event.entityPlayer.getGameProfile()) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem = event.entityPlayer.getHeldItem();
|
||||
--heldItem.stackSize;
|
||||
}
|
||||
if (py < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
IFlower flower = BotanyCore.getFlowerRoot().getConversion(event.entityPlayer.getHeldItem());
|
||||
if (flower != null && Gardening.plant(world, x, y + py, z, flower, event.entityPlayer.getGameProfile()) && !event.entityPlayer.capabilities.isCreativeMode) {
|
||||
ItemStack heldItem = event.entityPlayer.getHeldItem();
|
||||
heldItem.stackSize--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -27,7 +28,7 @@ public class CreativeTabBotany extends CreativeTabs {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getTabLabel() {
|
||||
return Botany.proxy.localise("tab.botany");
|
||||
return I18N.localise("botany.tab.botany");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -75,7 +75,7 @@ public class BlockCeramic extends Block implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
return I18N.localise(Botany.instance, "ceramicBlock");
|
||||
return I18N.localise("botany.ceramicBlock");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -531,13 +531,13 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise(Botany.instance, type.name);
|
||||
return I18N.localise("botany." + type.name);
|
||||
}
|
||||
|
||||
public void addTooltip(List tooltip) {
|
||||
String name = color1.getName();
|
||||
if (type.canDouble() && color2 != color1) {
|
||||
name = I18N.localise(Botany.instance, "colour.double", name, color2.getName());
|
||||
name = I18N.localise("botany.colour.double", name, color2.getName());
|
||||
}
|
||||
tooltip.add(EnumChatFormatting.GRAY + name);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
@@ -31,7 +30,7 @@ public class BlockCeramicPatterned extends BlockDesign {
|
||||
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return I18N.localise(Botany.instance, "ceramicBlock");
|
||||
return I18N.localise("botany.ceramicBlock");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -106,7 +106,7 @@ public class BlockStained extends Block implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
return I18N.localise(Botany.instance, "pigmentedGlass");
|
||||
return I18N.localise("botany.pigmentedGlass");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IColourMix;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
@@ -47,7 +46,7 @@ public class ControlColourMixSymbol extends Control implements ITooltip {
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (type == 1) {
|
||||
float chance = value.getChance();
|
||||
tooltip.add(I18N.localise(Botany.instance, "gui.controls.colorMixSymbol.chance", chance));
|
||||
tooltip.add(I18N.localise("botany.gui.controls.colorMixSymbol.chance", chance));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IColourMix;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
@@ -15,13 +14,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PageColorMixResultant extends PageAbstract<IFlowerColor> {
|
||||
protected ControlText pageSpeciesFurtherTitle;
|
||||
protected ControlColorMixBox pageSpeciesFurtherList;
|
||||
protected ControlText title;
|
||||
protected ControlColorMixBox list;
|
||||
|
||||
public PageColorMixResultant(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
pageSpeciesFurtherTitle = new ControlTextCentered(this, 8.0f, I18N.localise(Botany.instance, "gui.controls.pageSpeciesFurtherTitle"));
|
||||
pageSpeciesFurtherList = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Resultant);
|
||||
title = new ControlTextCentered(this, 8.0f, I18N.localise("botany.gui.controls.pageSpeciesFurtherTitle"));
|
||||
list = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Resultant);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -32,6 +31,6 @@ public class PageColorMixResultant extends PageAbstract<IFlowerColor> {
|
||||
mixes.add(mix);
|
||||
}
|
||||
}
|
||||
pageSpeciesFurtherList.setOptions(mixes);
|
||||
list.setOptions(mixes);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IColourMix;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
@@ -15,13 +14,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PageColourMix extends PageAbstract<IFlowerColor> {
|
||||
ControlText pageSpeciesFurtherTitle;
|
||||
ControlColorMixBox pageSpeciesFurtherList;
|
||||
ControlText title;
|
||||
ControlColorMixBox list;
|
||||
|
||||
public PageColourMix(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
pageSpeciesFurtherTitle = new ControlTextCentered(this, 8.0f, I18N.localise(Botany.instance, "gui.controls.pageColorFurtherTitle"));
|
||||
pageSpeciesFurtherList = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Further);
|
||||
title = new ControlTextCentered(this, 8.0f, I18N.localise("botany.gui.controls.pageColorFurtherTitle"));
|
||||
list = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Further);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -32,6 +31,6 @@ public class PageColourMix extends PageAbstract<IFlowerColor> {
|
||||
mixes.add(mix);
|
||||
}
|
||||
}
|
||||
pageSpeciesFurtherList.setOptions(mixes);
|
||||
list.setOptions(mixes);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
@@ -18,8 +17,8 @@ import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
@@ -48,7 +47,7 @@ public class PageSpeciesFlowerGenome extends PageSpecies {
|
||||
int w = 144;
|
||||
int h = 176;
|
||||
|
||||
new ControlText(this, new IArea(0.0f, 4.0f, w, 16.0f), I18N.localise(Botany.instance, "gui.database.tab.genome"), TextJustification.MiddleCenter);
|
||||
new ControlText(this, new IArea(0.0f, 4.0f, w, 16.0f), I18N.localise("botany.gui.database.tab.genome"), TextJustification.MIDDLE_CENTER);
|
||||
ControlScrollableContent scrollable = new ControlScrollableContent(this, 4.0f, 20.0f, w - 8, h - 8 - 16, 12.0f);
|
||||
Control contents = new Control(scrollable, 0.0f, 0.0f, w - 8 - 12, h - 8 - 16);
|
||||
|
||||
@@ -58,30 +57,30 @@ public class PageSpeciesFlowerGenome extends PageSpecies {
|
||||
int y = 0;
|
||||
int th = 14;
|
||||
int valueX = w2 + 4;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise(Botany.instance, "gui.database.tab.genome.temp"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), AlleleHelper.toDisplay(treeSpecies.getTemperature()), TextJustification.MiddleLeft);
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise("botany.gui.database.tab.genome.temp"), TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), AlleleHelper.toDisplay(treeSpecies.getTemperature()), TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise(Botany.instance, "gui.database.tab.genome.moist"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), AlleleHelper.toDisplay(treeSpecies.getMoisture()), TextJustification.MiddleLeft);
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise("botany.gui.database.tab.genome.moist"), TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), AlleleHelper.toDisplay(treeSpecies.getMoisture()), TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise(Botany.instance, "gui.database.tab.genome.ph"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), AlleleHelper.toDisplay(treeSpecies.getPH()), TextJustification.MiddleLeft);
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise("botany.gui.database.tab.genome.ph"), TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), AlleleHelper.toDisplay(treeSpecies.getPH()), TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise(Botany.instance, "gui.database.tab.genome.fertility"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), genome.getFertility() + "x", TextJustification.MiddleLeft);
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise("botany.gui.database.tab.genome.fertility"), TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
|
||||
float lifespan = genome.getLifespan() * 68.27f / genome.getAgeChance() / 24000.0f;
|
||||
String lifespanValue = String.format("%.2f", lifespan);
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise(Botany.instance, "gui.database.tab.genome.lifespan"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), I18N.localise(Botany.instance, "gui.database.tab.genome.lifespan.value", lifespanValue), TextJustification.MiddleLeft);
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise("botany.gui.database.tab.genome.lifespan"), TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), I18N.localise("botany.gui.database.tab.genome.lifespan.value", lifespanValue), TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise(Botany.instance, "gui.database.tab.genome.nectar"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getName(), TextJustification.MiddleLeft);
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), I18N.localise("botany.gui.database.tab.genome.nectar"), TextJustification.MIDDLE_RIGHT);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getName(), TextJustification.MIDDLE_LEFT);
|
||||
y += th;
|
||||
|
||||
int x = w2;
|
||||
@@ -101,7 +100,7 @@ public class PageSpeciesFlowerGenome extends PageSpecies {
|
||||
}
|
||||
|
||||
int numOfLines = 1 + (tot - 1) / 3;
|
||||
new ControlText(contents, new IArea(0.0f, y - (numOfLines - 1) * 18, w2, 4 + 18 * numOfLines), I18N.localise(Botany.instance, "gui.database.tab.genome.varieties"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(0.0f, y - (numOfLines - 1) * 18, w2, 4 + 18 * numOfLines), I18N.localise("botany.gui.database.tab.genome.varieties"), TextJustification.MIDDLE_RIGHT);
|
||||
y += th;
|
||||
contents.setSize(new IPoint(contents.size().x(), y));
|
||||
scrollable.setScrollableContent(contents);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return I18N.localise(Botany.instance, "gui.database.name");
|
||||
return I18N.localise("botany.gui.database.name");
|
||||
}
|
||||
|
||||
enum FlowerMode implements IDatabaseMode {
|
||||
@@ -66,7 +66,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return Botany.proxy.localise("gui.database.tab." + name().toLowerCase());
|
||||
return I18N.localise("botany.gui.database.tab." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.farm;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.core.circuits.BinnieCircuit;
|
||||
@@ -29,13 +28,13 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
|
||||
if (moisture == EnumMoisture.DRY) {
|
||||
info += EnumChatFormatting.YELLOW
|
||||
+ I18N.localise(Botany.instance, "moisture.dry")
|
||||
+ I18N.localise("botany.moisture.dry")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
if (moisture == EnumMoisture.DAMP) {
|
||||
info += EnumChatFormatting.YELLOW
|
||||
+ I18N.localise(Botany.instance, "moisture.damp")
|
||||
+ I18N.localise("botany.moisture.damp")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
@@ -44,7 +43,7 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
info += ", ";
|
||||
}
|
||||
info += EnumChatFormatting.RED
|
||||
+ I18N.localise(Botany.instance, "ph.acid")
|
||||
+ I18N.localise("botany.ph.acid")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
@@ -53,7 +52,7 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
info += ", ";
|
||||
}
|
||||
info += EnumChatFormatting.GREEN
|
||||
+ I18N.localise(Botany.instance, "ph.neutral")
|
||||
+ I18N.localise("botany.ph.neutral")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
@@ -62,7 +61,7 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
info += ", ";
|
||||
}
|
||||
info += EnumChatFormatting.AQUA
|
||||
+ I18N.localise(Botany.instance, "ph.alkaline")
|
||||
+ I18N.localise("botany.ph.alkaline")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class ItemBotany extends Item {
|
||||
}
|
||||
IFlower individual = (IFlower) getIndividual(itemstack);
|
||||
if (individual == null) {
|
||||
tooltip.add(I18N.localise(Botany.instance, "item.tooltip.bugged"));
|
||||
tooltip.add(I18N.localise("botany.item.tooltip.bugged"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -89,19 +89,19 @@ public abstract class ItemBotany extends Item {
|
||||
IFlowerColor stemColor = genome.getStemColor();
|
||||
|
||||
if (primaryColor == secondColor) {
|
||||
tooltip.add(EnumChatFormatting.YELLOW + I18N.localise(Botany.instance, "item.tooltip.flowerColor1", primaryColor.getName(), stemColor.getName()));
|
||||
tooltip.add(EnumChatFormatting.YELLOW + I18N.localise("botany.item.tooltip.flowerColor1", primaryColor.getName(), stemColor.getName()));
|
||||
} else {
|
||||
tooltip.add(EnumChatFormatting.YELLOW + I18N.localise(Botany.instance, "item.tooltip.flowerColor2", primaryColor.getName(), secondColor.getName(), stemColor.getName()));
|
||||
tooltip.add(EnumChatFormatting.YELLOW + I18N.localise("botany.item.tooltip.flowerColor2", primaryColor.getName(), secondColor.getName(), stemColor.getName()));
|
||||
}
|
||||
|
||||
if (individual.isAnalyzed()) {
|
||||
if (BinnieCore.proxy.isShiftDown()) {
|
||||
individual.addTooltip(tooltip);
|
||||
} else {
|
||||
tooltip.add(EnumChatFormatting.GRAY + I18N.localise(Botany.instance, "item.tooltip.holdMore"));
|
||||
tooltip.add(EnumChatFormatting.GRAY + I18N.localise("botany.item.tooltip.holdMore"));
|
||||
}
|
||||
} else {
|
||||
tooltip.add(I18N.localise(Botany.instance, "item.tooltip.unknownGenome"));
|
||||
tooltip.add(I18N.localise("botany.item.tooltip.unknownGenome"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public abstract class ItemBotany extends Item {
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
if (!itemstack.hasTagCompound()) {
|
||||
return I18N.localise(Botany.instance, "item.tooltip.unknown");
|
||||
return I18N.localise("botany.item.tooltip.unknown");
|
||||
}
|
||||
|
||||
IIndividual individual = getIndividual(itemstack);
|
||||
@@ -126,9 +126,9 @@ public abstract class ItemBotany extends Item {
|
||||
if (tag == null || tag.isEmpty()) {
|
||||
return individual.getDisplayName();
|
||||
}
|
||||
return I18N.localise(Botany.instance, "item.botany.name", individual.getDisplayName(), tag);
|
||||
return I18N.localise("botany.item.botany.name", individual.getDisplayName(), tag);
|
||||
}
|
||||
return I18N.localise(Botany.instance, "item.flowerCorrupted.name");
|
||||
return I18N.localise("botany.item.flowerCorrupted.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ItemInsulatedTube extends Item {
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return Material.get(stack.getItemDamage()).getName() + " "
|
||||
+ I18N.localise(Botany.instance, "tube.name");
|
||||
+ I18N.localise("botany.tube.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -86,10 +86,10 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
enum Material {
|
||||
Copper(0xe3b78e, "tube.cooper"),
|
||||
Tin(0xe1eef4, "tube.tin"),
|
||||
Bronze(0xddc276, "tube.bronze"),
|
||||
Iron(0xd8d8d8, "tube.iron");
|
||||
Copper(0xe3b78e, "cooper"),
|
||||
Tin(0xe1eef4, "tin"),
|
||||
Bronze(0xddc276, "bronze"),
|
||||
Iron(0xd8d8d8, "iron");
|
||||
|
||||
protected int color;
|
||||
protected String name;
|
||||
@@ -108,17 +108,17 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise(Botany.instance, name);
|
||||
return I18N.localise("botany.tube." + name);
|
||||
}
|
||||
}
|
||||
|
||||
enum Insulate {
|
||||
Clay(0xa1aacc, "tube.insulate.clay"),
|
||||
Cobble(0x7b7b7b, "tube.insulate.cobblestone"),
|
||||
Sand(0xefeab5, "tube.insulate.sand"),
|
||||
HardenedClay(0x935c43, "tube.insulate.hardenedClay"),
|
||||
Stone(0x6d6d6d, "tube.insulate.smoothStone"),
|
||||
Sandstone(0xc1b989, "tube.insulate.sandstone");
|
||||
Clay(0xa1aacc, "clay"),
|
||||
Cobble(0x7b7b7b, "cobblestone"),
|
||||
Sand(0xefeab5, "sand"),
|
||||
HardenedClay(0x935c43, "hardenedClay"),
|
||||
Stone(0x6d6d6d, "smoothStone"),
|
||||
Sandstone(0xc1b989, "sandstone");
|
||||
|
||||
protected int color;
|
||||
protected String name;
|
||||
@@ -137,7 +137,7 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise(Botany.instance, name);
|
||||
return I18N.localise("botany.tube.insulate." + name);
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
@@ -16,6 +15,6 @@ public class ItemPollen extends ItemBotany {
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return I18N.localise(Botany.instance, "item.pollen.tag.name");
|
||||
return I18N.localise("botany.tube.item.pollen.tag.name");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
@@ -16,6 +15,6 @@ public class ItemSeed extends ItemBotany {
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return I18N.localise(Botany.instance, "item.germling.tag.name");
|
||||
return I18N.localise("botany.tube.item.germling.tag.name");
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ public class BlockPlant extends BlockBush {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise(Botany.instance, "plant." + name);
|
||||
return I18N.localise("botany.tube.plant." + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
@@ -38,12 +37,12 @@ public class ItemSoil extends ItemBlock {
|
||||
|
||||
if (moisture == EnumMoisture.DRY) {
|
||||
info += EnumChatFormatting.YELLOW
|
||||
+ I18N.localise(Botany.instance, "moisture.dry")
|
||||
+ I18N.localise("botany.tube.moisture.dry")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
if (moisture == EnumMoisture.DAMP) {
|
||||
info += EnumChatFormatting.YELLOW
|
||||
+ I18N.localise(Botany.instance, "moisture.damp")
|
||||
+ I18N.localise("botany.tube.moisture.damp")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
@@ -52,7 +51,7 @@ public class ItemSoil extends ItemBlock {
|
||||
info += ", ";
|
||||
}
|
||||
info += EnumChatFormatting.YELLOW
|
||||
+ I18N.localise(Botany.instance, "ph.acid")
|
||||
+ I18N.localise("botany.tube.ph.acid")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
@@ -61,7 +60,7 @@ public class ItemSoil extends ItemBlock {
|
||||
info += ", ";
|
||||
}
|
||||
info += EnumChatFormatting.YELLOW
|
||||
+ I18N.localise(Botany.instance, "ph.alkaline")
|
||||
+ I18N.localise("botany.tube.ph.alkaline")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
@@ -70,14 +69,14 @@ public class ItemSoil extends ItemBlock {
|
||||
}
|
||||
|
||||
if (noWeed) {
|
||||
tooltip.add(I18N.localise(Botany.instance, "soil.weedkiller"));
|
||||
tooltip.add(I18N.localise("botany.tube.soil.weedkiller"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
String soilName = type.name().toLowerCase(Locale.ENGLISH);
|
||||
return I18N.localise(Botany.instance, "soil." + soilName);
|
||||
return I18N.localise("botany.tube.soil." + soilName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,13 +42,12 @@ public class ItemSoilMeter extends Item {
|
||||
EnumMoisture moisture = soil.getMoisture(world, x, y, z);
|
||||
EnumAcidity pH = soil.getPH(world, x, y, z);
|
||||
|
||||
// TODO remove hardcoded strings ans localize
|
||||
EnumChatFormatting[] colors = new EnumChatFormatting[]{
|
||||
EnumChatFormatting.DARK_GRAY,
|
||||
EnumChatFormatting.GOLD,
|
||||
EnumChatFormatting.LIGHT_PURPLE,
|
||||
};
|
||||
String info = "Type: ";
|
||||
String info = I18N.localise("botany.soil.tooltip.type") + " ";
|
||||
info += colors[type.ordinal()] + AlleleHelper.toDisplay(type) + EnumChatFormatting.RESET;
|
||||
|
||||
colors = new EnumChatFormatting[]{
|
||||
@@ -56,7 +55,7 @@ public class ItemSoilMeter extends Item {
|
||||
EnumChatFormatting.GRAY,
|
||||
EnumChatFormatting.BLUE,
|
||||
};
|
||||
info += ", Moisture: ";
|
||||
info += ", " + I18N.localise("botany.soil.tooltip.moisture") + " ";
|
||||
info += colors[moisture.ordinal()] + AlleleHelper.toDisplay(moisture) + EnumChatFormatting.RESET;
|
||||
|
||||
colors = new EnumChatFormatting[]{
|
||||
@@ -64,7 +63,7 @@ public class ItemSoilMeter extends Item {
|
||||
EnumChatFormatting.GREEN,
|
||||
EnumChatFormatting.AQUA,
|
||||
};
|
||||
info += ", pH: ";
|
||||
info += ", " + I18N.localise("botany.soil.tooltip.pH") + " ";
|
||||
info += colors[pH.ordinal()] + AlleleHelper.toDisplay(pH) + EnumChatFormatting.RESET;
|
||||
IChatComponent chat = new ChatComponentText(info);
|
||||
player.addChatMessage(chat);
|
||||
@@ -80,6 +79,6 @@ public class ItemSoilMeter extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return I18N.localise(Botany.instance, "item.soilMeter.name");
|
||||
return I18N.localise("botany.tube.item.soilMeter.name");
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.api.IAlleleFlowerEffect;
|
||||
import binnie.botany.api.IFlowerGenome;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import net.minecraft.world.World;
|
||||
@@ -30,7 +29,7 @@ public class AlleleEffectNone implements IAlleleFlowerEffect {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise(BinnieCore.instance, "allele.none");
|
||||
return I18N.localise("botany.tube.allele.none");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.IAlleleInteger;
|
||||
|
||||
import java.util.Locale;
|
||||
@@ -2948,6 +2948,6 @@ public enum EnumFlowerColor implements IFlowerColor {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return Botany.proxy.localise("colour." + name.toLowerCase(Locale.ENGLISH));
|
||||
return I18N.localise("botany.colour." + name.toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
import binnie.botany.api.IColourMix;
|
||||
@@ -58,14 +57,14 @@ public class Flower extends Individual implements IFlower {
|
||||
IAlleleFlowerSpecies primary = genome.getPrimary();
|
||||
IAlleleFlowerSpecies secondary = genome.getSecondary();
|
||||
if (!isPureBred(EnumFlowerChromosome.SPECIES)) {
|
||||
list.add(EnumChatFormatting.BLUE + I18N.localise(Botany.instance, "item.tooltip.hybrid", primary.getName(), secondary.getName()));
|
||||
list.add(EnumChatFormatting.BLUE + I18N.localise("botany.item.tooltip.hybrid", primary.getName(), secondary.getName()));
|
||||
}
|
||||
|
||||
list.add(EnumChatFormatting.GRAY + I18N.localise(Botany.instance, "item.tooltip.age", getAge()));
|
||||
list.add(EnumChatFormatting.GREEN + I18N.localise(Botany.instance, "item.tooltip.temperature", AlleleHelper.toDisplay(primary.getTemperature()), AlleleHelper.toDisplay(genome.getToleranceTemperature())));
|
||||
list.add(EnumChatFormatting.GREEN + I18N.localise(Botany.instance, "item.tooltip.moisture", AlleleHelper.toDisplay(primary.getMoisture()), AlleleHelper.toDisplay(genome.getToleranceMoisture())));
|
||||
list.add(EnumChatFormatting.GREEN + I18N.localise(Botany.instance, "item.tooltip.pH", AlleleHelper.toDisplay(primary.getHumidity()), AlleleHelper.toDisplay(genome.getTolerancePH())));
|
||||
list.add(EnumChatFormatting.GRAY + I18N.localise(Botany.instance, "item.tooltip.fertility", genome.getFertility()));
|
||||
list.add(EnumChatFormatting.GRAY + I18N.localise("botany.item.tooltip.age", getAge()));
|
||||
list.add(EnumChatFormatting.GREEN + I18N.localise("botany.item.tooltip.temperature", AlleleHelper.toDisplay(primary.getTemperature()), AlleleHelper.toDisplay(genome.getToleranceTemperature())));
|
||||
list.add(EnumChatFormatting.GREEN + I18N.localise("botany.item.tooltip.moisture", AlleleHelper.toDisplay(primary.getMoisture()), AlleleHelper.toDisplay(genome.getToleranceMoisture())));
|
||||
list.add(EnumChatFormatting.GREEN + I18N.localise("botany.item.tooltip.pH", AlleleHelper.toDisplay(primary.getHumidity()), AlleleHelper.toDisplay(genome.getTolerancePH())));
|
||||
list.add(EnumChatFormatting.GRAY + I18N.localise("botany.item.tooltip.fertility", genome.getFertility()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
@@ -521,7 +520,7 @@ public enum FlowerSpecies implements IAlleleFlowerSpecies {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise(Botany.instance, "flower." + name);
|
||||
return I18N.localise("botany.tube.flower." + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ItemDictionary extends Item {
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return (stack.getItemDamage() == 0)
|
||||
? I18N.localise(Botany.instance, "item.botanistDatabase.0.name")
|
||||
: I18N.localise(Botany.instance, "item.botanistDatabase.1.name");
|
||||
? I18N.localise("botany.tube.item.botanistDatabase.0.name")
|
||||
: I18N.localise("botany.tube.item.botanistDatabase.1.name");
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public enum BotanyItems implements IItemMisc {
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return I18N.localise(Botany.instance, "item." + name + ".name");
|
||||
return I18N.localise("botany.tube.item." + name + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ItemClay extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return I18N.localise(Botany.instance, "item.clay.name");
|
||||
return I18N.localise("botany.tube.item.clay.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -67,12 +67,12 @@ public class ItemFieldKit extends Item {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
int i = getMaxDamage() - itemStack.getItemDamage();
|
||||
if (i == 0) {
|
||||
tooltip.add(I18N.localise(Botany.instance, "item.fieldKit.tooltip.noPaper"));
|
||||
tooltip.add(I18N.localise("botany.item.fieldKit.tooltip.noPaper"));
|
||||
} else {
|
||||
if (i > 1) {
|
||||
tooltip.add(I18N.localise(Botany.instance, "item.fieldKit.tooltip.sheetsOfPaper", i));
|
||||
tooltip.add(I18N.localise("botany.item.fieldKit.tooltip.sheetsOfPaper", i));
|
||||
} else {
|
||||
tooltip.add(I18N.localise(Botany.instance, "item.fieldKit.tooltip.sheetOfPaper", i));
|
||||
tooltip.add(I18N.localise("botany.item.fieldKit.tooltip.sheetOfPaper", i));
|
||||
}
|
||||
}
|
||||
super.addInformation(itemStack, player, tooltip, advanced);
|
||||
@@ -80,6 +80,6 @@ public class ItemFieldKit extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return I18N.localise(Botany.instance, "item.fieldKit.name");
|
||||
return I18N.localise("botany.item.fieldKit.name");
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class ItemPigment extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return I18N.localise(Botany.instance, "item.pigment.name");
|
||||
return I18N.localise("botany.tube.item.pigment.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,12 +24,12 @@ public class BinnieCircuitLayout implements ICircuitLayout {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise(mod, "circuit.layout." + uid.toLowerCase());
|
||||
return I18N.localise(mod.getModID() + ".circuit.layout." + uid.toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsage() {
|
||||
return I18N.localise(mod, "circuit.layout." + uid.toLowerCase() + ".usage");
|
||||
return I18N.localise(mod.getModID() + ".circuit.layout." + uid.toLowerCase() + ".usage");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -76,7 +76,7 @@ public class WindowFieldKit extends Window {
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.fieldKit");
|
||||
return I18N.localise("binniecore.gui.fieldKit");
|
||||
}
|
||||
|
||||
private void setupValidators() {
|
||||
@@ -89,7 +89,7 @@ public class WindowFieldKit extends Window {
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.tooltip.individual");
|
||||
return I18N.localise("binniecore.gui.tooltip.individual");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -101,7 +101,7 @@ public class WindowFieldKit extends Window {
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.tooltip.paper");
|
||||
return I18N.localise("binniecore.gui.tooltip.paper");
|
||||
}
|
||||
});
|
||||
getWindowInventory().disableAutoDispense(1);
|
||||
@@ -119,8 +119,8 @@ public class WindowFieldKit extends Window {
|
||||
GlassControl = new ControlImage(this, handGlass.x(), handGlass.y(), new StandardTexture(0, 160, 96, 96, ExtraBeeTexture.GUIPunnett));
|
||||
new ControlSlot(this, handGlass.x() + 54.0f, handGlass.y() + 26.0f).assign(InventoryType.Window, 0);
|
||||
new ControlSlot(this, 208.0f, 8.0f).assign(InventoryType.Window, 1);
|
||||
(text = new ControlText(this, new IPoint(232.0f, 13.0f), I18N.localise(BinnieCore.instance, "gui.tooltip.paper"))).setColor(0x222222);
|
||||
(text = new ControlText(this, new IArea(0.0f, 120.0f, w(), 24.0f), "", TextJustification.MiddleCenter)).setColor(0x222222);
|
||||
(text = new ControlText(this, new IPoint(232.0f, 13.0f), I18N.localise("binniecore.gui.tooltip.paper"))).setColor(0x222222);
|
||||
(text = new ControlText(this, new IArea(0.0f, 120.0f, w(), 24.0f), "", TextJustification.MIDDLE_CENTER)).setColor(0x222222);
|
||||
chromo = new ControlChromosome(this, 150.0f, 24.0f);
|
||||
|
||||
addEventHandler(new EventValueChanged.Handler() {
|
||||
@@ -230,7 +230,7 @@ public class WindowFieldKit extends Window {
|
||||
|
||||
if (item != null && !Analyser.isAnalysed(item)) {
|
||||
if (getWindowInventory().getStackInSlot(1) == null) {
|
||||
text.setValue(I18N.localise(BinnieCore.instance, "gui.tooltip.noPaper"));
|
||||
text.setValue(I18N.localise("binniecore.gui.tooltip.noPaper"));
|
||||
isAnalysing = false;
|
||||
analyseProgress = 1.0f;
|
||||
} else {
|
||||
@@ -264,7 +264,7 @@ public class WindowFieldKit extends Window {
|
||||
|
||||
@Override
|
||||
public String showInfoButton() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.fieldKit.info");
|
||||
return I18N.localise("binniecore.gui.fieldKit.info");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,7 +56,7 @@ public class WindowGenesis extends Window {
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.genesis");
|
||||
return I18N.localise("binniecore.gui.genesis");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ControlButton extends Control {
|
||||
public ControlButton(IWidget parent, float x, float y, float width, float height, String text) {
|
||||
this(parent, x, y, width, height);
|
||||
this.text = text;
|
||||
textWidget = new ControlText(this, getArea(), text, TextJustification.MiddleCenter);
|
||||
textWidget = new ControlText(this, getArea(), text, TextJustification.MIDDLE_CENTER);
|
||||
}
|
||||
|
||||
private EventMouse.Down.Handler mouseHandler = new EventMouse.Down.Handler() {
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ControlCheckbox extends Control implements IControlValue<Boolean> {
|
||||
this.text = text;
|
||||
value = bool;
|
||||
if (w > 16.0f) {
|
||||
new ControlText(this, new IArea(16.0f, 1.0f, w - 16.0f, 16.0f), text, TextJustification.MiddleCenter).setColor(4473924);
|
||||
new ControlText(this, new IArea(16.0f, 1.0f, w - 16.0f, 16.0f), text, TextJustification.MIDDLE_CENTER).setColor(4473924);
|
||||
}
|
||||
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class ControlText extends Control implements IControlValue<String> {
|
||||
private TextJustification align;
|
||||
|
||||
public ControlText(IWidget parent, IPoint pos, String text) {
|
||||
this(parent, new IArea(pos, new IPoint(500.0f, 0.0f)), text, TextJustification.TopLeft);
|
||||
this(parent, new IArea(pos, new IPoint(500.0f, 0.0f)), text, TextJustification.TOP_LEFT);
|
||||
}
|
||||
|
||||
public ControlText(IWidget parent, String text, TextJustification align) {
|
||||
|
||||
@@ -7,6 +7,6 @@ import binnie.core.craftgui.geometry.TextJustification;
|
||||
|
||||
public class ControlTextCentered extends ControlText {
|
||||
public ControlTextCentered(IWidget parent, float y, String text) {
|
||||
super(parent, new IArea(new IPoint(0.0f, y), new IPoint(parent.size().x(), 0.0f)), text, TextJustification.TopCenter);
|
||||
super(parent, new IArea(new IPoint(0.0f, y), new IPoint(parent.size().x(), 0.0f)), text, TextJustification.TOP_CENTER);
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ public class ControlTextOption<T> extends ControlOption<T> {
|
||||
public ControlTextOption(ControlList<T> controlList, T option, String optionName, int y) {
|
||||
super(controlList, option, y);
|
||||
textWidget = null;
|
||||
textWidget = new ControlText(this, getArea(), optionName, TextJustification.MiddleCenter);
|
||||
textWidget = new ControlText(this, getArea(), optionName, TextJustification.MIDDLE_CENTER);
|
||||
|
||||
mouseHandler.setOrigin(EventHandler.Origin.Self, this);
|
||||
addEventHandler(mouseHandler);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
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;
|
||||
@@ -34,11 +33,14 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
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()));
|
||||
GameProfile username = Window.get(this).getUsername();
|
||||
Window window = Window.get(this);
|
||||
GameProfile username = window.getUsername();
|
||||
|
||||
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 = system.isSpeciesDiscovered(species, window.getWorld(), username)
|
||||
? EnumDiscoveryState.DISCOVERED
|
||||
: EnumDiscoveryState.UNDISCOVERED;
|
||||
} else if (window instanceof WindowAbstractDatabase && ((WindowAbstractDatabase) window).isNEI) {
|
||||
state = EnumDiscoveryState.SHOW;
|
||||
}
|
||||
|
||||
@@ -95,11 +97,11 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
break;
|
||||
|
||||
case DISCOVERED:
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.discovered.discovered"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.database.discovered.discovered"));
|
||||
break;
|
||||
|
||||
case UNDISCOVERED:
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.discovered.undiscovered"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.database.discovered.undiscovered"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,39 +8,43 @@ import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IMutation;
|
||||
|
||||
class ControlMutationItem extends ControlOption<IMutation> {
|
||||
private ControlDatabaseIndividualDisplay itemWidget1;
|
||||
private ControlDatabaseIndividualDisplay itemWidget2;
|
||||
private ControlDatabaseIndividualDisplay itemWidget3;
|
||||
private ControlMutationSymbol addSymbol;
|
||||
private ControlMutationSymbol arrowSymbol;
|
||||
|
||||
public ControlMutationItem(ControlList<IMutation> controlList, IMutation option, IAlleleSpecies species, int y) {
|
||||
super(controlList, option, y);
|
||||
itemWidget1 = new ControlDatabaseIndividualDisplay(this, 4.0f, 4.0f);
|
||||
itemWidget2 = new ControlDatabaseIndividualDisplay(this, 44.0f, 4.0f);
|
||||
itemWidget3 = new ControlDatabaseIndividualDisplay(this, 104.0f, 4.0f);
|
||||
addSymbol = new ControlMutationSymbol(this, 24, 4, 0);
|
||||
arrowSymbol = new ControlMutationSymbol(this, 64, 4, 1);
|
||||
ControlDatabaseIndividualDisplay itemWidget1 = new ControlDatabaseIndividualDisplay(this, 4.0f, 4.0f);
|
||||
ControlDatabaseIndividualDisplay itemWidget2 = new ControlDatabaseIndividualDisplay(this, 44.0f, 4.0f);
|
||||
ControlDatabaseIndividualDisplay itemWidget3 = new ControlDatabaseIndividualDisplay(this, 104.0f, 4.0f);
|
||||
ControlMutationSymbol addSymbol = new ControlMutationSymbol(this, 24, 4, 0);
|
||||
ControlMutationSymbol arrowSymbol = new ControlMutationSymbol(this, 64, 4, 1);
|
||||
boolean isNEI = ((WindowAbstractDatabase) getSuperParent()).isNEI();
|
||||
BreedingSystem system = ((WindowAbstractDatabase) getSuperParent()).getBreedingSystem();
|
||||
Window window = Window.get(this);
|
||||
|
||||
if (getValue() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean isMutationDiscovered = system.isMutationDiscovered(getValue(), Window.get(this).getWorld(), Window.get(this).getUsername());
|
||||
boolean isMutationDiscovered = system.isMutationDiscovered(getValue(), window.getWorld(), window.getUsername());
|
||||
IAlleleSpecies allele;
|
||||
EnumDiscoveryState state;
|
||||
allele = getValue().getAllele0();
|
||||
state = ((isNEI || isMutationDiscovered) ? EnumDiscoveryState.SHOW : ((species == allele) ? EnumDiscoveryState.SHOW : EnumDiscoveryState.UNDETERMINED));
|
||||
state = getState(isNEI, isMutationDiscovered, species, allele);
|
||||
itemWidget1.setSpecies(allele, state);
|
||||
|
||||
allele = getValue().getAllele1();
|
||||
state = ((isNEI || isMutationDiscovered) ? EnumDiscoveryState.SHOW : ((species == allele) ? EnumDiscoveryState.SHOW : EnumDiscoveryState.UNDETERMINED));
|
||||
state = getState(isNEI, isMutationDiscovered, species, allele);
|
||||
itemWidget2.setSpecies(allele, state);
|
||||
|
||||
allele = (IAlleleSpecies) getValue().getTemplate()[0];
|
||||
state = ((isNEI || isMutationDiscovered) ? EnumDiscoveryState.SHOW : ((species == allele) ? EnumDiscoveryState.SHOW : EnumDiscoveryState.UNDETERMINED));
|
||||
state = getState(isNEI, isMutationDiscovered, species, allele);
|
||||
itemWidget3.setSpecies(allele, state);
|
||||
|
||||
addSymbol.setValue(getValue());
|
||||
arrowSymbol.setValue(getValue());
|
||||
}
|
||||
|
||||
private EnumDiscoveryState getState(boolean isNEI, boolean isMutationDiscovered, IAlleleSpecies species, IAlleleSpecies allele) {
|
||||
return (isNEI || isMutationDiscovered || species == allele)
|
||||
? EnumDiscoveryState.SHOW
|
||||
: EnumDiscoveryState.UNDETERMINED;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
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;
|
||||
@@ -25,7 +24,7 @@ class ControlSpeciesBoxOption extends ControlTextOption<IAlleleSpecies> {
|
||||
textWidget.setValue(option.getName());
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
} else {
|
||||
textWidget.setValue(I18N.localise(BinnieCore.instance, "gui.database.discovered.undiscovered"));
|
||||
textWidget.setValue(I18N.localise("binniecore.gui.database.discovered.undiscovered"));
|
||||
}
|
||||
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
|
||||
|
||||
@@ -16,11 +16,11 @@ public class DatabaseTab implements ITooltipHelp {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return I18N.localise(mod, "gui.database.tab." + unloc);
|
||||
return I18N.localise(mod.getModID() + ".gui.database.tab." + unloc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHelpTooltip(Tooltip tooltip) {
|
||||
tooltip.add(I18N.localiseOrBlank(mod, "gui.database.tab." + unloc + ".help"));
|
||||
tooltip.add(I18N.localiseOrBlank(mod.getModID() + ".gui.database.tab." + unloc + ".help"));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
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;
|
||||
@@ -28,19 +27,20 @@ public class PageBranchOverview extends PageBranch {
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IClassification branch) {
|
||||
String name = I18N.localise(branch.getName());
|
||||
branchName.setValue(
|
||||
EnumChatFormatting.BOLD
|
||||
+ I18N.localise(BinnieCore.instance, "gui.database.branch.name", branch.getName())
|
||||
+ I18N.localise("binniecore.gui.database.branch.name", name)
|
||||
+ EnumChatFormatting.RESET
|
||||
);
|
||||
branchScientific.setValue(
|
||||
EnumChatFormatting.ITALIC
|
||||
+ I18N.localise(BinnieCore.instance, "gui.database.branch.apidae", branch.getScientific())
|
||||
+ I18N.localise("binniecore.gui.database.branch.apidae", branch.getScientific())
|
||||
+ EnumChatFormatting.RESET
|
||||
);
|
||||
branchAuthority.setValue(
|
||||
EnumChatFormatting.BOLD
|
||||
+ I18N.localise(BinnieCore.instance, "gui.database.branch.discoveredBy", branch.getMemberSpecies()[0].getAuthority())
|
||||
+ I18N.localise("binniecore.gui.database.branch.discoveredBy", branch.getMemberSpecies()[0].getAuthority())
|
||||
+ EnumChatFormatting.RESET);
|
||||
|
||||
for (IWidget widget : branchDescription) {
|
||||
@@ -49,8 +49,8 @@ public class PageBranchOverview extends PageBranch {
|
||||
|
||||
branchDescription.clear();
|
||||
String desc = branch.getDescription();
|
||||
if (desc == null || desc.isEmpty()) {
|
||||
desc = I18N.localise(BinnieCore.instance, "gui.database.branch.noDesc");
|
||||
if (desc.contains("for.genus.bees.")) { // unlocalized
|
||||
desc = I18N.localise("binniecore.gui.database.branch.noDesc");
|
||||
}
|
||||
|
||||
StringBuilder line = new StringBuilder();
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
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;
|
||||
@@ -11,7 +9,6 @@ import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IClassification;
|
||||
|
||||
public class PageBranchSpecies extends PageBranch {
|
||||
private ControlText title;
|
||||
private ControlSpeciesBox speciesList;
|
||||
|
||||
@Mod.EventHandler
|
||||
@@ -21,7 +18,7 @@ public class PageBranchSpecies extends PageBranch {
|
||||
|
||||
public PageBranchSpecies(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
title = new ControlTextCentered(this, 8.0f, I18N.localise(BinnieCore.instance, "gui.database.species"));
|
||||
new ControlTextCentered(this, 8.0f, I18N.localise("binniecore.gui.database.species"));
|
||||
addEventHandler(new ValueHandler());
|
||||
speciesList = new ControlSpeciesBox(this, 4.0f, 20.0f, 136.0f, 152.0f);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
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;
|
||||
@@ -27,16 +26,16 @@ public class PageBreeder extends ControlPage<DatabaseTab> {
|
||||
BreedingSystem system = ((WindowAbstractDatabase) Window.get(this)).getBreedingSystem();
|
||||
new ControlTextCentered(this, 8.0f,
|
||||
EnumChatFormatting.BOLD
|
||||
+ I18N.localise(BinnieCore.instance, "gui.database.descriptor", system.getDescriptor())
|
||||
+ I18N.localise("binniecore.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 ControlTextCentered(this, 75.0f, I18N.localise("binniecore.gui.database.species.count", system.discoveredSpeciesCount, system.totalSpeciesCount));
|
||||
new ControlBreedingProgress(this, 20, 87, 102, 14, system, system.discoveredSpeciesPercentage);
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise(BinnieCore.instance, "gui.database.branches.count", system.discoveredBranchCount, system.totalBranchCount));
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise("binniecore.gui.database.branch.count", system.discoveredBranchCount, system.totalBranchCount));
|
||||
new ControlBreedingProgress(this, 20, 127, 102, 14, system, system.discoveredBranchPercentage);
|
||||
|
||||
if (system.discoveredSecretCount > 0) {
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise(BinnieCore.instance, "gui.database.species.secretCount", system.discoveredSecretCount, system.totalSecretCount));
|
||||
new ControlTextCentered(this, 75.0f, I18N.localise("binniecore.gui.database.species.secretCount", system.discoveredSecretCount, system.totalSecretCount));
|
||||
}
|
||||
|
||||
new ControlTextCentered(this, 32.0f, player.getName());
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
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 furtherTitle;
|
||||
private ControlMutationBox furtherList;
|
||||
private ControlMutationBox list;
|
||||
|
||||
public PageSpeciesMutations(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
furtherTitle = new ControlTextCentered(this, 8.0f, I18N.localise(BinnieCore.instance, "gui.database.furtherMutations"));
|
||||
furtherList = new ControlMutationBox(this, 4, 20, 136, 152, ControlMutationBox.Type.FURTHER);
|
||||
new ControlTextCentered(this, 8.0f, I18N.localise("binniecore.gui.database.furtherMutations"));
|
||||
list = new ControlMutationBox(this, 4, 20, 136, 152, ControlMutationBox.Type.FURTHER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
furtherList.setSpecies(species);
|
||||
list.setSpecies(species);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
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;
|
||||
@@ -30,15 +29,18 @@ public class PageSpeciesOverview extends PageSpecies {
|
||||
controlScientific = new ControlTextCentered(this, 32.0f, "");
|
||||
controlAuthority = new ControlTextCentered(this, 44.0f, "");
|
||||
controlComplexity = new ControlTextCentered(this, 56.0f, "");
|
||||
controlDescription = new ControlText(this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.MiddleCenter);
|
||||
controlSignature = new ControlText(this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.BottomRight);
|
||||
controlDescription = new ControlText(this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.MIDDLE_CENTER);
|
||||
controlSignature = new ControlText(this, new IArea(8.0f, 84.0f, getSize().x() - 16.0f, 0.0f), "", TextJustification.BOTTOM_RIGHT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
controlInd1.setSpecies(species, EnumDiscoveryState.SHOW);
|
||||
controlInd2.setSpecies(species, EnumDiscoveryState.SHOW);
|
||||
String branchBinomial = (species.getBranch() != null) ? species.getBranch().getScientific() : "<Unknown>";
|
||||
String branchBinomial = (species.getBranch() != null)
|
||||
? species.getBranch().getScientific()
|
||||
: "<Unknown>";
|
||||
|
||||
controlName.setValue(EnumChatFormatting.BOLD + species.getName() + EnumChatFormatting.RESET);
|
||||
controlScientific.setValue(EnumChatFormatting.ITALIC + branchBinomial + " " + species.getBinomial() + EnumChatFormatting.RESET);
|
||||
controlAuthority.setValue(EnumChatFormatting.BOLD + "Discovered by " + species.getAuthority() + EnumChatFormatting.RESET);
|
||||
@@ -48,7 +50,7 @@ public class PageSpeciesOverview extends PageSpecies {
|
||||
String descSig = "";
|
||||
|
||||
if (desc == null || desc.isEmpty()) {
|
||||
descBody += I18N.localise(BinnieCore.instance, "gui.database.species.noDesc");
|
||||
descBody += I18N.localise("binniecore.gui.database.species.noDesc");
|
||||
} else {
|
||||
String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
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 title;
|
||||
private ControlMutationBox list;
|
||||
|
||||
public PageSpeciesResultant(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
title = new ControlTextCentered(this, 8.0f, I18N.localise(BinnieCore.instance, "gui.database.resultantMutations"));
|
||||
new ControlTextCentered(this, 8.0f, I18N.localise("binniecore.gui.database.resultantMutations"));
|
||||
list = new ControlMutationBox(this, 4, 20, 136, 152, ControlMutationBox.Type.RESULTANT);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlTextEdit;
|
||||
import binnie.core.craftgui.controls.listbox.ControlListBox;
|
||||
@@ -21,6 +20,7 @@ import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.craftgui.minecraft.control.ControlHelp;
|
||||
import binnie.core.craftgui.window.Panel;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.core.util.IValidator;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -228,7 +228,7 @@ public abstract class WindowAbstractDatabase extends Window {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return BinnieCore.proxy.localise("gui.database.mode." + name().toLowerCase());
|
||||
return I18N.localise("binniecore.gui.database.mode." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +250,6 @@ public abstract class WindowAbstractDatabase extends Window {
|
||||
CraftGUIUtil.alignToWidget(infoPages = new ControlPages<>(modePage, 0.0f, 0.0f, 144.0f, 176.0f), database.panelInformation);
|
||||
}
|
||||
|
||||
public abstract void createListBox(IArea p0);
|
||||
public abstract void createListBox(IArea area);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public class CraftGUIUtil {
|
||||
}
|
||||
|
||||
public static void horizontalGrid(float px, float py, IWidget... widgets) {
|
||||
horizontalGrid(px, py, TextJustification.MiddleCenter, 0.0f, widgets);
|
||||
horizontalGrid(px, py, TextJustification.MIDDLE_CENTER, 0.0f, widgets);
|
||||
}
|
||||
|
||||
public static void horizontalGrid(float px, float py, TextJustification just, float spacing, IWidget... widgets) {
|
||||
@@ -32,7 +32,7 @@ public class CraftGUIUtil {
|
||||
}
|
||||
|
||||
public static void verticalGrid(float px, float py, IWidget... widgets) {
|
||||
horizontalGrid(px, py, TextJustification.MiddleCenter, 0.0f, widgets);
|
||||
horizontalGrid(px, py, TextJustification.MIDDLE_CENTER, 0.0f, widgets);
|
||||
}
|
||||
|
||||
public static void verticalGrid(float px, float py, TextJustification just, float spacing, IWidget... widgets) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package binnie.core.craftgui.geometry;
|
||||
|
||||
public enum TextJustification {
|
||||
TopLeft(0.0f, 0.0f),
|
||||
TopCenter(0.5f, 0.0f),
|
||||
TopRight(1.0f, 0.0f),
|
||||
MiddleLeft(0.0f, 0.5f),
|
||||
MiddleCenter(0.5f, 0.5f),
|
||||
MiddleRight(1.0f, 0.5f),
|
||||
BottomLeft(0.0f, 1.0f),
|
||||
BottomCenter(0.5f, 1.0f),
|
||||
BottomRight(1.0f, 1.0f);
|
||||
TOP_LEFT(0.0f, 0.0f),
|
||||
TOP_CENTER(0.5f, 0.0f),
|
||||
TOP_RIGHT(1.0f, 0.0f),
|
||||
MIDDLE_LEFT(0.0f, 0.5f),
|
||||
MIDDLE_CENTER(0.5f, 0.5f),
|
||||
MIDDLE_RIGHT(1.0f, 0.5f),
|
||||
BOTTOM_LEFT(0.0f, 1.0f),
|
||||
BOTTOM_CENTER(0.5f, 1.0f),
|
||||
BOTTOM_RIGHT(1.0f, 1.0f);
|
||||
|
||||
protected float xOffset;
|
||||
protected float yOffset;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -32,6 +31,7 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public IPoweredMachine getClientPower() {
|
||||
IInventory inventory = Window.get(this).getInventory();
|
||||
TileEntityMachine machine = (inventory instanceof TileEntityMachine) ? (TileEntityMachine) inventory : null;
|
||||
@@ -67,19 +67,19 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.chargedPower", (int) getPercentage()));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.powerInfo", getStoredEnergy(), getMaxEnergy()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.chargedPower", (int) getPercentage()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.powerInfo", getStoredEnergy(), getMaxEnergy()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHelpTooltip(Tooltip tooltip) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.powerBar"));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.currentPower", getStoredEnergy(), (int) getPercentage()));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.capacityPower", getMaxEnergy()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.powerBar"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.currentPower", getStoredEnergy(), (int) getPercentage()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.capacityPower", getMaxEnergy()));
|
||||
|
||||
IProcess process = Machine.getInterface(IProcess.class, Window.get(this).getInventory());
|
||||
if (process != null) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.usagePower", (int) process.getEnergyPerTick()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.usagePower", (int) process.getEnergyPerTick()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -24,10 +23,10 @@ public class ControlHelp extends Control implements ITooltip {
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
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"));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.help.2"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.help"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.help.0"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.help.1"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.help.2"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -27,7 +26,7 @@ public class ControlInfo extends Control implements ITooltip {
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.INFORMATION);
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.info"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.info"));
|
||||
tooltip.add(info);
|
||||
tooltip.setMaxWidth(200);
|
||||
}
|
||||
|
||||
@@ -144,32 +144,32 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
|
||||
TankSlot slot = getTankSlot();
|
||||
tooltip.add(slot.getName());
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.capacity", getTankCapacity()));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.insertSide", MachineSide.asString(slot.getInputSides())));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.extractSide", MachineSide.asString(slot.getOutputSides())));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.tank.capacity", getTankCapacity()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.tank.insertSide", MachineSide.asString(slot.getInputSides())));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.tank.extractSide", MachineSide.asString(slot.getOutputSides())));
|
||||
|
||||
if (slot.isReadOnly()) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.outputOnlyTank"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.tank.outputOnlyTank"));
|
||||
}
|
||||
|
||||
if (slot.getValidator() == null) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.acceptsAny"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.tank.acceptsAny"));
|
||||
} else {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.accepts", slot.getValidator().getTooltip()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.tank.accepts", slot.getValidator().getTooltip()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (!isTankValid()) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.empty"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.tank.empty"));
|
||||
return;
|
||||
}
|
||||
|
||||
int percentage = (int) (100.0 * getTank().getAmount() / getTankCapacity());
|
||||
tooltip.add(getTank().getName());
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.full", percentage));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.amount", (int) getTank().getAmount()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.tank.full", percentage));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.tank.amount", (int) getTank().getAmount()));
|
||||
}
|
||||
|
||||
private TankSlot getTankSlot() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -28,8 +27,8 @@ public class ControlPowerSystem extends Control implements ITooltip {
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
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.add(I18N.localise("binniecore.gui.tooltip.powerSupply"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.poweredBy", system.getUnitName()));
|
||||
tooltip.setMaxWidth(200);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
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;
|
||||
@@ -31,9 +30,9 @@ public class ControlProgressBase extends Control {
|
||||
String ts = "";
|
||||
if (minutes > 0) {
|
||||
if (minutes == 1) {
|
||||
ts += I18N.localise(BinnieCore.instance, "gui.database.time.minute");
|
||||
ts += I18N.localise("binniecore.gui.database.time.minute");
|
||||
} else {
|
||||
ts += I18N.localise(BinnieCore.instance, "gui.database.time.minutes", minutes);
|
||||
ts += I18N.localise("binniecore.gui.database.time.minutes", minutes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,9 +41,9 @@ public class ControlProgressBase extends Control {
|
||||
ts += " ";
|
||||
}
|
||||
if (seconds == 1) {
|
||||
ts += I18N.localise(BinnieCore.instance, "gui.database.time.second");
|
||||
ts += I18N.localise("binniecore.gui.database.time.second");
|
||||
} else {
|
||||
ts += I18N.localise(BinnieCore.instance, "gui.database.time.seconds", seconds);
|
||||
ts += I18N.localise("binniecore.gui.database.time.seconds", seconds);
|
||||
}
|
||||
}
|
||||
return ts;
|
||||
@@ -79,22 +78,22 @@ public class ControlProgressBase extends Control {
|
||||
return;
|
||||
}
|
||||
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.time.progress"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.database.time.progress"));
|
||||
|
||||
if (progress == 0.0f) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.time.notInProgress"));
|
||||
tooltip.add(I18N.localise("binniecore.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"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.database.time.inProgress"));
|
||||
}
|
||||
|
||||
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));
|
||||
tooltip.add(I18N.localise("binniecore.gui.database.time.left", convertTime((int) ((1.0f - progress) * process.getProcessTime()))));
|
||||
tooltip.add(I18N.localise("binniecore.gui.database.time.total", convertTime(process.getProcessTime())));
|
||||
tooltip.add(I18N.localise("binniecore.gui.database.energyCost.0", process.getProcessEnergy() * 10));
|
||||
} else {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.database.energyCost.1", process.getEnergyPerTick() * 10.0f));
|
||||
tooltip.add(I18N.localise("binniecore.gui.database.energyCost.1", process.getEnergyPerTick() * 10.0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class ControlSlide extends Control {
|
||||
if (anchor.y() > 0) {
|
||||
GL11.glTranslatef(0.0f, -lh, 0.0f);
|
||||
}
|
||||
CraftGUI.Render.text(labelArea, TextJustification.MiddleCenter, label, 16777215);
|
||||
CraftGUI.Render.text(labelArea, TextJustification.MIDDLE_CENTER, label, 16777215);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
@@ -190,27 +189,27 @@ public class ControlSlot extends ControlSlotBase {
|
||||
InventorySlot slot = getInventorySlot();
|
||||
if (getInventorySlot() != null) {
|
||||
tooltip.add(slot.getName());
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.side.insertSide", MachineSide.asString(slot.getInputSides())));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.side.extractSide", MachineSide.asString(slot.getOutputSides())));
|
||||
tooltip.add(I18N.localise("binniecore.gui.side.insertSide", MachineSide.asString(slot.getInputSides())));
|
||||
tooltip.add(I18N.localise("binniecore.gui.side.extractSide", MachineSide.asString(slot.getOutputSides())));
|
||||
|
||||
if (slot.isReadOnly()) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.slot.pickupOnly"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.slot.pickupOnly"));
|
||||
}
|
||||
|
||||
if (slot.getValidator() == null) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.slot.accepts", I18N.localise(BinnieCore.instance, "gui.slot.anyItem")));
|
||||
tooltip.add(I18N.localise("binniecore.gui.slot.accepts", I18N.localise("binniecore.gui.slot.anyItem")));
|
||||
} else {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.slot.accepts", slot.getValidator().getTooltip()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.slot.accepts", slot.getValidator().getTooltip()));
|
||||
}
|
||||
} else if (this.slot.inventory instanceof WindowInventory) {
|
||||
SlotValidator s = ((WindowInventory) this.slot.inventory).getValidator(this.slot.getSlotIndex());
|
||||
if (s == null) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.slot.accepts", I18N.localise(BinnieCore.instance, "gui.slot.anyItem")));
|
||||
tooltip.add(I18N.localise("binniecore.gui.slot.accepts", I18N.localise("binniecore.gui.slot.anyItem")));
|
||||
} else {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.slot.accepts", s.getTooltip()));
|
||||
tooltip.add(I18N.localise("binniecore.gui.slot.accepts", s.getTooltip()));
|
||||
}
|
||||
} else if (this.slot.inventory instanceof InventoryPlayer) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.slot.playerInventory"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.slot.playerInventory"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -30,7 +29,7 @@ public class ControlUser extends Control implements ITooltip {
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.USER);
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.owner"));
|
||||
tooltip.add(I18N.localise("binniecore.gui.tooltip.owner"));
|
||||
|
||||
if (!username.isEmpty()) {
|
||||
tooltip.add(username);
|
||||
|
||||
@@ -126,7 +126,7 @@ public class Renderer {
|
||||
}
|
||||
|
||||
public void text(IPoint pos, String text, int colour) {
|
||||
text(new IArea(pos, new IPoint(500.0f, 500.0f)), TextJustification.TopLeft, text, colour);
|
||||
text(new IArea(pos, new IPoint(500.0f, 500.0f)), TextJustification.TOP_LEFT, text, colour);
|
||||
}
|
||||
|
||||
public void text(IArea area, TextJustification justification, String text, int colour) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
@@ -60,16 +59,16 @@ class BeeBreedingSystem extends BreedingSystem {
|
||||
public String getAlleleName(IChromosomeType chromosome, IAllele allele) {
|
||||
if (chromosome == EnumBeeChromosome.FERTILITY) {
|
||||
if (allele.getUID().contains("Low")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.fertility.low");
|
||||
return I18N.localise("binniecore.allele.fertility.low");
|
||||
}
|
||||
if (allele.getUID().contains("Normal")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.fertility.normal");
|
||||
return I18N.localise("binniecore.allele.fertility.normal");
|
||||
}
|
||||
if (allele.getUID().contains("High")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.fertility.high");
|
||||
return I18N.localise("binniecore.allele.fertility.high");
|
||||
}
|
||||
if (allele.getUID().contains("Maximum")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.fertility.maximum");
|
||||
return I18N.localise("binniecore.allele.fertility.maximum");
|
||||
}
|
||||
}
|
||||
return super.getAlleleName(chromosome, allele);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.resource.BinnieIcon;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.genetics.ExtraBeeMutation;
|
||||
@@ -59,11 +58,11 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
|
||||
}
|
||||
|
||||
public String getChromosomeName(IChromosomeType chromo) {
|
||||
return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".chromosome." + chromo.getName());
|
||||
return I18N.localise("binniecore." + getSpeciesRoot().getUID() + ".chromosome." + chromo.getName());
|
||||
}
|
||||
|
||||
public String getChromosomeShortName(IChromosomeType chromo) {
|
||||
return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".chromosome." + chromo.getName() + ".short");
|
||||
return I18N.localise("binniecore." + getSpeciesRoot().getUID() + ".chromosome." + chromo.getName() + ".short");
|
||||
}
|
||||
|
||||
public String getEpitome(float discoveredPercentage) {
|
||||
@@ -83,7 +82,7 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
|
||||
} else if (discoveredPercentage < 1.0f) {
|
||||
i = 5;
|
||||
}
|
||||
return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".epitome." + i);
|
||||
return I18N.localise("binniecore." + getSpeciesRoot().getUID() + ".epitome." + i);
|
||||
}
|
||||
|
||||
public abstract ISpeciesRoot getSpeciesRoot();
|
||||
@@ -352,7 +351,7 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
|
||||
}
|
||||
|
||||
public String getDescriptor() {
|
||||
return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".descriptor");
|
||||
return I18N.localise("binniecore." + getSpeciesRoot().getUID() + ".descriptor");
|
||||
}
|
||||
|
||||
public String getIdent() {
|
||||
@@ -373,17 +372,17 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
|
||||
public String getAlleleName(IChromosomeType chromosome, IAllele allele) {
|
||||
if (allele instanceof IAlleleBoolean) {
|
||||
return ((IAlleleBoolean) allele).getValue() ?
|
||||
I18N.localise(BinnieCore.instance, "allele.true") :
|
||||
I18N.localise(BinnieCore.instance, "allele.false");
|
||||
I18N.localise("binniecore.allele.true") :
|
||||
I18N.localise("binniecore.allele.false");
|
||||
}
|
||||
if (allele.getName().equals("for.gui.maximum")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.fertility.maximum");
|
||||
return I18N.localise("binniecore.allele.fertility.maximum");
|
||||
}
|
||||
return allele.getName();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".shortName");
|
||||
return I18N.localise("binniecore." + getSpeciesRoot().getUID() + ".shortName");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public enum EnumBeeModifier {
|
||||
@@ -12,6 +11,6 @@ public enum EnumBeeModifier {
|
||||
GENETIC_DECAY;
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise(BinnieCore.instance, "beemodifier." + name().toLowerCase());
|
||||
return I18N.localise("binniecore.beemodifier." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import binnie.botany.api.IBotanistTracker;
|
||||
import binnie.botany.api.IFlowerRoot;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
@@ -55,16 +54,16 @@ class FlowerBreedingSystem extends BreedingSystem {
|
||||
public String getAlleleName(IChromosomeType chromosome, IAllele allele) {
|
||||
if (chromosome == EnumFlowerChromosome.FERTILITY) {
|
||||
if (allele.getUID().contains("Low")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.fertility.low");
|
||||
return I18N.localise("binniecore.allele.fertility.low");
|
||||
}
|
||||
if (allele.getUID().contains("Normal")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.fertility.normal");
|
||||
return I18N.localise("binniecore.allele.fertility.normal");
|
||||
}
|
||||
if (allele.getUID().contains("High")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.fertility.high");
|
||||
return I18N.localise("binniecore.allele.fertility.high");
|
||||
}
|
||||
if (allele.getUID().contains("Maximum")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.fertility.maximum");
|
||||
return I18N.localise("binniecore.allele.fertility.maximum");
|
||||
}
|
||||
}
|
||||
return super.getAlleleName(chromosome, allele);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.genetics.IAllele;
|
||||
@@ -50,24 +49,24 @@ class MothBreedingSystem extends BreedingSystem {
|
||||
if (chromosome == EnumButterflyChromosome.METABOLISM) {
|
||||
int metabolism = ((IAlleleInteger) allele).getValue();
|
||||
if (metabolism >= 19) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.metabolism.highest");
|
||||
return I18N.localise("binniecore.allele.metabolism.highest");
|
||||
}
|
||||
if (metabolism >= 16) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.metabolism.higher");
|
||||
return I18N.localise("binniecore.allele.metabolism.higher");
|
||||
}
|
||||
if (metabolism >= 13) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.metabolism.high");
|
||||
return I18N.localise("binniecore.allele.metabolism.high");
|
||||
}
|
||||
if (metabolism >= 10) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.metabolism.normal");
|
||||
return I18N.localise("binniecore.allele.metabolism.normal");
|
||||
}
|
||||
if (metabolism >= 7) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.metabolism.slow");
|
||||
return I18N.localise("binniecore.allele.metabolism.slow");
|
||||
}
|
||||
if (metabolism >= 4) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.metabolism.slower");
|
||||
return I18N.localise("binniecore.allele.metabolism.slower");
|
||||
}
|
||||
return I18N.localise(BinnieCore.instance, "allele.metabolism.slowest");
|
||||
return I18N.localise("binniecore.allele.metabolism.slowest");
|
||||
}
|
||||
if (chromosome == EnumButterflyChromosome.FERTILITY) {
|
||||
return ((IAlleleInteger) allele).getValue() + "x";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.core.util.UniqueItemStackSet;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
@@ -90,23 +89,23 @@ public class TreeBreedingSystem extends BreedingSystem {
|
||||
if (chromosome == EnumTreeChromosome.PLANT) {
|
||||
EnumSet<EnumPlantType> types = ((IAllelePlantType) allele).getPlantTypes();
|
||||
return types.isEmpty()
|
||||
? I18N.localise(BinnieCore.instance, "allele.none")
|
||||
? I18N.localise("binniecore.allele.none")
|
||||
: types.iterator().next().toString();
|
||||
}
|
||||
|
||||
if (chromosome == EnumTreeChromosome.FRUITS && allele.getUID().contains(".")) {
|
||||
IFruitProvider provider = ((IAlleleFruit) allele).getProvider();
|
||||
return (provider.getProducts().length == 0)
|
||||
? I18N.localise(BinnieCore.instance, "allele.none")
|
||||
? I18N.localise("binniecore.allele.none")
|
||||
: provider.getProducts()[0].getDisplayName();
|
||||
}
|
||||
|
||||
if (chromosome == EnumTreeChromosome.GROWTH) {
|
||||
if (allele.getUID().contains("Tropical")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.growth.tropical");
|
||||
return I18N.localise("binniecore.allele.growth.tropical");
|
||||
}
|
||||
if (allele.getUID().contains("Lightlevel")) {
|
||||
return I18N.localise(BinnieCore.instance, "allele.growth.lightlevel");
|
||||
return I18N.localise("binniecore.allele.growth.lightlevel");
|
||||
}
|
||||
}
|
||||
return super.getAlleleName(chromosome, allele);
|
||||
|
||||
@@ -33,6 +33,6 @@ public class ItemGenesis extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemStack) {
|
||||
return I18N.localise(BinnieCore.instance, "item.genesis.name");
|
||||
return I18N.localise("binniecore.item.genesis.name");
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package binnie.core.liquid;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.genetics.item.GeneticsItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -50,7 +51,7 @@ public enum FluidContainer {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return BinnieCore.proxy.localise("item.container." + name().toLowerCase());
|
||||
return I18N.localise("binniecore.item.container." + name().toLowerCase());
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.core.liquid;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.alcohol.AlcoholEffect;
|
||||
import binnie.extratrees.alcohol.drink.DrinkManager;
|
||||
@@ -70,7 +69,7 @@ public class ItemFluidContainer extends ItemFood {
|
||||
|
||||
FluidStack fluid = getLiquid(stack);
|
||||
if (fluid == null) {
|
||||
return I18N.localise(BinnieCore.instance, "item.fluidContainer.missed");
|
||||
return I18N.localise("binniecore.item.fluidContainer.missed");
|
||||
}
|
||||
return fluid.getFluid().getLocalizedName(fluid) + " " + container.getName();
|
||||
}
|
||||
|
||||
@@ -8,12 +8,11 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ManagerLiquid extends ManagerBase {
|
||||
Map<String, IFluidType> fluids;
|
||||
public Map<String, IFluidType> fluids;
|
||||
|
||||
public ManagerLiquid() {
|
||||
fluids = new LinkedHashMap<>();
|
||||
|
||||
@@ -27,7 +27,7 @@ public abstract class MachinePackage {
|
||||
public abstract TileEntity createTileEntity();
|
||||
|
||||
public String getDisplayName() {
|
||||
return I18N.localise(group.getMod(), "machine." + group.getShortUID() + "." + getUID());
|
||||
return I18N.localise(group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID());
|
||||
}
|
||||
|
||||
public Integer getMetadata() {
|
||||
@@ -57,6 +57,6 @@ public abstract class MachinePackage {
|
||||
}
|
||||
|
||||
public String getInformation() {
|
||||
return I18N.localise(group.getMod(), "machine." + group.getShortUID() + "." + getUID() + ".info");
|
||||
return I18N.localise(group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID() + ".info");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.machines.inventory;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -93,7 +92,7 @@ public class InventorySlot extends BaseSlot<ItemStack> {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.slot." + unlocName);
|
||||
return I18N.localise("binniecore.gui.slot." + unlocName);
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.machines.inventory;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -31,10 +30,10 @@ public class MachineSide {
|
||||
|
||||
public static String asString(Collection<ForgeDirection> sides) {
|
||||
if (sides.containsAll(MachineSide.ALL)) {
|
||||
return I18N.localise(BinnieCore.instance, "gui.side.any");
|
||||
return I18N.localise("binniecore.gui.side.any");
|
||||
}
|
||||
if (sides.isEmpty()) {
|
||||
return I18N.localise(BinnieCore.instance, "gui.side.none");
|
||||
return I18N.localise("binniecore.gui.side.none");
|
||||
}
|
||||
|
||||
String text = "";
|
||||
@@ -42,48 +41,48 @@ public class MachineSide {
|
||||
if (sides.size() > 0) {
|
||||
text += ", ";
|
||||
}
|
||||
text += I18N.localise(BinnieCore.instance, "gui.side.up");
|
||||
text += I18N.localise("binniecore.gui.side.up");
|
||||
}
|
||||
|
||||
if (sides.contains(ForgeDirection.DOWN)) {
|
||||
if (sides.size() > 0) {
|
||||
text += ", ";
|
||||
}
|
||||
text += I18N.localise(BinnieCore.instance, "gui.side.down");
|
||||
text += I18N.localise("binniecore.gui.side.down");
|
||||
}
|
||||
|
||||
if (sides.containsAll(MachineSide.SIDES)) {
|
||||
if (sides.size() > 0) {
|
||||
text += ", ";
|
||||
}
|
||||
text += I18N.localise(BinnieCore.instance, "gui.side.sides");
|
||||
text += I18N.localise("binniecore.gui.side.sides");
|
||||
} else {
|
||||
if (sides.contains(ForgeDirection.NORTH)) {
|
||||
if (sides.size() > 0) {
|
||||
text += ", ";
|
||||
}
|
||||
text += I18N.localise(BinnieCore.instance, "gui.side.north");
|
||||
text += I18N.localise("binniecore.gui.side.north");
|
||||
}
|
||||
|
||||
if (sides.contains(ForgeDirection.EAST)) {
|
||||
if (sides.size() > 0) {
|
||||
text += ", ";
|
||||
}
|
||||
text += I18N.localise(BinnieCore.instance, "gui.side.east");
|
||||
text += I18N.localise("binniecore.gui.side.east");
|
||||
}
|
||||
|
||||
if (sides.contains(ForgeDirection.SOUTH)) {
|
||||
if (sides.size() > 0) {
|
||||
text += ", ";
|
||||
}
|
||||
text += I18N.localise(BinnieCore.instance, "gui.side.south");
|
||||
text += I18N.localise("binniecore.gui.side.south");
|
||||
}
|
||||
|
||||
if (sides.contains(ForgeDirection.WEST)) {
|
||||
if (sides.size() > 0) {
|
||||
text += ", ";
|
||||
}
|
||||
text += I18N.localise(BinnieCore.instance, "gui.side.west");
|
||||
text += I18N.localise("binniecore.gui.side.west");
|
||||
}
|
||||
}
|
||||
return text;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.machines.inventory;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -55,7 +54,7 @@ public abstract class SlotValidator extends Validator<ItemStack> {
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.slot.breedableIndividual");
|
||||
return I18N.localise("binniecore.gui.slot.breedableIndividual");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.machines.inventory;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -49,6 +48,6 @@ public class TankSlot extends BaseSlot<FluidStack> {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.slot." + unlocName);
|
||||
return I18N.localise("binniecore.gui.slot." + unlocName);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.machines.power;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.core.INBTTagable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -107,13 +106,13 @@ public class ErrorState implements INBTTagable {
|
||||
}
|
||||
|
||||
public NoItem(String desc, int[] slots) {
|
||||
super(I18N.localise(BinnieCore.instance, "machine.error.noItem"), desc, slots);
|
||||
super(I18N.localise("binniecore.machine.error.noItem"), desc, slots);
|
||||
}
|
||||
}
|
||||
|
||||
public static class InvalidItem extends Item {
|
||||
public InvalidItem(String desc, int slot) {
|
||||
this(I18N.localise(BinnieCore.instance, "machine.error.invalidItem"), desc, slot);
|
||||
this(I18N.localise("binniecore.machine.error.invalidItem"), desc, slot);
|
||||
}
|
||||
|
||||
public InvalidItem(String name, String desc, int slot) {
|
||||
@@ -123,32 +122,32 @@ public class ErrorState implements INBTTagable {
|
||||
|
||||
public static class NoSpace extends Item {
|
||||
public NoSpace(String desc, int slot) {
|
||||
super(I18N.localise(BinnieCore.instance, "machine.error.noSpace"), desc, new int[]{slot});
|
||||
super(I18N.localise("binniecore.machine.error.noSpace"), desc, new int[]{slot});
|
||||
}
|
||||
|
||||
public NoSpace(String desc, int[] slots) {
|
||||
super(I18N.localise(BinnieCore.instance, "machine.error.noSpace"), desc, slots);
|
||||
super(I18N.localise("binniecore.machine.error.noSpace"), desc, slots);
|
||||
}
|
||||
}
|
||||
|
||||
public static class InsufficientPower extends ErrorState {
|
||||
public InsufficientPower() {
|
||||
super(
|
||||
I18N.localise(BinnieCore.instance, "machine.error.insufficientPower.title"),
|
||||
I18N.localise(BinnieCore.instance, "machine.error.insufficientPower.desc")
|
||||
I18N.localise("binniecore.machine.error.insufficientPower.title"),
|
||||
I18N.localise("binniecore.machine.error.insufficientPower.desc")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static class TankSpace extends Tank {
|
||||
public TankSpace(String desc, int tank) {
|
||||
super(I18N.localise(BinnieCore.instance, "machine.error.tankFull"), desc, new int[]{tank});
|
||||
super(I18N.localise("binniecore.machine.error.tankFull"), desc, new int[]{tank});
|
||||
}
|
||||
}
|
||||
|
||||
public static class InsufficientLiquid extends Tank {
|
||||
public InsufficientLiquid(String desc, int tank) {
|
||||
super(I18N.localise(BinnieCore.instance, "machine.error.insufficientLiquid"), desc, new int[]{tank});
|
||||
super(I18N.localise("binniecore.machine.error.insufficientLiquid"), desc, new int[]{tank});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,10 @@ import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.ControlButton;
|
||||
import binnie.core.craftgui.controls.ControlCheckbox;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextEdit;
|
||||
import binnie.core.craftgui.controls.ControlButton;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.page.ControlPage;
|
||||
import binnie.core.craftgui.controls.page.ControlPages;
|
||||
|
||||
@@ -4,7 +4,6 @@ import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.network.packet.MessageBase;
|
||||
import binnie.core.util.I18N;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -58,12 +57,4 @@ public class BinnieModProxy implements IBinnieModProxy {
|
||||
public void postInit() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public String localise(String string) {
|
||||
return I18N.localise(mod, string);
|
||||
}
|
||||
|
||||
public String localiseOrBlank(String string) {
|
||||
return I18N.localiseOrBlank(mod, string);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,14 @@
|
||||
package binnie.core.util;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class I18N {
|
||||
public static String unlocalised(AbstractMod mod, String id) {
|
||||
return mod.getModID() + "." + id;
|
||||
}
|
||||
|
||||
public static String localise(String key) {
|
||||
return StatCollector.translateToLocal(key.toString());
|
||||
return StatCollector.translateToLocal(key);
|
||||
}
|
||||
|
||||
public static String localise(AbstractMod mod, String id) {
|
||||
return localise(unlocalised(mod, id));
|
||||
}
|
||||
|
||||
public static String localiseOrBlank(AbstractMod mod, String id) {
|
||||
return localiseOrBlank(unlocalised(mod, id));
|
||||
}
|
||||
|
||||
public static String localise(AbstractMod mod, String id, Object... objs) {
|
||||
return String.format(localise(mod, id), objs);
|
||||
public static String localise(String key, Object... objs) {
|
||||
return String.format(StatCollector.translateToLocal(key), objs);
|
||||
}
|
||||
|
||||
public static String localiseOrBlank(String key) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import binnie.core.Mods;
|
||||
import binnie.core.genetics.BeeModifierLogic;
|
||||
import binnie.core.genetics.EnumBeeBooleanModifier;
|
||||
import binnie.core.genetics.EnumBeeModifier;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
@@ -135,7 +135,7 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("item.frame." + toString().toLowerCase());
|
||||
return I18N.localise("extrabees.item.frame." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public enum IndustrialFrame implements IBeeModifier {
|
||||
Empty("Empty", 5, 0),
|
||||
Light("Glowstone Lighting", 2, 4),
|
||||
Rain("Rain Shielding", 2, 4),
|
||||
Sunlight("Sunlight Simulator", 4, 8),
|
||||
Soul("Low Grade Mutagen", 5, 15),
|
||||
Uranium("High Grade Mutagen", 10, 50),
|
||||
Cage("Meshed Restrainer", 3, 12),
|
||||
Freedom("Territory Extension", 3, 16),
|
||||
Honey("Honey Amplifier", 4, 12),
|
||||
Jelly("Gelatin Amplifier", 8, 36),
|
||||
Leaf("Pollinator MK I", 3, 15),
|
||||
Pollen("Pollinator MK II", 7, 25),
|
||||
Clay("Lifespan Extensor", 2, 10),
|
||||
Emerald("Eon Simulator", 7, 20),
|
||||
NetherStar("Immortality Gate", 12, 50),
|
||||
Poison("Mortality Inhibitor", 8, 18);
|
||||
|
||||
static {
|
||||
IndustrialFrame.Light.lighted = true;
|
||||
IndustrialFrame.Rain.rain = true;
|
||||
IndustrialFrame.Sunlight.lighted = true;
|
||||
IndustrialFrame.Sunlight.sunlight = true;
|
||||
IndustrialFrame.Soul.mutationMod = 1.3f;
|
||||
IndustrialFrame.Uranium.mutationMod = 2.0f;
|
||||
IndustrialFrame.Cage.territoryMod = 0.4f;
|
||||
IndustrialFrame.Freedom.territoryMod = 1.4f;
|
||||
IndustrialFrame.Honey.productionMod = 1.4f;
|
||||
IndustrialFrame.Jelly.productionMod = 1.8f;
|
||||
IndustrialFrame.Leaf.floweringMod = 1.4f;
|
||||
IndustrialFrame.Pollen.floweringMod = 2.0f;
|
||||
IndustrialFrame.Clay.lifespanMod = 1.4f;
|
||||
IndustrialFrame.Emerald.lifespanMod = 2.0f;
|
||||
IndustrialFrame.NetherStar.lifespanMod = 20.0f;
|
||||
IndustrialFrame.Poison.lifespanMod = 0.5f;
|
||||
}
|
||||
|
||||
protected String name;
|
||||
protected float territoryMod;
|
||||
protected float mutationMod;
|
||||
protected float lifespanMod;
|
||||
protected float productionMod;
|
||||
protected float floweringMod;
|
||||
protected boolean lighted;
|
||||
protected boolean sunlight;
|
||||
protected boolean rain;
|
||||
protected int wearMod;
|
||||
protected int power;
|
||||
|
||||
IndustrialFrame(String name, int wear, int power) {
|
||||
this.name = name;
|
||||
this.power = power;
|
||||
territoryMod = 1.0f;
|
||||
mutationMod = 1.0f;
|
||||
lifespanMod = 1.0f;
|
||||
productionMod = 1.0f;
|
||||
floweringMod = 1.0f;
|
||||
lighted = false;
|
||||
sunlight = false;
|
||||
rain = false;
|
||||
wearMod = wear;
|
||||
}
|
||||
|
||||
public static ItemStack getItemStack(Item item, IndustrialFrame frame) {
|
||||
ItemStack stack = new ItemStack(item);
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("frame", frame.ordinal());
|
||||
stack.setTagCompound(nbt);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return territoryMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return mutationMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return lifespanMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return productionMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return floweringMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return rain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return lighted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return sunlight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public int getWearModifier() {
|
||||
return wearMod;
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public int getPowerUsage() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
// TODO unused class?
|
||||
public class ItemIndustrialFrame extends Item {
|
||||
public ItemIndustrialFrame() {
|
||||
setCreativeTab(CreativeTabs.tabMisc);
|
||||
setMaxDamage(400);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("industrialFrame");
|
||||
}
|
||||
|
||||
public static IndustrialFrame getFrame(ItemStack stack) {
|
||||
if (stack == null || !stack.hasTagCompound() || !stack.getTagCompound().hasKey("frame")) {
|
||||
return null;
|
||||
}
|
||||
return IndustrialFrame.values()[stack.getTagCompound().getInteger("frame")];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (IndustrialFrame frame : IndustrialFrame.values()) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("frame", frame.ordinal());
|
||||
stack.setTagCompound(nbt);
|
||||
par3List.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
IndustrialFrame frame = getFrame(par1ItemStack);
|
||||
if (frame == null) {
|
||||
par3List.add("Invalid Contents");
|
||||
} else {
|
||||
par3List.add(frame.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
return "Industrial Frame";
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,8 @@ import binnie.core.circuits.BinnieCircuitLayout;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMutator;
|
||||
import binnie.extrabees.apiary.machine.AlvearyStimulator;
|
||||
import binnie.extrabees.apiary.machine.mutator.AlvearyMutator;
|
||||
import binnie.extrabees.apiary.machine.stimulator.CircuitType;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -106,7 +106,7 @@ public class ModuleApiary implements IInitializable {
|
||||
}
|
||||
));
|
||||
|
||||
for (AlvearyStimulator.CircuitType type : AlvearyStimulator.CircuitType.values()) {
|
||||
for (CircuitType type : CircuitType.values()) {
|
||||
type.createCircuit(stimulatorLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,12 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyComponent.BeeListener, IBeeListener, IBeeModifier {
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements
|
||||
IAlvearyComponent.Active,
|
||||
IAlvearyComponent.BeeModifier,
|
||||
IAlvearyComponent.BeeListener,
|
||||
IBeeListener,
|
||||
IBeeModifier {
|
||||
protected IMultiblockLogicAlveary structureLogic;
|
||||
protected ChunkCoordinates min;
|
||||
protected ChunkCoordinates max;
|
||||
@@ -44,15 +49,17 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
}
|
||||
|
||||
public List<TileEntity> getAlvearyBlocks() {
|
||||
LinkedList<TileEntity> tiles = new LinkedList<TileEntity>();
|
||||
if (min != null && max != null) {
|
||||
for (int x = min.posX; x <= max.posX; ++x) {
|
||||
for (int z = min.posZ; z <= max.posZ; ++z) {
|
||||
for (int y = min.posY; y <= max.posY; ++y) {
|
||||
TileEntity tile = getWorldObj().getTileEntity(x, y, z);
|
||||
if (tile instanceof IMultiblockComponent) {
|
||||
tiles.add(tile);
|
||||
}
|
||||
LinkedList<TileEntity> tiles = new LinkedList<>();
|
||||
if (min == null || max == null) {
|
||||
return tiles;
|
||||
}
|
||||
|
||||
for (int x = min.posX; x <= max.posX; ++x) {
|
||||
for (int z = min.posZ; z <= max.posZ; ++z) {
|
||||
for (int y = min.posY; y <= max.posY; ++y) {
|
||||
TileEntity tile = getWorldObj().getTileEntity(x, y, z);
|
||||
if (tile instanceof IMultiblockComponent) {
|
||||
tiles.add(tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -544,5 +551,4 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// return this.getMachine().getInterface(ISidedInventory.class);
|
||||
// }
|
||||
//
|
||||
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class AlvearyFrame {
|
||||
public static int slotFrame = 0;
|
||||
|
||||
public static class PackageAlvearyFrame extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyFrame() {
|
||||
super("frame", ExtraBeeTexture.AlvearyFrame.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyFrame);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyFrame.slotFrame, "frame");
|
||||
inventory.getSlot(AlvearyFrame.slotFrame).setValidator(new SlotValidatorFrame());
|
||||
new ComponentFrameModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorFrame extends SlotValidator {
|
||||
public SlotValidatorFrame() {
|
||||
super(SlotValidator.IconFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return itemStack != null
|
||||
&& itemStack.getItem() instanceof IHiveFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Hive Frames";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentFrameModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
if (getHiveFrame() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
World world = getMachine().getTileEntity().getWorldObj();
|
||||
int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier());
|
||||
getInventory().setInventorySlotContents(AlvearyFrame.slotFrame, getHiveFrame().frameUsed(((TileExtraBeeAlveary) getMachine().getTileEntity()).getMultiblockLogic().getController(), getInventory().getStackInSlot(AlvearyFrame.slotFrame), null, wear));
|
||||
}
|
||||
|
||||
public IHiveFrame getHiveFrame() {
|
||||
if (getInventory().getStackInSlot(AlvearyFrame.slotFrame) != null) {
|
||||
return (IHiveFrame) getInventory().getStackInSlot(AlvearyFrame.slotFrame).getItem();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (getHiveFrame() == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.transfer.TransferRequest;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class AlvearyHatchery {
|
||||
public static int[] slotLarvae = new int[]{0, 1, 2, 3, 4};
|
||||
|
||||
public static class PackageAlvearyHatchery extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyHatchery() {
|
||||
super("hatchery", ExtraBeeTexture.AlvearyHatchery.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyHatchery);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
for (InventorySlot slot : inventory.addSlotArray(AlvearyHatchery.slotLarvae, "hatchery")) {
|
||||
slot.setValidator(new SlotValidatorLarvae());
|
||||
}
|
||||
new ComponentFrameModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorLarvae extends SlotValidator {
|
||||
public SlotValidatorLarvae() {
|
||||
super(SlotValidator.IconBee);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return Binnie.Genetics.getBeeRoot().isMember(itemStack) && Binnie.Genetics.getBeeRoot().getType(itemStack) == EnumBeeType.LARVAE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Larvae";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentFrameModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (new Random().nextInt(2400) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TileEntity tile = getMachine().getTileEntity();
|
||||
if (!(tile instanceof TileExtraBeeAlveary)) {
|
||||
return;
|
||||
}
|
||||
|
||||
IBeeHousing house = ((TileExtraBeeAlveary) tile).getMultiblockLogic().getController();
|
||||
if (house == null || house.getErrorLogic().hasErrors()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack queenStack = house.getBeeInventory().getQueen();
|
||||
IBee queen = (queenStack == null) ? null : Binnie.Genetics.getBeeRoot().getMember(queenStack);
|
||||
if (queen == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IBeeRoot beeRoot = Binnie.Genetics.getBeeRoot();
|
||||
ItemStack larvae = beeRoot.getMemberStack(beeRoot.getBee(getMachine().getWorld(), queen.getGenome()), EnumBeeType.LARVAE.ordinal());
|
||||
new TransferRequest(larvae, getInventory()).transfer(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
|
||||
public class AlvearyLighting {
|
||||
public static class PackageAlvearyLighting extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyLighting() {
|
||||
super("lighting", ExtraBeeTexture.AlvearyLighting.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentLighting(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentLighting extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentLighting(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,18 +7,25 @@ import binnie.core.machines.MachineRendererBlock;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.extrabees.apiary.ModuleApiary;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.apiary.machine.frame.FrameAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.hatchery.HatcheryAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.lighting.LightingAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.mutator.MutatorAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.rainShield.RainShieldAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.stimulator.StimulatorAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.transmission.TransmissionAlvearyPackage;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public enum AlvearyMachine implements IMachineType {
|
||||
Mutator(AlvearyMutator.PackageAlvearyMutator.class),
|
||||
Frame(AlvearyFrame.PackageAlvearyFrame.class),
|
||||
RainShield(AlvearyRainShield.PackageAlvearyRainShield.class),
|
||||
Lighting(AlvearyLighting.PackageAlvearyLighting.class),
|
||||
Stimulator(AlvearyStimulator.PackageAlvearyStimulator.class),
|
||||
Hatchery(AlvearyHatchery.PackageAlvearyHatchery.class),
|
||||
Transmission(AlvearyTransmission.PackageAlvearyTransmission.class);
|
||||
Mutator(MutatorAlvearyPackage.class),
|
||||
Frame(FrameAlvearyPackage.class),
|
||||
RainShield(RainShieldAlvearyPackage.class),
|
||||
Lighting(LightingAlvearyPackage.class),
|
||||
Stimulator(StimulatorAlvearyPackage.class),
|
||||
Hatchery(HatcheryAlvearyPackage.class),
|
||||
Transmission(TransmissionAlvearyPackage.class);
|
||||
|
||||
protected Class<? extends MachinePackage> cls;
|
||||
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.inventory.ValidatorIcon;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class AlvearyMutator {
|
||||
public static int slotMutator = 0;
|
||||
|
||||
protected static Map<ItemStack, Float> mutations = new HashMap<>();
|
||||
|
||||
public static boolean isMutationItem(ItemStack item) {
|
||||
return getMutationMult(item) > 1.0f;
|
||||
}
|
||||
|
||||
public static float getMutationMult(ItemStack item) {
|
||||
if (item == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
for (ItemStack comp : AlvearyMutator.mutations.keySet()) {
|
||||
if (ItemStack.areItemStackTagsEqual(item, comp) && item.isItemEqual(comp)) {
|
||||
return AlvearyMutator.mutations.get(comp);
|
||||
}
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public static void addMutationItem(ItemStack item, float chance) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
AlvearyMutator.mutations.put(item, chance);
|
||||
}
|
||||
|
||||
public static Collection<ItemStack> getMutagens() {
|
||||
return AlvearyMutator.mutations.keySet();
|
||||
}
|
||||
|
||||
public static class PackageAlvearyMutator extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyMutator() {
|
||||
super("mutator", ExtraBeeTexture.AlvearyMutator.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyMutator);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyMutator.slotMutator, "mutator");
|
||||
inventory.getSlot(AlvearyMutator.slotMutator).setValidator(new SlotValidatorMutator());
|
||||
new ComponentMutatorModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorMutator extends SlotValidator {
|
||||
public SlotValidatorMutator() {
|
||||
super(new ValidatorIcon(ExtraBees.instance, "validator/mutator.0", "validator/mutator.1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return AlvearyMutator.isMutationItem(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Mutagenic Agents";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentMutatorModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentMutatorModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
if (getUtil().isSlotEmpty(AlvearyMutator.slotMutator)) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
float mult = AlvearyMutator.getMutationMult(getUtil().getStack(AlvearyMutator.slotMutator));
|
||||
return Math.min(mult, 15.0f / currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostQueenDeath(IBee queen) {
|
||||
getUtil().decreaseStack(AlvearyMutator.slotMutator, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
|
||||
public class AlvearyRainShield {
|
||||
public static class PackageAlvearyRainShield extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyRainShield() {
|
||||
super("rainShield", ExtraBeeTexture.AlvearyRainShield.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentRainShield(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentRainShield extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentRainShield(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,419 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.circuits.BinnieCircuit;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.genetics.BeeModifierLogic;
|
||||
import binnie.core.genetics.EnumBeeBooleanModifier;
|
||||
import binnie.core.genetics.EnumBeeModifier;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.ICircuit;
|
||||
import forestry.api.circuits.ICircuitBoard;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlvearyStimulator {
|
||||
public static int slotCircuit = 0;
|
||||
|
||||
public enum CircuitType implements IBeeModifier {
|
||||
LowVoltage(3, 10),
|
||||
HighVoltage(5, 20),
|
||||
Plant(10, 10),
|
||||
Death(6, 10),
|
||||
Life(11, 10),
|
||||
Nether(7, 15),
|
||||
Mutation(4, 15),
|
||||
Inhibitor(1, 10),
|
||||
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);
|
||||
for (CircuitType type : values()) {
|
||||
type.logic.setModifier(EnumBeeModifier.GENETIC_DECAY, 1.5f, 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
public int recipe;
|
||||
public int power;
|
||||
|
||||
protected BeeModifierLogic logic;
|
||||
|
||||
CircuitType(int recipe, int power) {
|
||||
logic = new BeeModifierLogic();
|
||||
this.recipe = recipe;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public void createCircuit(ICircuitLayout layout) {
|
||||
StimulatorCircuit circuit = new StimulatorCircuit(this, layout);
|
||||
for (EnumBeeModifier modifier : EnumBeeModifier.values()) {
|
||||
float mod = logic.getModifier(modifier, 1.0f);
|
||||
if (mod == 1.0f) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mod > 1.0f) {
|
||||
int increase = (int) ((mod - 1.0f) * 100.0f);
|
||||
circuit.addTooltipString("Increases " + modifier.getName() + " by " + increase + "%");
|
||||
} else {
|
||||
int decrease = (int) ((1.0f - mod) * 100.0f);
|
||||
circuit.addTooltipString("Decreases " + modifier.getName() + " by " + decrease + "%");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.TERRITORY, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.MUTATION, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.LIFESPAN, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.PRODUCTION, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.FLOWERING, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.GENETIC_DECAY, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SEALED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SELF_LIGHTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SUNLIGHT_STIMULATED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.HELLISH);
|
||||
}
|
||||
}
|
||||
|
||||
public static class PackageAlvearyStimulator extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyStimulator() {
|
||||
super("stimulator", ExtraBeeTexture.AlvearyStimulator.getTexture(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyStimulator);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyStimulator.slotCircuit, "circuit");
|
||||
inventory.getSlot(AlvearyStimulator.slotCircuit).setValidator(new SlotValidatorCircuit());
|
||||
ComponentPowerReceptor power = new ComponentPowerReceptor(machine);
|
||||
new ComponentStimulatorModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorCircuit extends SlotValidator {
|
||||
public SlotValidatorCircuit() {
|
||||
super(SlotValidator.IconCircuit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return itemStack != null && ChipsetManager.circuitRegistry.isChipset(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Forestry Circuits";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentStimulatorModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
protected float powerUsage;
|
||||
protected boolean powered;
|
||||
protected StimulatorCircuit[] modifiers;
|
||||
|
||||
public ComponentStimulatorModifier(Machine machine) {
|
||||
super(machine);
|
||||
powerUsage = 0.0f;
|
||||
powered = false;
|
||||
modifiers = new StimulatorCircuit[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
modifiers = getCircuits();
|
||||
powerUsage = 0.0f;
|
||||
for (StimulatorCircuit beeMod : modifiers) {
|
||||
powerUsage += beeMod.getPowerUsage();
|
||||
}
|
||||
powered = getUtil().hasEnergyMJ(powerUsage);
|
||||
}
|
||||
|
||||
public ICircuitBoard getHiveFrame() {
|
||||
if (!getUtil().isSlotEmpty(AlvearyStimulator.slotCircuit)) {
|
||||
return ChipsetManager.circuitRegistry.getCircuitboard(getUtil().getStack(AlvearyStimulator.slotCircuit));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public StimulatorCircuit[] getCircuits() {
|
||||
ICircuitBoard board = getHiveFrame();
|
||||
if (board == null) {
|
||||
return new StimulatorCircuit[0];
|
||||
}
|
||||
|
||||
ICircuit[] circuits = board.getCircuits();
|
||||
List<IBeeModifier> mod = new ArrayList<>();
|
||||
for (ICircuit circuit : circuits) {
|
||||
if (circuit instanceof StimulatorCircuit) {
|
||||
mod.add((IBeeModifier) circuit);
|
||||
}
|
||||
}
|
||||
return mod.toArray(new StimulatorCircuit[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getTerritoryModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getMutationModifier(genome, mate, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getLifespanModifier(genome, mate, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getProductionModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getFloweringModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getGeneticDecay(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
if (!powered) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
if (beeMod.isSealed()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
if (!powered) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
if (beeMod.isSelfLighted()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
if (!powered) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
if (beeMod.isSunlightSimulated()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
if (!powered) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
if (beeMod.isHellish()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
getUtil().useEnergyMJ(powerUsage);
|
||||
}
|
||||
}
|
||||
|
||||
public static class StimulatorCircuit extends BinnieCircuit implements IBeeModifier {
|
||||
protected CircuitType type;
|
||||
|
||||
public StimulatorCircuit(CircuitType type, ICircuitLayout layout) {
|
||||
super("stimulator." + type.toString().toLowerCase(), 4, layout, Mods.forestry.item("thermionicTubes"), type.recipe);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getPowerUsage() {
|
||||
return type.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return type.getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return type.getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return type.getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return type.getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return type.getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return type.isSealed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return type.isSelfLighted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return type.isSunlightSimulated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return type.isHellish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return type.getGeneticDecay(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlvearyTransmission {
|
||||
public static class PackageAlvearyTransmission extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyTransmission() {
|
||||
super("transmission", ExtraBeeTexture.AlvearyTransmission.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentPowerReceptor(machine, 1000);
|
||||
new ComponentTransmission(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentTransmission extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentTransmission(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
int energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
if (energy == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TileExtraBeeAlveary tile = (TileExtraBeeAlveary) getMachine().getTileEntity();
|
||||
List<IEnergyHandler> handlers = new ArrayList<IEnergyHandler>();
|
||||
for (TileEntity alvearyTile : tile.getAlvearyBlocks()) {
|
||||
if (alvearyTile instanceof IEnergyHandler && alvearyTile != tile) {
|
||||
handlers.add((IEnergyHandler) alvearyTile);
|
||||
}
|
||||
}
|
||||
|
||||
if (handlers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int maxOutput = 500;
|
||||
int output = energy / handlers.size();
|
||||
if (output > maxOutput) {
|
||||
output = maxOutput;
|
||||
} else if (output < 1) {
|
||||
output = 1;
|
||||
}
|
||||
|
||||
for (IEnergyHandler handler : handlers) {
|
||||
int recieved = handler.receiveEnergy(ForgeDirection.NORTH, output, false);
|
||||
getUtil().getPoweredMachine().receiveEnergy(ForgeDirection.NORTH, -recieved, false);
|
||||
energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
if (energy <= 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package binnie.extrabees.apiary.machine.frame;
|
||||
|
||||
public class AlvearyFrame {
|
||||
public static final int SLOT_FRAME = 0;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package binnie.extrabees.apiary.machine.frame;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class FrameAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public FrameAlvearyPackage() {
|
||||
super("frame", ExtraBeeTexture.AlvearyFrame.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyFrame);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyFrame.SLOT_FRAME, "frame");
|
||||
inventory.getSlot(AlvearyFrame.SLOT_FRAME).setValidator(new FrameSlotValidator());
|
||||
new FrameComponentModifier(machine);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package binnie.extrabees.apiary.machine.frame;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class FrameComponentModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public FrameComponentModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
if (getHiveFrame() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
World world = getMachine().getTileEntity().getWorldObj();
|
||||
int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier());
|
||||
getInventory().setInventorySlotContents(AlvearyFrame.SLOT_FRAME, getHiveFrame().frameUsed(((TileExtraBeeAlveary) getMachine().getTileEntity()).getMultiblockLogic().getController(), getInventory().getStackInSlot(AlvearyFrame.SLOT_FRAME), null, wear));
|
||||
}
|
||||
|
||||
public IHiveFrame getHiveFrame() {
|
||||
if (getInventory().getStackInSlot(AlvearyFrame.SLOT_FRAME) == null) {
|
||||
return null;
|
||||
}
|
||||
return (IHiveFrame) getInventory().getStackInSlot(AlvearyFrame.SLOT_FRAME).getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (getHiveFrame() == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package binnie.extrabees.apiary.machine.frame;
|
||||
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class FrameSlotValidator extends SlotValidator {
|
||||
public FrameSlotValidator() {
|
||||
super(SlotValidator.IconFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return itemStack != null
|
||||
&& itemStack.getItem() instanceof IHiveFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise("extrabees.achine.alveay.frame.tooltip");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package binnie.extrabees.apiary.machine.hatchery;
|
||||
|
||||
public class AlvearyHatchery {
|
||||
public static final int[] SLOT_LARVAE = new int[]{0, 1, 2, 3, 4};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package binnie.extrabees.apiary.machine.hatchery;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class HatcheryAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public HatcheryAlvearyPackage() {
|
||||
super("hatchery", ExtraBeeTexture.AlvearyHatchery.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyHatchery);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
for (InventorySlot slot : inventory.addSlotArray(AlvearyHatchery.SLOT_LARVAE, "hatchery")) {
|
||||
slot.setValidator(new LarvaeSlotValidator());
|
||||
}
|
||||
new HatcheryComponentModifier(machine);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package binnie.extrabees.apiary.machine.hatchery;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.transfer.TransferRequest;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class HatcheryComponentModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public HatcheryComponentModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (new Random().nextInt(2400) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TileEntity tile = getMachine().getTileEntity();
|
||||
if (!(tile instanceof TileExtraBeeAlveary)) {
|
||||
return;
|
||||
}
|
||||
|
||||
IBeeHousing house = ((TileExtraBeeAlveary) tile).getMultiblockLogic().getController();
|
||||
if (house == null || house.getErrorLogic().hasErrors()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack queenStack = house.getBeeInventory().getQueen();
|
||||
IBee queen = (queenStack == null) ? null : Binnie.Genetics.getBeeRoot().getMember(queenStack);
|
||||
if (queen == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IBeeRoot beeRoot = Binnie.Genetics.getBeeRoot();
|
||||
ItemStack larvae = beeRoot.getMemberStack(beeRoot.getBee(getMachine().getWorld(), queen.getGenome()), EnumBeeType.LARVAE.ordinal());
|
||||
new TransferRequest(larvae, getInventory()).transfer(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package binnie.extrabees.apiary.machine.hatchery;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class LarvaeSlotValidator extends SlotValidator {
|
||||
public LarvaeSlotValidator() {
|
||||
super(SlotValidator.IconBee);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return Binnie.Genetics.getBeeRoot().isMember(itemStack) && Binnie.Genetics.getBeeRoot().getType(itemStack) == EnumBeeType.LARVAE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise("extrabees.machine.alveay.hatchery.tooltip");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package binnie.extrabees.apiary.machine.lighting;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class LightingAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public LightingAlvearyPackage() {
|
||||
super("lighting", ExtraBeeTexture.AlvearyLighting.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new LightingComponentModifier(machine);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 232 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user