Skip to content

Commit

Permalink
LOGGERの名前指定&リファクタリング
Browse files Browse the repository at this point in the history
  • Loading branch information
KatatsumuriPan committed Feb 16, 2024
1 parent 550e156 commit fdbaa2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/kpan/b_line_break/ModMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import org.apache.logging.log4j.Logger;

// The value here should match an entry in the META-INF/mods.toml file
@Mod(ModReference.MOD_ID)
@Mod(ModReference.MODID)
public class ModMain {
// Directly reference a log4j logger.
public static final Logger LOGGER = LogManager.getLogger();
public static final Logger LOGGER = LogManager.getLogger(ModReference.MODNAME);

public ModMain() {

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/kpan/b_line_break/ModReference.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package kpan.b_line_break;

public class ModReference {
public static final String MOD_ID = "better_line_break";
public static final String MODID = "better_line_break";
public static final String MODNAME = "better_line_break";
}
4 changes: 2 additions & 2 deletions src/main/java/kpan/b_line_break/config/ConfigEntries.java
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public PropertyEntry(ConfigScreen configScreen, ConfigEntries owningEntryList, C
comment = ConfigUtil.getComment(configScreen.forgeConfigSpec, configValue);

toolTip.add(name.copy().withStyle(TextFormatting.GREEN));
String tooltip = I18n.get("config." + ModReference.MOD_ID + "." + StringUtils.join(configValue.getPath(), '.') + ".tooltip").replace("\\n", "\n");
String tooltip = I18n.get("config." + ModReference.MODID + "." + StringUtils.join(configValue.getPath(), '.') + ".tooltip").replace("\\n", "\n");
if (I18n.exists(tooltip))
toolTip.addAll(TextComponentUtil.splitLines(new StringTextComponent(tooltip).withStyle(TextFormatting.YELLOW)));
else if (comment != null)
Expand Down Expand Up @@ -555,7 +555,7 @@ public CategoryEntry(ConfigScreen owningScreen, ConfigEntries owningEntryList, F
drawLabel = false;

toolTip.add(name.copy().withStyle(TextFormatting.GREEN));
String tooltip = I18n.get("config." + ModReference.MOD_ID + "." + StringUtils.join(categoryPath, '.') + ".tooltip").replace("\\n", "\n");
String tooltip = I18n.get("config." + ModReference.MODID + "." + StringUtils.join(categoryPath, '.') + ".tooltip").replace("\\n", "\n");
if (I18n.exists(tooltip))
toolTip.add(new StringTextComponent(tooltip).withStyle(TextFormatting.YELLOW));
else if (comment != null)
Expand Down

0 comments on commit fdbaa2b

Please sign in to comment.