mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 04:26:42 +00:00
- Removes ancient unused code - General code cleanup in some places - Rewrites a few components to use Adventure (testing needed) - Rewrites a few commands to use more modern Java features like Streams - Fixes oversight where vanishing still worked by names and not UUIDs - Removes unused Pterodactyl integration - Removes AutoEject's IP range banning functionality - Does some minor cleanup to HTTPD's list & players modules - Fixes ages-old bug in the AntiSpam that caused it to falsely mute players
29 lines
948 B
Java
29 lines
948 B
Java
package me.totalfreedom.totalfreedommod;
|
|
|
|
import net.kyori.adventure.text.Component;
|
|
import net.kyori.adventure.text.event.ClickEvent;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.EventPriority;
|
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
|
|
|
public class CommandSpy extends FreedomService
|
|
{
|
|
@Override
|
|
public void onStart()
|
|
{
|
|
}
|
|
|
|
@Override
|
|
public void onStop()
|
|
{
|
|
}
|
|
|
|
@EventHandler(priority = EventPriority.MONITOR)
|
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
|
{
|
|
server.getOnlinePlayers().stream().filter(player -> plugin.al.isAdmin(player)
|
|
&& plugin.al.getAdmin(player).getCommandSpy() && player != event.getPlayer()).forEach(player ->
|
|
player.sendMessage(Component.text(event.getPlayer().getName()).append(Component.text(": "))
|
|
.append(Component.text(event.getMessage()))));
|
|
}
|
|
} |