From 13a847e0ab5a453d9fe2a5b6b2e0205b60859604 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 21 Dec 2012 03:35:48 +0000 Subject: [PATCH] Fix recipe layout for small shapes --- .../com/earth2me/essentials/commands/Commandrecipe.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java index 6f1b6252e..4ea247f00 100755 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java @@ -84,14 +84,17 @@ public class Commandrecipe extends EssentialsCommand public void shapedRecipe(CommandSender sender, ShapedRecipe recipe) { Map recipeMap = recipe.getIngredientMap(); + if (sender instanceof Player) { User user = ess.getUser(sender); user.setRecipeSee(true); InventoryView view = user.openWorkbench(null, true); + String shapeMap = recipe.getShape().length == 2 ? " abecdfghi" : " abcdefghi"; for (Entry e : ((ShapedRecipe)recipe).getIngredientMap().entrySet()) - { - view.setItem(" abcdefghi".indexOf(e.getKey()), e.getValue()); + { + e.getValue().setAmount(0); + view.setItem(shapeMap.indexOf(e.getKey()), e.getValue()); } }