1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-17 20:11:21 +02:00

Close inventories before opening any others

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

View File

@@ -17,11 +17,13 @@ public class Commandenderchest extends EssentialsCommand
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

@@ -13,7 +13,6 @@ public class Commandinvsee extends EssentialsCommand
}
//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();