mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-06 19:18:07 +01:00
Allow to spawn backpack for others
This commit is contained in:
parent
0fc18aca2b
commit
bb7776b065
@ -23,6 +23,7 @@
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.Permissions;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -43,7 +44,15 @@ public ShortcutCommand(Minepacks plugin, final @NotNull ItemShortcut itemShortcu
|
||||
@Override
|
||||
public void execute(@NotNull CommandSender sender, @NotNull String mainCommandAlias, @NotNull String alias, @NotNull String[] args)
|
||||
{
|
||||
itemShortcut.addItem((Player) sender);
|
||||
if (args.length == 1 && sender.hasPermission(Permissions.OTHERS))
|
||||
{
|
||||
Player p = Bukkit.getPlayer(args[0]);
|
||||
if (p != null && p.hasPermission(Permissions.USE)) itemShortcut.addItem(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
itemShortcut.addItem((Player) sender);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user