aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorILikePlayingGames <22475143+ILikePlayingGames@users.noreply.github.com>2024-07-10 22:10:19 -0400
committerILikePlayingGames <22475143+ILikePlayingGames@users.noreply.github.com>2024-07-10 22:10:19 -0400
commit661d340944f433b49b7298343ba39451bf5e78c1 (patch)
tree363029ae5fc3e25e4af9f7a1c836a3ad712e936e /src/main
parent3a60715b57d9af5ad63d20465504214979a7c85d (diff)
downloadHyPixelForgeModAPI-661d340944f433b49b7298343ba39451bf5e78c1.tar.gz
HyPixelForgeModAPI-661d340944f433b49b7298343ba39451bf5e78c1.tar.bz2
HyPixelForgeModAPI-661d340944f433b49b7298343ba39451bf5e78c1.zip
Various buildscript improvements
- Add DevAuth for logging into online mode servers (disabled by default) - Fill in mod version during build in ForgeModAPI.java - Fix gradle running out of memory during `gradlew setupDecompWorkspace` - Add some development tips to README.md - Change logging to log4j in ForgeModAPI.java
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/hypixel/modapi/forge/ForgeModAPI.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/net/hypixel/modapi/forge/ForgeModAPI.java b/src/main/java/net/hypixel/modapi/forge/ForgeModAPI.java
index c7c31c2..dfbcce8 100644
--- a/src/main/java/net/hypixel/modapi/forge/ForgeModAPI.java
+++ b/src/main/java/net/hypixel/modapi/forge/ForgeModAPI.java
@@ -20,14 +20,14 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.FMLNetworkEvent;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
@Mod(modid = ForgeModAPI.MODID, version = ForgeModAPI.VERSION, clientSideOnly = true, name = "Hypixel Mod API")
public class ForgeModAPI {
public static final String MODID = "hypixel_mod_api";
- public static final String VERSION = "1.0.0.1";
- private static final Logger LOGGER = Logger.getLogger("HypixelModAPI");
+ public static final String VERSION = "${version}";
+ private static final Logger LOGGER = LogManager.getLogger("HypixelModAPI");
// We store a local reference to the net handler, so it's instantly available from the moment we connect
private NetHandlerPlayClient netHandler;
@@ -36,6 +36,7 @@ public class ForgeModAPI {
public void init(FMLPostInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(this);
HypixelModAPI.getInstance().setPacketSender(this::sendPacket);
+ LOGGER.debug("Hypixel Mod API initialized");
}
@SubscribeEvent(priority = EventPriority.LOWEST)
@@ -55,7 +56,7 @@ public class ForgeModAPI {
}
if (!netHandler.getNetworkManager().isChannelOpen()) {
- LOGGER.warning("Attempted to send packet while channel is closed!");
+ LOGGER.warn("Attempted to send packet while channel is closed!");
netHandler = null;
return false;
}
@@ -91,7 +92,7 @@ public class ForgeModAPI {
try {
HypixelModAPI.getInstance().handle(identifier, new PacketSerializer(buffer));
} catch (Exception e) {
- LOGGER.log(Level.WARNING, "Failed to handle packet " + identifier, e);
+ LOGGER.warn("Failed to handle packet {}", identifier, e);
} finally {
buffer.release();
}