mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-07 19:28:11 +01:00
Fix issues with open command
This commit is contained in:
parent
3617d5f5b9
commit
d1ca2796dc
@ -28,6 +28,7 @@
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -95,8 +96,13 @@ public void execute(@NotNull CommandSender sender, @NotNull String main, @NotNul
|
||||
{
|
||||
if(player.hasPermission(Permissions.OTHERS))
|
||||
{
|
||||
//noinspection deprecation
|
||||
plugin.openBackpack(player, Bukkit.getOfflinePlayer(args[0]), player.hasPermission(Permissions.OTHERS_EDIT));
|
||||
OfflinePlayer target = Bukkit.getPlayer(args[0]);
|
||||
if(target == null)
|
||||
{
|
||||
//noinspection deprecation
|
||||
target = Bukkit.getOfflinePlayer(args[0]);
|
||||
}
|
||||
plugin.openBackpack(player, target, player.hasPermission(Permissions.OTHERS_EDIT));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user