mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-25 07:59:44 +00:00
Test for updateActivity all the time in PlayerCommandPreprocessEvent.
This commit is contained in:
parent
7809615896
commit
ba5ce33464
1 changed files with 16 additions and 16 deletions
|
@ -384,25 +384,25 @@ public class EssentialsPlayerListener implements Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
boolean broadcast = true; // whether to broadcast the updated activity
|
|
||||||
boolean update = true; // Only modified when the command is afk
|
boolean broadcast = true; // whether to broadcast the updated activity
|
||||||
|
boolean update = true; // Only modified when the command is afk
|
||||||
|
|
||||||
PluginCommand pluginCommand = ess.getServer().getPluginCommand(cmd);
|
PluginCommand pluginCommand = ess.getServer().getPluginCommand(cmd);
|
||||||
if (pluginCommand != null) {
|
if (pluginCommand != null) {
|
||||||
// Switch case for commands that shouldn't broadcast afk activity.
|
// Switch case for commands that shouldn't broadcast afk activity.
|
||||||
switch (pluginCommand.getName()) {
|
switch (pluginCommand.getName()) {
|
||||||
case "afk":
|
case "afk":
|
||||||
update = false;
|
update = false;
|
||||||
case "vanish":
|
case "vanish":
|
||||||
broadcast = false;
|
broadcast = false;
|
||||||
}
|
|
||||||
}
|
|
||||||
if (update) {
|
|
||||||
final User user = ess.getUser(player);
|
|
||||||
user.updateActivity(broadcast);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (update) {
|
||||||
|
final User user = ess.getUser(player);
|
||||||
|
user.updateActivity(broadcast);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
|
|
Loading…
Reference in a new issue