diff --git a/src/main/resources/assets/neiaddons/lang/en_US.lang b/src/main/resources/assets/neiaddons/lang/en_US.lang index 270f608..fef35f4 100644 --- a/src/main/resources/assets/neiaddons/lang/en_US.lang +++ b/src/main/resources/assets/neiaddons/lang/en_US.lang @@ -3,6 +3,7 @@ bdew.neiaddons.exnihilo=Ex Nihilo bdew.neiaddons.breeding.beebreeding=Bee Breeding bdew.neiaddons.produce.beeproduce=Bee Produce +bdew.neiaddons.breeding.mutationchance=Precise Mutation Chance bdew.neiaddons.breeding.treebreeding=Tree Breeding bdew.neiaddons.produce.treeproduce=Tree Produce diff --git a/src/main/scala/net/bdew/neiaddons/forestry/BaseBreedingRecipeHandler.java b/src/main/scala/net/bdew/neiaddons/forestry/BaseBreedingRecipeHandler.java index 9cd0582..abbc3ce 100644 --- a/src/main/scala/net/bdew/neiaddons/forestry/BaseBreedingRecipeHandler.java +++ b/src/main/scala/net/bdew/neiaddons/forestry/BaseBreedingRecipeHandler.java @@ -183,12 +183,20 @@ public void drawExtras(int recipe) { rec.result.drawLabel(); rec.parrent1.drawLabel(); rec.parrent2.drawLabel(); + + String chanceText; + if (rec.chance < 1) { + chanceText = "<1%"; + } else { + chanceText = String.format("%.0f%%", rec.chance); + } + if (rec.derp) { - Utils.drawCenteredString(EnumChatFormatting.OBFUSCATED + "DERP", 108, 15, 0xFF0000); - } else if (rec.requirements.size() > 0 && AddonForestry.showReqs) { - Utils.drawCenteredString(String.format("[%.0f%%]", rec.chance), 108, 15, 0xFF0000); + Utils.drawCenteredString(EnumChatFormatting.OBFUSCATED + "DERP", 108, 15, 0xFF0000); // RED + } else if (!rec.requirements.isEmpty() && AddonForestry.showReqs) { + Utils.drawCenteredString("[" + chanceText + "]", 108, 15, 0xFF0000); // RED } else { - Utils.drawCenteredString(String.format("%.0f%%", rec.chance), 108, 15, 0xFFFFFF); + Utils.drawCenteredString(chanceText, 108, 15, 0xFFFFFF); } } @@ -202,15 +210,16 @@ public String getGuiTexture() { @Override public List handleTooltip(GuiRecipe gui, List currenttip, int recipe) { CachedBreedingRecipe rec = (CachedBreedingRecipe) arecipes.get(recipe); - if (AddonForestry.showReqs && rec.requirements.size() > 0 + if (AddonForestry.showReqs && !rec.requirements.isEmpty() && GuiContainerManager.shouldShowTooltip(gui) - && currenttip.size() == 0) { + && currenttip.isEmpty()) { Point offset = gui.getRecipePosition(recipe); Point pos = GuiDraw.getMousePosition(); Point relMouse = new Point(pos.x - gui.guiLeft - offset.x, pos.y - gui.guiTop - offset.y); Rectangle tiprect = new Rectangle(108 - 24, 15 - 2, 48, 12); if (tiprect.contains(relMouse)) { currenttip.addAll(rec.requirements); + currenttip.add(I18n.format("bdew.neiaddons.breeding.mutationchance") + ": " + rec.chance + "%"); return currenttip; } }