summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunfighterJ <joseph.jenniges@gmail.com>2013-07-24 15:53:48 -0500
committerGunfighterJ <joseph.jenniges@gmail.com>2013-07-24 16:01:17 -0500
commiteb222545642ccf31aabe346f30d2cbe47f5d10a9 (patch)
tree0be76b9401e27dbfb83b2416f5ba38584c04d067
parent3cfde70ec6b361604f866dafdb4854f1c662dbcb (diff)
downloadEssentials-eb222545642ccf31aabe346f30d2cbe47f5d10a9.tar
Essentials-eb222545642ccf31aabe346f30d2cbe47f5d10a9.tar.gz
Essentials-eb222545642ccf31aabe346f30d2cbe47f5d10a9.tar.lz
Essentials-eb222545642ccf31aabe346f30d2cbe47f5d10a9.tar.xz
Essentials-eb222545642ccf31aabe346f30d2cbe47f5d10a9.zip
Close inventories before opening any others
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandenderchest.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java4
-rwxr-xr-xEssentials/src/com/earth2me/essentials/commands/Commandrecipe.java3
3 files changed, 7 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandenderchest.java b/Essentials/src/com/earth2me/essentials/commands/Commandenderchest.java
index d256e9786..829eeefb1 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandenderchest.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandenderchest.java
@@ -13,15 +13,17 @@ public class Commandenderchest extends EssentialsCommand
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
- {
+ {
if (args.length > 0 && user.isAuthorized("essentials.enderchest.others"))
{
final User invUser = getPlayer(server, user, args, 0);
+ user.closeInventory();
user.openInventory(invUser.getEnderChest());
user.setEnderSee(true);
}
else
{
+ user.closeInventory();
user.openInventory(user.getEnderChest());
user.setEnderSee(false);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java
index c993217c1..368a03a74 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java
@@ -11,9 +11,8 @@ public class Commandinvsee extends EssentialsCommand
{
super("invsee");
}
-
- //This method has a hidden param, which if given will display the equip slots. #easteregg
+ //This method has a hidden param, which if given will display the equip slots. #easteregg
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
@@ -34,6 +33,7 @@ public class Commandinvsee extends EssentialsCommand
{
inv = invUser.getInventory();
}
+ user.closeInventory();
user.openInventory(inv);
user.setInvSee(true);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java
index 5284a5cae..6661233ac 100755
--- a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java
@@ -89,6 +89,7 @@ public class Commandrecipe extends EssentialsCommand
if (sender instanceof Player)
{
final User user = ess.getUser(sender);
+ user.closeInventory();
user.setRecipeSee(true);
final InventoryView view = user.openWorkbench(null, true);
final String[] recipeShape = recipe.getShape();
@@ -98,7 +99,7 @@ public class Commandrecipe extends EssentialsCommand
for (int k = 0; k < recipeShape[j].length(); k++)
{
final ItemStack item = ingredientMap.get(recipeShape[j].toCharArray()[k]);
- if(item == null)
+ if (item == null)
{
continue;
}