Skip to content

Commit

Permalink
Update StackerCommand.java
Browse files Browse the repository at this point in the history
Signed-off-by: Zoey <[email protected]>
  • Loading branch information
Zoey2936 authored Jan 18, 2024
1 parent e96233f commit 5a43601
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/main/java/de/zoeyvid/stacker/StackerCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,18 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}
Player player = (Player) sender;
if (args.length == 0) {
if (player.hasPermission("stacker.use.self")) {
if (main.getStackmode().contains(player)) {
main.getStackmode().remove(player);
player.sendMessage(main.getPrefix() + ChatColor.WHITE + loadLanguage.leaveStackmode());
return true;
if (player.hasPermission("stacker.immune.self")) {
if (main.getDisabled().contains(player)) {
main.getDisabled().remove(player);
player.sendMessage(main.getPrefix() + ChatColor.WHITE + loadLanguage.leaveImmune());
} else {
main.getStackmode().add(player);
player.sendMessage(main.getPrefix() + ChatColor.WHITE + loadLanguage.joinStackmode());
return true;
main.getDisabled().add(player);
player.sendMessage(main.getPrefix() + ChatColor.WHITE + loadLanguage.joinImmune());
}
} else {
player.sendMessage(main.getPrefix() + ChatColor.DARK_RED + loadLanguage.permissionError().replace("%permission%", "stacker.use.self"));
return true;
player.sendMessage(main.getPrefix() + ChatColor.DARK_RED + loadLanguage.permissionError().replace("%permission%", "stacker.immune.self"));
}
return true;
} else if (args.length == 1) {
if (args[0].equalsIgnoreCase("enable") || args[0].equalsIgnoreCase("disable") || args[0].equalsIgnoreCase("toggle")) {
if (player.hasPermission("stacker.use.self")) {
Expand Down

0 comments on commit 5a43601

Please sign in to comment.