From d190ab273e45711c09b85580f648985a8c5137df Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Tue, 14 Mar 2023 21:56:48 -0700 Subject: [PATCH] Refactored logger and constants --- .../java/io/github/ytg1234/packetignore/PacketIgnore.java | 8 ++++---- .../ytg1234/packetignore/mixin/ClientConnectionMixin.java | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/ytg1234/packetignore/PacketIgnore.java b/src/main/java/io/github/ytg1234/packetignore/PacketIgnore.java index 958bbec..b06b66f 100644 --- a/src/main/java/io/github/ytg1234/packetignore/PacketIgnore.java +++ b/src/main/java/io/github/ytg1234/packetignore/PacketIgnore.java @@ -5,13 +5,13 @@ import org.slf4j.LoggerFactory; public class PacketIgnore implements ModInitializer { - public static String MOD_ID = "packetignore"; - public static String MOD_NAME = "Packet Ignore"; - public static Logger logger = LoggerFactory.getLogger(MOD_ID); + public static final String MOD_ID = "packetignore"; + public static final String MOD_NAME = "Packet Ignore"; + public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); @Override public void onInitialize() { - logger.info(MOD_NAME + " initialized."); + LOGGER.info(MOD_NAME + " initialized."); } } diff --git a/src/main/java/io/github/ytg1234/packetignore/mixin/ClientConnectionMixin.java b/src/main/java/io/github/ytg1234/packetignore/mixin/ClientConnectionMixin.java index f7bc903..3626ede 100644 --- a/src/main/java/io/github/ytg1234/packetignore/mixin/ClientConnectionMixin.java +++ b/src/main/java/io/github/ytg1234/packetignore/mixin/ClientConnectionMixin.java @@ -1,5 +1,6 @@ package io.github.ytg1234.packetignore.mixin; +import io.github.ytg1234.packetignore.PacketIgnore; import net.minecraft.network.ClientConnection; import net.minecraft.network.NetworkSide; import net.minecraft.network.packet.Packet; @@ -34,7 +35,7 @@ private static void handlePacket(Packet packet, Pa private void packetignore_ignorePackets(Packet packet, PacketListener listener) { if (packet instanceof HandshakeC2SPacket || packet instanceof LoginHelloC2SPacket || packet instanceof LoginKeyC2SPacket || packet instanceof LoginQueryResponseC2SPacket) { handlePacket(packet, listener); - System.out.println("Handshake or login received"); + PacketIgnore.LOGGER.info("Handshake or login received"); return; } if (side == NetworkSide.CLIENTBOUND) {