Skip to content

Commit

Permalink
Add permission for AFK command
Browse files Browse the repository at this point in the history
  • Loading branch information
LegendEffects committed Jul 29, 2020
1 parent 4d279d7 commit 8806415
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>co.uk.legendeffects</groupId>
<artifactId>openafk</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
<packaging>jar</packaging>

<name>OpenAFK</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public boolean onCommand(CommandSender sender, Command command, String label, St

Player player = (Player) sender;

if(!player.hasPermission("openafk.afk")) {
sender.sendMessage(OpenAFK.parse(player, plugin.getConfig().getString("messages.insufficientPermissions")));
return true;
}

if(plugin.isAfkPlayer(player)) {
plugin.makePlayerReturn(player, ActionType.RETURN_BY_COMMAND, "onReturnCMD");
return true;
Expand Down

0 comments on commit 8806415

Please sign in to comment.