mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Merge pull request #2350 from TheSilentPro/backpack-changes
Separate player-only and no-permission messages
This commit is contained in:
commit
dc551907d2
@ -26,11 +26,8 @@ class BackpackCommand extends SubCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(CommandSender sender, String[] args) {
|
public void onExecute(CommandSender sender, String[] args) {
|
||||||
if (!(sender instanceof Player) || !sender.hasPermission("slimefun.command.backpack")) {
|
if (sender instanceof Player) {
|
||||||
SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true);
|
if (sender.hasPermission("slimefun.command.backpack")) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args.length != 3) {
|
if (args.length != 3) {
|
||||||
SlimefunPlugin.getLocalization().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf backpack <Player> <ID>"));
|
SlimefunPlugin.getLocalization().sendMessage(sender, "messages.usage", true, msg -> msg.replace("%usage%", "/sf backpack <Player> <ID>"));
|
||||||
return;
|
return;
|
||||||
@ -65,4 +62,12 @@ class BackpackCommand extends SubCommand {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user