mirror of
https://github.com/funkemunky/KauriV3.git
synced 2026-06-12 11:00:37 +00:00
Updating commands and Packet API
- Added wrapper for PacketHandshakeInSetProtocol - Took ProtocolAPI from Atlas to implement ViaVersion and ProtocolSupport version checking hooks. - Added hook into "Login" style packets. - Wth this new hook, we get player version numbers and store them by Channel now. - Packets are now initialized in the same join listener as where APlayer is generated in JoinListener class. - Removed Listener extension from HandlerAbstract, ModernHandler, LegacvHandler NOTE: Protocol version grabbing needs implemented for LegacyHandler (1.7.10 version)
This commit is contained in:
@@ -18,7 +18,7 @@ import java.util.Comparator;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Init(priority = Priority.LOW)
|
||||
@CommandAlias("anticheat")
|
||||
@CommandAlias("anticheat|ac")
|
||||
@CommandPermission("anticheat.command")
|
||||
public class AnticheatCommand extends BaseCommand {
|
||||
|
||||
@@ -74,4 +74,25 @@ public class AnticheatCommand extends BaseCommand {
|
||||
pl.spigot().sendMessage(Messages.ALERTS_ON);
|
||||
}
|
||||
}
|
||||
|
||||
@Subcommand("playerinfo|info|pi")
|
||||
@Description("Get player's information")
|
||||
@Syntax("[player]")
|
||||
@CommandCompletion("@players")
|
||||
@CommandPermission("anticheat.command.info")
|
||||
public void onCommand(CommandSender sender, @Single Player target) {
|
||||
Anticheat.INSTANCE.getScheduler().execute(() -> {
|
||||
APlayer player = Anticheat.INSTANCE.getPlayerRegistry().getPlayer(target.getUniqueId()).orElse(null);
|
||||
|
||||
if(player == null) {
|
||||
sender.spigot().sendMessage(Messages.NULL_APLAYER);
|
||||
return;
|
||||
}
|
||||
|
||||
sender.sendMessage(MiscUtils.line(Color.Dark_Gray));
|
||||
sender.sendMessage(Color.translate("&6&lPing&8: &f" + player.getLagInfo().getTransPing() * 50 + "ms"));
|
||||
sender.sendMessage(Color.translate("&6&lVersion&8: &f" + player.getPlayerVersion().name()));
|
||||
sender.sendMessage(MiscUtils.line(Color.Dark_Gray));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user