diff options
author | KHobbits <rob@khobbits.co.uk> | 2014-06-04 16:13:20 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2014-06-04 16:13:20 +0100 |
commit | b7d322471aceed6f02432d869804fe1392af587f (patch) | |
tree | fa6bc0aeb09f7a6c5e121e3d903d06855f929c12 | |
parent | c50ca9041bab73ba07b96578f82bfd77b389eae6 (diff) | |
download | Essentials-b7d322471aceed6f02432d869804fe1392af587f.tar Essentials-b7d322471aceed6f02432d869804fe1392af587f.tar.gz Essentials-b7d322471aceed6f02432d869804fe1392af587f.tar.lz Essentials-b7d322471aceed6f02432d869804fe1392af587f.tar.xz Essentials-b7d322471aceed6f02432d869804fe1392af587f.zip |
Fix firework recipe in /recipe
-rwxr-xr-x | Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java index 3c2a69fa0..ec4fa896f 100755 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java @@ -63,11 +63,22 @@ public class Commandrecipe extends EssentialsCommand }
else if (selectedRecipe instanceof ShapedRecipe)
{
- shapedRecipe(sender, (ShapedRecipe)selectedRecipe);
+ shapedRecipe(sender, (ShapedRecipe)selectedRecipe, sender.isPlayer());
}
else if (selectedRecipe instanceof ShapelessRecipe)
{
- shapelessRecipe(sender, (ShapelessRecipe)selectedRecipe);
+ if (recipesOfType.size() == 1 && itemType.getType() == Material.FIREWORK)
+ {
+ ShapelessRecipe shapelessRecipe = new ShapelessRecipe(itemType);
+ shapelessRecipe.addIngredient(Material.SULPHUR);
+ shapelessRecipe.addIngredient(Material.PAPER);
+ shapelessRecipe.addIngredient(Material.FIREWORK_CHARGE);
+ shapelessRecipe(sender, shapelessRecipe, sender.isPlayer());
+ }
+ else
+ {
+ shapelessRecipe(sender, (ShapelessRecipe)selectedRecipe, sender.isPlayer());
+ }
}
if (recipesOfType.size() > 1 && args.length == 1)
@@ -81,11 +92,11 @@ public class Commandrecipe extends EssentialsCommand sender.sendMessage(tl("recipeFurnace", getMaterialName(recipe.getInput())));
}
- public void shapedRecipe(final CommandSource sender, final ShapedRecipe recipe)
+ public void shapedRecipe(final CommandSource sender, final ShapedRecipe recipe, final boolean showWindow)
{
final Map<Character, ItemStack> recipeMap = recipe.getIngredientMap();
- if (sender.isPlayer())
+ if (showWindow)
{
final User user = ess.getUser(sender.getPlayer());
user.getBase().closeInventory();
@@ -141,10 +152,10 @@ public class Commandrecipe extends EssentialsCommand }
}
- public void shapelessRecipe(final CommandSource sender, final ShapelessRecipe recipe)
+ public void shapelessRecipe(final CommandSource sender, final ShapelessRecipe recipe, final boolean showWindow)
{
final List<ItemStack> ingredients = recipe.getIngredientList();
- if (sender.isPlayer())
+ if (showWindow)
{
final User user = ess.getUser(sender.getPlayer());
user.setRecipeSee(true);
|