From 0435df0fb64bc30bb2a9be2de55ba36bb558d7d9 Mon Sep 17 00:00:00 2001 From: Vexatos Date: Wed, 20 Aug 2014 21:03:14 +0200 Subject: [PATCH] Optimized custom x-alyzer species names, they now depend on the type. --- api | 2 +- lang | 2 +- .../forestry/apiculture/gui/GuiBeealyzer.java | 10 +++++----- .../arboriculture/gui/GuiTreealyzer.java | 20 +++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/api b/api index 3f6be6bfc..afbce9780 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit 3f6be6bfc53538ae723d14f3e9c5556788f31488 +Subproject commit afbce9780fc2abef24d48a6b2f154418e8fbd5e0 diff --git a/lang b/lang index 626323298..6da7699bb 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 6263232985cbe6a2be60286172845a8787ee9dea +Subproject commit 6da7699bb67bd858852a8b2c82057642a8c364b2 diff --git a/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java b/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java index 6c4dc4eb4..1f38a8a3d 100755 --- a/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java +++ b/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java @@ -32,7 +32,6 @@ import forestry.core.gui.GuiAlyzer; import forestry.core.utils.StringUtil; import forestry.core.utils.Vect; import forestry.plugins.PluginApiculture; -import net.minecraft.util.StatCollector; public class GuiBeealyzer extends GuiAlyzer { @@ -146,11 +145,12 @@ public class GuiBeealyzer extends GuiAlyzer { newLine(); newLine(); - String customPrimaryBeeKey = "bees.custom.beealyzer." + bee.getGenome().getPrimary().getUnlocalizedName().replace("bees.species.", ""); - String customSecondaryBeeKey = "bees.custom.beealyzer." + bee.getGenome().getSecondary().getUnlocalizedName().replace("bees.species.", ""); - - drawSpeciesRow(StringUtil.localize("gui.species"), bee, EnumBeeChromosome.SPECIES, checkCustomName(customPrimaryBeeKey), checkCustomName(customSecondaryBeeKey)); + { + String customPrimaryBeeKey = "bees.custom.beealyzer." + type.getName() + "." + bee.getGenome().getPrimary().getUnlocalizedName().replace("bees.species.", ""); + String customSecondaryBeeKey = "bees.custom.beealyzer." + type.getName() + "." + bee.getGenome().getSecondary().getUnlocalizedName().replace("bees.species.", ""); + drawSpeciesRow(StringUtil.localize("gui.species"), bee, EnumBeeChromosome.SPECIES, checkCustomName(customPrimaryBeeKey), checkCustomName(customSecondaryBeeKey)); + } drawRow(StringUtil.localize("gui.lifespan"), bee.getGenome().getActiveAllele(EnumBeeChromosome.LIFESPAN.ordinal()).getName(), bee.getGenome().getInactiveAllele(EnumBeeChromosome.LIFESPAN.ordinal()).getName(), bee, EnumBeeChromosome.LIFESPAN); diff --git a/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java b/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java index 23257cb5b..da0e11a63 100755 --- a/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java +++ b/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java @@ -16,13 +16,9 @@ import java.util.Locale; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.EnumPlantType; -import forestry.api.arboriculture.EnumTreeChromosome; -import forestry.api.arboriculture.IAlleleFruit; -import forestry.api.arboriculture.IAlleleGrowth; -import forestry.api.arboriculture.ITree; +import forestry.api.arboriculture.*; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleEffect; @@ -61,6 +57,7 @@ public class GuiTreealyzer extends GuiAlyzer { int page = 0; ITree tree = null; + EnumGermlingType treeType = EnumGermlingType.SAPLING; for (int k = 1; k < TreealyzerInventory.SLOT_ANALYZE_5 + 1; k++) { if (k == TreealyzerInventory.SLOT_ENERGY) continue; @@ -68,6 +65,7 @@ public class GuiTreealyzer extends GuiAlyzer { if (inventory.getStackInSlot(k) == null) continue; tree = PluginArboriculture.treeInterface.getMember(inventory.getStackInSlot(k)); + treeType = PluginArboriculture.treeInterface.getType(inventory.getStackInSlot(k)); if (tree == null || !tree.isAnalyzed()) continue; @@ -77,7 +75,7 @@ public class GuiTreealyzer extends GuiAlyzer { switch (page) { case 1: - drawAnalyticsPage1(tree); + drawAnalyticsPage1(tree, treeType); break; case 2: drawAnalyticsPage2(tree); @@ -126,7 +124,7 @@ public class GuiTreealyzer extends GuiAlyzer { endPage(); } - private void drawAnalyticsPage1(ITree tree) { + private void drawAnalyticsPage1(ITree tree, EnumGermlingType type) { startPage(COLUMN_0, COLUMN_1, COLUMN_2); @@ -147,10 +145,12 @@ public class GuiTreealyzer extends GuiAlyzer { newLine(); newLine();*/ - String customPrimaryTreeKey = "trees.custom.treealyzer." + tree.getGenome().getPrimary().getUnlocalizedName().replace("trees.species.", ""); - String customSecondaryTreeKey = "trees.custom.treealyzer." + tree.getGenome().getSecondary().getUnlocalizedName().replace("trees.species.", ""); + { + String customPrimaryTreeKey = "trees.custom.treealyzer." + type.getName() + "." + tree.getGenome().getPrimary().getUnlocalizedName().replace("trees.species.", ""); + String customSecondaryTreeKey = "trees.custom.treealyzer." + type.getName() + "." + tree.getGenome().getSecondary().getUnlocalizedName().replace("trees.species.", ""); - drawSpeciesRow(StringUtil.localize("gui.species"), tree, EnumTreeChromosome.SPECIES, checkCustomName(customPrimaryTreeKey), checkCustomName(customSecondaryTreeKey)); + drawSpeciesRow(StringUtil.localize("gui.species"), tree, EnumTreeChromosome.SPECIES, checkCustomName(customPrimaryTreeKey), checkCustomName(customSecondaryTreeKey)); + } newLine(); drawLine(StringUtil.localize("gui.saplings"), COLUMN_0);