Skip to content

Commit

Permalink
fix as_op silent
Browse files Browse the repository at this point in the history
Because morph wasn't paying attention
  • Loading branch information
mcmonkey4eva committed Jun 20, 2015
1 parent 47fdad6 commit bbf3289
Showing 1 changed file with 16 additions and 5 deletions.
Expand Up @@ -105,12 +105,14 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
if (!pcpe.isCancelled()) {
boolean silentBool = silent.asBoolean();
Player player = ((BukkitScriptEntryData) scriptEntry.entryData).getPlayer().getPlayerEntity();
if (silentBool)
if (silentBool) {
silencedPlayers.add(player.getUniqueId());
}
player.performCommand(pcpe.getMessage().startsWith("/") ?
pcpe.getMessage().substring(1) : pcpe.getMessage());
if (silentBool)
if (silentBool) {
silencedPlayers.remove(player.getUniqueId());
}
}
}
catch (Throwable e) {
Expand All @@ -125,9 +127,18 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
try {
PlayerCommandPreprocessEvent pcpe = new PlayerCommandPreprocessEvent(((BukkitScriptEntryData)scriptEntry.entryData).getPlayer().getPlayerEntity(), "/" + command);
Bukkit.getPluginManager().callEvent(pcpe);
if (!pcpe.isCancelled())
((BukkitScriptEntryData)scriptEntry.entryData).getPlayer().getPlayerEntity().performCommand(
pcpe.getMessage().startsWith("/") ? pcpe.getMessage().substring(1): pcpe.getMessage());
if (!pcpe.isCancelled()) {
boolean silentBool = silent.asBoolean();
Player player = ((BukkitScriptEntryData) scriptEntry.entryData).getPlayer().getPlayerEntity();
if (silentBool) {
silencedPlayers.add(player.getUniqueId());
}
player.performCommand(pcpe.getMessage().startsWith("/") ?
pcpe.getMessage().substring(1) : pcpe.getMessage());
if (silentBool) {
silencedPlayers.remove(player.getUniqueId());
}
}
}
catch (Throwable e) {
dB.echoError(scriptEntry.getResidingQueue(), "Exception while executing command as OP.");
Expand Down

0 comments on commit bbf3289

Please sign in to comment.