Skip to content

Commit

Permalink
Gui permission semantic changes under certain conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Esophose committed Jul 16, 2019
1 parent 063de34 commit 795da31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public String getArguments() {
}

public boolean requiresEffects() {
return true;
return false;
}

public boolean canConsoleExecute() {
Expand Down
12 changes: 5 additions & 7 deletions src/com/esophose/playerparticles/command/GUICommandModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ public void onCommandExecute(PPlayer pplayer, String[] args) {
}
return;
}

if (PSetting.GUI_PRESETS_ONLY.getBoolean() && ParticleGroupPresetManager.getPresetGroupsForPlayer(pplayer.getPlayer()).isEmpty()) {
return;
} else if (PermissionManager.getEffectNamesUserHasPermissionFor(pplayer.getPlayer()).isEmpty()) {

if (!PSetting.GUI_PRESETS_ONLY.getBoolean() && PermissionManager.getEffectNamesUserHasPermissionFor(pplayer.getPlayer()).isEmpty()) {
if (byDefault) {
LangManager.sendMessage(pplayer, Lang.COMMAND_ERROR_UNKNOWN);
} else {
LangManager.sendMessage(pplayer, Lang.COMMAND_ERROR_NO_EFFECTS);
} else {
LangManager.sendMessage(pplayer, Lang.COMMAND_ERROR_UNKNOWN);
}
return;
}
Expand All @@ -59,7 +57,7 @@ public String getArguments() {
}

public boolean requiresEffects() {
return true;
return false;
}

public boolean canConsoleExecute() {
Expand Down

0 comments on commit 795da31

Please sign in to comment.