Close inventories before opening any others

This commit is contained in:
GunfighterJ 2013-07-24 15:53:48 -05:00
parent 3cfde70ec6
commit eb22254564
3 changed files with 7 additions and 4 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}