summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-12-21 03:35:48 +0000
committerKHobbits <rob@khobbits.co.uk>2012-12-21 03:35:48 +0000
commit13a847e0ab5a453d9fe2a5b6b2e0205b60859604 (patch)
treed83dd19c17716e9f11c38209b80368dc479f801c
parenta8a8b529770765cd6e30ecbc6281e361918275c0 (diff)
downloadEssentials-13a847e0ab5a453d9fe2a5b6b2e0205b60859604.tar
Essentials-13a847e0ab5a453d9fe2a5b6b2e0205b60859604.tar.gz
Essentials-13a847e0ab5a453d9fe2a5b6b2e0205b60859604.tar.lz
Essentials-13a847e0ab5a453d9fe2a5b6b2e0205b60859604.tar.xz
Essentials-13a847e0ab5a453d9fe2a5b6b2e0205b60859604.zip
Fix recipe layout for small shapes
-rwxr-xr-xEssentials/src/com/earth2me/essentials/commands/Commandrecipe.java7
1 files 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<Character, ItemStack> 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<Character, ItemStack> 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());
}
}