-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stonecutter autoreformat, updating gradle.properties, fix ServerComma…
…ndManager, fix en_us translation, logging methods placed in a separate class "PatLogger" (hehe)
- Loading branch information
1 parent
a8e229a
commit 0735f3a
Showing
14 changed files
with
116 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package net.lopymine.patpat; | ||
|
||
//? >=1.17 { | ||
import org.slf4j.*; | ||
//?} | ||
|
||
public class PatLogger { | ||
|
||
//? >=1.17 { | ||
private final Logger logger; | ||
//?} else { | ||
/*private final String name; | ||
*///?} | ||
|
||
public PatLogger(String name){ | ||
//? >=1.17 { | ||
logger = LoggerFactory.getLogger(name); | ||
//?} else { | ||
/*this.name = name; | ||
*///?} | ||
} | ||
|
||
public void info(String text, Object... args) { | ||
//? >=1.17 { | ||
logger.info(text, args); | ||
//?} else { | ||
/*System.out.println("[%s/INFO] ".formatted(name) + text.replace("{}", "%s").formatted(args)); | ||
*///?} | ||
} | ||
|
||
public void warn(String text, Object... args) { | ||
//? >=1.17 { | ||
logger.warn(text, args); | ||
//?} else { | ||
/*System.out.println("[%s/WARN] ".formatted(name) + text.replace("{}", "%s").formatted(args)); | ||
*///?} | ||
} | ||
|
||
public void error(String text, Object... args) { | ||
//? >=1.17 { | ||
logger.error(text, args); | ||
//?} else { | ||
/*System.out.println("[%s/ERROR] ".formatted(name) + text.replace("{}", "%s").formatted(args)); | ||
*///?} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,29 @@ | ||
package net.lopymine.patpat; | ||
|
||
import lombok.Getter; | ||
import net.minecraft.text.MutableText; | ||
|
||
import net.fabricmc.api.ModInitializer; | ||
|
||
import net.lopymine.patpat.config.server.PatPatServerConfig; | ||
import net.lopymine.patpat.manager.PatPatConfigManager; | ||
import net.lopymine.patpat.manager.server.*; | ||
import net.lopymine.patpat.utils.TextUtils; | ||
|
||
//? >=1.17 { | ||
import org.slf4j.*; | ||
//?} | ||
|
||
public class PatPat implements ModInitializer { | ||
|
||
public static final String MOD_VERSION = /*$ mod_version*/ "1.0.1"; | ||
public static final String MOD_NAME = /*$ mod_name*/ "PatPat"; | ||
public static final String MOD_ID = /*$ mod_id*/ "patpat"; | ||
//? >=1.17 | ||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_NAME); | ||
|
||
public static final PatLogger LOGGER = new PatLogger(MOD_NAME); | ||
@Getter | ||
private static PatPatServerConfig config = PatPatServerConfig.getInstance(); | ||
|
||
public static void info(String text, Object... args) { | ||
//? >=1.17 { | ||
LOGGER.info(text, args); | ||
//?} else { | ||
/*System.out.println("[%s/INFO].formatted(MOD_NAME) " + text.replace("{}", "%s").formatted(args)); | ||
*///?} | ||
} | ||
|
||
public static void warn(String text, Object... args) { | ||
//? >=1.17 { | ||
LOGGER.warn(text, args); | ||
//?} else { | ||
/*System.out.println("[%s/WARN].formatted(MOD_NAME) " + text.replace("{}", "%s").formatted(args)); | ||
*///?} | ||
} | ||
|
||
public static void error(String text, Object... args) { | ||
//? >=1.17 { | ||
LOGGER.error(text, args); | ||
//?} else { | ||
/*System.out.println("[%s/ERROR] ".formatted(MOD_NAME) + text.replace("{}", "%s").formatted(args)); | ||
*///?} | ||
} | ||
|
||
public static MutableText text(String path, Object... args) { | ||
return TextUtils.translatable(String.format("%s.%s", MOD_ID, path), args); | ||
} | ||
|
||
@Override | ||
public void onInitialize() { | ||
PatPat.config = PatPatServerConfig.getInstance(); | ||
PatPatConfigManager.onInitialize(); | ||
PatPatServerCommandManager.register(); | ||
PatPatServerPacketManager.register(); | ||
info("PatPat Initialized"); | ||
PatPat.LOGGER.info("PatPat Initialized"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.