Skip to content

Commit

Permalink
Add MODID constant to entrypoint class (#102)
Browse files Browse the repository at this point in the history
Co-authored-by: JaaiDead <[email protected]>
Co-authored-by: modmuss50 <[email protected]>
  • Loading branch information
3 people authored Aug 20, 2024
1 parent 1d996ce commit cae4682
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit cae4682

Please sign in to comment.