From de5bb76f56706df172db483c4c08169eb84f0c3a Mon Sep 17 00:00:00 2001 From: mezz Date: Mon, 23 Nov 2015 11:43:58 -0800 Subject: [PATCH] minor cleanup --- src/main/java/mezz/jei/ItemRegistry.java | 4 ++-- src/main/java/mezz/jei/RecipeRegistry.java | 8 ++++---- src/main/java/mezz/jei/gui/RecipesGui.java | 3 ++- src/main/java/mezz/jei/util/ItemStackElement.java | 2 +- src/main/java/mezz/jei/util/StackUtil.java | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/mezz/jei/ItemRegistry.java b/src/main/java/mezz/jei/ItemRegistry.java index 3173f2050..6a33f7783 100644 --- a/src/main/java/mezz/jei/ItemRegistry.java +++ b/src/main/java/mezz/jei/ItemRegistry.java @@ -86,7 +86,7 @@ private void addBlockAndSubBlocks(@Nullable Block block, @Nonnull List recipes) { IRecipeHandler recipeHandler = getRecipeHandler(recipeClass); if (recipeHandler == null) { - Log.debug("Can't handle recipe: " + recipe); + Log.debug("Can't handle recipe: %s", recipe); continue; } Class recipeCategoryClass = recipeHandler.getRecipeCategoryClass(); IRecipeCategory recipeCategory = recipeCategoriesMap.getInstance(recipeCategoryClass); if (recipeCategory == null) { - Log.error("No recipe category registered for recipeCategoryClass: " + recipeCategoryClass); + Log.error("No recipe category registered for recipeCategoryClass: %s", recipeCategoryClass); continue; } @@ -145,7 +145,7 @@ public ImmutableList getRecipeCategoriesWithInput(@Nullable Ite @Nonnull @Override - public ImmutableList getRecipeCategoriesWithInput(Fluid input) { + public ImmutableList getRecipeCategoriesWithInput(@Nullable Fluid input) { if (input == null) { return ImmutableList.of(); } @@ -163,7 +163,7 @@ public ImmutableList getRecipeCategoriesWithOutput(@Nullable It @Nonnull @Override - public ImmutableList getRecipeCategoriesWithOutput(Fluid output) { + public ImmutableList getRecipeCategoriesWithOutput(@Nullable Fluid output) { if (output == null) { return ImmutableList.of(); } diff --git a/src/main/java/mezz/jei/gui/RecipesGui.java b/src/main/java/mezz/jei/gui/RecipesGui.java index 2480e48fc..64ea18e3e 100644 --- a/src/main/java/mezz/jei/gui/RecipesGui.java +++ b/src/main/java/mezz/jei/gui/RecipesGui.java @@ -311,7 +311,7 @@ private void updateLayout() { Object recipe = recipes.get(recipeIndex); IRecipeHandler recipeHandler = JEIManager.recipeRegistry.getRecipeHandler(recipe.getClass()); if (recipeHandler == null) { - Log.error("Couldn't find recipe handler for recipe: " + recipe); + Log.error("Couldn't find recipe handler for recipe: %s", recipe); continue; } @@ -319,6 +319,7 @@ private void updateLayout() { recipeWidget.setPosition(posX, posY); posY += recipeBackground.getHeight() + recipeSpacing; + @SuppressWarnings("unchecked") IRecipeWrapper recipeWrapper = recipeHandler.getRecipeWrapper(recipe); recipeWidget.setRecipe(recipeWrapper, focusStack); recipeWidgets.add(recipeWidget); diff --git a/src/main/java/mezz/jei/util/ItemStackElement.java b/src/main/java/mezz/jei/util/ItemStackElement.java index de99097b0..494584fd7 100644 --- a/src/main/java/mezz/jei/util/ItemStackElement.java +++ b/src/main/java/mezz/jei/util/ItemStackElement.java @@ -20,7 +20,7 @@ public static ItemStackElement create(@Nonnull ItemStack itemStack) { try { return new ItemStackElement(itemStack); } catch (RuntimeException e) { - Log.warning("Found broken itemStack: " + e); + Log.warning("Found broken itemStack: %s", e); return null; } } diff --git a/src/main/java/mezz/jei/util/StackUtil.java b/src/main/java/mezz/jei/util/StackUtil.java index 4e8277b68..c82c616e8 100644 --- a/src/main/java/mezz/jei/util/StackUtil.java +++ b/src/main/java/mezz/jei/util/StackUtil.java @@ -119,7 +119,7 @@ private static void getAllSubtypes(List subtypesList, Iterable stacks } else if (obj instanceof Iterable) { getAllSubtypes(subtypesList, (Iterable) obj); } else if (obj != null) { - Log.error("Unknown object found: " + obj); + Log.error("Unknown object found: %s", obj); } } } @@ -141,7 +141,7 @@ private static void toItemStackList(@Nonnull List itemStackList, @Non } else if (obj instanceof ItemStack) { itemStackList.add((ItemStack) obj); } else if (obj != null) { - Log.error("Unknown object found: " + obj); + Log.error("Unknown object found: %s", obj); } } }