Search in sources :

Example 1 with ViaPlatform

use of com.viaversion.viaversion.api.platform.ViaPlatform in project ViaVersion by ViaVersion.

the class ProtocolPipelineImpl method logPacket.

private void logPacket(Direction direction, State state, PacketWrapper packetWrapper, int originalID) {
    // Debug packet
    int clientProtocol = userConnection.getProtocolInfo().getProtocolVersion();
    ViaPlatform platform = Via.getPlatform();
    String actualUsername = packetWrapper.user().getProtocolInfo().getUsername();
    String username = actualUsername != null ? actualUsername + " " : "";
    platform.getLogger().log(Level.INFO, "{0}{1} {2}: {3} (0x{4}) -> {5} (0x{6}) [{7}] {8}", new Object[] { username, direction, state, originalID, Integer.toHexString(originalID), packetWrapper.getId(), Integer.toHexString(packetWrapper.getId()), Integer.toString(clientProtocol), packetWrapper });
}
Also used : ViaPlatform(com.viaversion.viaversion.api.platform.ViaPlatform)

Aggregations

ViaPlatform (com.viaversion.viaversion.api.platform.ViaPlatform)1