Skip to content

Commit cae4682

Browse files
JaaiDeadJaaiDeadmodmuss50
authored
Add MODID constant to entrypoint class (#102)
Co-authored-by: JaaiDead <989309228+JaaiDead@users.noreply.github.com> Co-authored-by: modmuss50 <modmuss50@gmail.com>
1 parent 1d996ce commit cae4682

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/src/lib/template/templates/entrypoint/Entrypoint.java.eta

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import org.apache.logging.log4j.LogManager;
99
import org.apache.logging.log4j.Logger;
1010
<% } %>
1111
public class <%= it.className %> implements ModInitializer {
12+
public static final String MOD_ID = "<%= it.modid %>";
13+
1214
// This logger is used to write text to the console and the log file.
1315
// It is considered best practice to use your mod id as the logger's name.
1416
// That way, it's clear which mod wrote info, warnings, and errors.
15-
<% if (it.slf4j) { %> public static final Logger LOGGER = LoggerFactory.getLogger("<%= it.modid %>");
16-
<% } else { %> public static final Logger LOGGER = LogManager.getLogger("<%= it.modid %>");<% } %>
17+
<% if (it.slf4j) { %>public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);<% } else { %>public static final Logger LOGGER = LogManager.getLogger(MOD_ID);<% } %>
18+
1719
@Override
1820
public void onInitialize() {
1921
// This code runs as soon as Minecraft is in a mod-load-ready state.

0 commit comments

Comments
 (0)