diff --git a/scripts/src/lib/template/templates/entrypoint/Entrypoint.java.eta b/scripts/src/lib/template/templates/entrypoint/Entrypoint.java.eta index db1a470c..269d52d5 100644 --- a/scripts/src/lib/template/templates/entrypoint/Entrypoint.java.eta +++ b/scripts/src/lib/template/templates/entrypoint/Entrypoint.java.eta @@ -9,11 +9,13 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; <% } %> public class <%= it.className %> implements ModInitializer { + public static final String MOD_ID = "<%= it.modid %>"; + // This logger is used to write text to the console and the log file. // It is considered best practice to use your mod id as the logger's name. // That way, it's clear which mod wrote info, warnings, and errors. -<% if (it.slf4j) { %> public static final Logger LOGGER = LoggerFactory.getLogger("<%= it.modid %>"); -<% } else { %> public static final Logger LOGGER = LogManager.getLogger("<%= it.modid %>");<% } %> + <% if (it.slf4j) { %>public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);<% } else { %>public static final Logger LOGGER = LogManager.getLogger(MOD_ID);<% } %> + @Override public void onInitialize() { // This code runs as soon as Minecraft is in a mod-load-ready state.