From 0d075c158db121f02a5dd34bc3142bb891ed86bd Mon Sep 17 00:00:00 2001 From: CrazyPants Date: Tue, 29 Oct 2013 14:06:23 +0800 Subject: [PATCH] #207 Fixed '0% Chance' tool tip in NEI. --- common/crazypants/enderio/nei/SagMillRecipeHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/crazypants/enderio/nei/SagMillRecipeHandler.java b/common/crazypants/enderio/nei/SagMillRecipeHandler.java index 398d5a15..930741f7 100644 --- a/common/crazypants/enderio/nei/SagMillRecipeHandler.java +++ b/common/crazypants/enderio/nei/SagMillRecipeHandler.java @@ -87,11 +87,15 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler { @Override public List handleItemTooltip(GuiRecipe gui, ItemStack stack, List currenttip, int recipeIndex) { - // TODO Auto-generated method stub MillRecipe recipe = (MillRecipe) arecipes.get(recipeIndex); float chance = recipe.getChanceForOutput(stack); if(chance > 0 && chance < 1) { - currenttip.add((int) (chance * 100) + "% Chance"); + int chanceInt = (int) (chance * 100); + if(chanceInt == 0) { + currenttip.add("Less than 1%"); + } else { + currenttip.add(chanceInt + "% Chance"); + } } return currenttip; }