Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Nov 23, 2015
1 parent d0a5628 commit de5bb76
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/java/mezz/jei/ItemRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void addBlockAndSubBlocks(@Nullable Block block, @Nonnull List<ItemStack
if (item == null) {
ItemStack stack = new ItemStack(block);
if (stack.getItem() == null) {
Log.debug("Couldn't get itemStack for block: " + block.getUnlocalizedName());
Log.debug("Couldn't get itemStack for block: %s", block.getUnlocalizedName());
return;
}
addItemStack(stack, itemList, fuels);
Expand All @@ -102,7 +102,7 @@ private void addBlockAndSubBlocks(@Nullable Block block, @Nonnull List<ItemStack
if (subItems.isEmpty()) {
ItemStack stack = new ItemStack(block);
if (stack.getItem() == null) {
Log.debug("Couldn't get itemStack for block: " + block.getUnlocalizedName());
Log.debug("Couldn't get itemStack for block: %s", block.getUnlocalizedName());
return;
}
addItemStack(stack, itemList, fuels);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/mezz/jei/RecipeRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ private void addRecipes(@Nullable ImmutableList<Object> 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;
}

Expand Down Expand Up @@ -145,7 +145,7 @@ public ImmutableList<IRecipeCategory> getRecipeCategoriesWithInput(@Nullable Ite

@Nonnull
@Override
public ImmutableList<IRecipeCategory> getRecipeCategoriesWithInput(Fluid input) {
public ImmutableList<IRecipeCategory> getRecipeCategoriesWithInput(@Nullable Fluid input) {
if (input == null) {
return ImmutableList.of();
}
Expand All @@ -163,7 +163,7 @@ public ImmutableList<IRecipeCategory> getRecipeCategoriesWithOutput(@Nullable It

@Nonnull
@Override
public ImmutableList<IRecipeCategory> getRecipeCategoriesWithOutput(Fluid output) {
public ImmutableList<IRecipeCategory> getRecipeCategoriesWithOutput(@Nullable Fluid output) {
if (output == null) {
return ImmutableList.of();
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/mezz/jei/gui/RecipesGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,15 @@ 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;
}

RecipeWidget recipeWidget = new RecipeWidget(recipeCategory);
recipeWidget.setPosition(posX, posY);
posY += recipeBackground.getHeight() + recipeSpacing;

@SuppressWarnings("unchecked")
IRecipeWrapper recipeWrapper = recipeHandler.getRecipeWrapper(recipe);
recipeWidget.setRecipe(recipeWrapper, focusStack);
recipeWidgets.add(recipeWidget);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mezz/jei/util/ItemStackElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mezz/jei/util/StackUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private static void getAllSubtypes(List<ItemStack> 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);
}
}
}
Expand All @@ -141,7 +141,7 @@ private static void toItemStackList(@Nonnull List<ItemStack> 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);
}
}
}
Expand Down

0 comments on commit de5bb76

Please sign in to comment.