mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-06-24 13:45:04 +02:00
Close inventories before opening any others
This commit is contained in:
parent
3cfde70ec6
commit
eb22254564
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user