Skip to content

Commit

Permalink
Refactored logger and constants
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthegreat1 committed Mar 15, 2023
1 parent 0cdf1e8 commit d190ab2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}

Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -34,7 +35,7 @@ private static <T extends PacketListener> void handlePacket(Packet<T> 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) {
Expand Down

0 comments on commit d190ab2

Please sign in to comment.