summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-12-21 03:21:35 +0000
committerKHobbits <rob@khobbits.co.uk>2012-12-21 03:21:35 +0000
commita8a8b529770765cd6e30ecbc6281e361918275c0 (patch)
treeff4173d1de5868c67fa658bcc0057e0c0151ba4a
parent226a75472cc394a2da1656e1a8874379dc028c2d (diff)
downloadEssentials-a8a8b529770765cd6e30ecbc6281e361918275c0.tar
Essentials-a8a8b529770765cd6e30ecbc6281e361918275c0.tar.gz
Essentials-a8a8b529770765cd6e30ecbc6281e361918275c0.tar.lz
Essentials-a8a8b529770765cd6e30ecbc6281e361918275c0.tar.xz
Essentials-a8a8b529770765cd6e30ecbc6281e361918275c0.zip
Swap method order on recipe
-rwxr-xr-xEssentials/src/com/earth2me/essentials/commands/Commandrecipe.java42
1 files changed, 22 insertions, 20 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java
index 721ccc857..6f1b6252e 100755
--- a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java
@@ -84,7 +84,18 @@ public class Commandrecipe extends EssentialsCommand
public void shapedRecipe(CommandSender sender, ShapedRecipe recipe)
{
Map<Character, ItemStack> recipeMap = recipe.getIngredientMap();
- if (!(sender instanceof Player))
+ if (sender instanceof Player)
+ {
+ User user = ess.getUser(sender);
+ user.setRecipeSee(true);
+ InventoryView view = user.openWorkbench(null, true);
+ for (Entry<Character, ItemStack> e : ((ShapedRecipe)recipe).getIngredientMap().entrySet())
+ {
+ view.setItem(" abcdefghi".indexOf(e.getKey()), e.getValue());
+ }
+
+ }
+ else
{
HashMap<Material, String> colorMap = new HashMap<Material, String>();
int i = 1;
@@ -116,22 +127,23 @@ public class Commandrecipe extends EssentialsCommand
}
sender.sendMessage(_("recipeWhere", s.toString()));
}
- else
+ }
+
+ public void shapelessRecipe(CommandSender sender, ShapelessRecipe recipe)
+ {
+ List<ItemStack> ingredients = recipe.getIngredientList();
+ if (sender instanceof Player)
{
User user = ess.getUser(sender);
user.setRecipeSee(true);
InventoryView view = user.openWorkbench(null, true);
- for (Entry<Character, ItemStack> e : ((ShapedRecipe)recipe).getIngredientMap().entrySet())
+ for (int i = 0; i < ingredients.size(); i++)
{
- view.setItem(" abcdefghi".indexOf(e.getKey()), e.getValue());
+ view.setItem(i + 1, ingredients.get(i));
}
- }
- }
- public void shapelessRecipe(CommandSender sender, ShapelessRecipe recipe)
- {
- List<ItemStack> ingredients = recipe.getIngredientList();
- if (!(sender instanceof Player))
+ }
+ else
{
StringBuilder s = new StringBuilder();
for (int i = 0; i < ingredients.size(); i++)
@@ -145,16 +157,6 @@ public class Commandrecipe extends EssentialsCommand
}
sender.sendMessage(_("recipeShapeless", s.toString()));
}
- else
- {
- User user = ess.getUser(sender);
- user.setRecipeSee(true);
- InventoryView view = user.openWorkbench(null, true);
- for (int i = 0; i < ingredients.size(); i++)
- {
- view.setItem(i + 1, ingredients.get(i));
- }
- }
}
public String getMaterialName(ItemStack stack)