Full Imports and Code Format Optimization

This commit is contained in:
Kam committed 2025-03-12 20:12:01 -04:00
1 parent 250edf099c
commit 6815f579a7
1192 files changed
+60344 -62167

No files matched your search

@@ -10,14 +10,13 @@ import org.apache.logging.log4j.Level;
import java.io.File;
public class ConfigDebug
{
public class ConfigDebug {
public static Configuration config;
public final static String LOGGING = "Logging";
/**
* Logging Properties
* Logging Properties
**/
public static Property PlayerLoggingProperty;
public static boolean PlayerLogging = false;
@@ -34,36 +33,34 @@ public class ConfigDebug
public static Property ScriptLogIgnoreTypeProperty;
public static String ScriptLogIgnoreType = "TICK";
public static void init(File configFile)
{
public static void init(File configFile) {
config = new Configuration(configFile);
try
{
try {
config.load();
// Logging
PlayerLoggingProperty = config.get(LOGGING, "Enable Player Logging", false, "Enables if Player Information (WAND-USE) should be printed to CustomNPCs Logs. IF on Server \n" +
"Logs will only be present SERVER-SIDE only in CustomNPCs-latest, -1, -2, and -3");
"Logs will only be present SERVER-SIDE only in CustomNPCs-latest, -1, -2, and -3");
PlayerLogging = PlayerLoggingProperty.getBoolean(false);
ScriptLoggingProperty = config.get(LOGGING, "Enable Script Logging", false, "Enables if Scripting Information should be printed to CustomNPCs Logs. IF on Server \n" +
"Logs will only be present SERVER-SIDE only in CustomNPCs-latest, -1, -2, and -3");
"Logs will only be present SERVER-SIDE only in CustomNPCs-latest, -1, -2, and -3");
ScriptLogging = ScriptLoggingProperty.getBoolean(false);
ScriptFrequencyProperty = config.get(LOGGING, "Script Log Frequency Limit", 20, "Amount of Messages marked as SPAM [5, 3000]. Lower Number means MORE accurate messages \n" +
"This frequency will determine if the log will print a line with [SPAM] to warn the console.");
"This frequency will determine if the log will print a line with [SPAM] to warn the console.");
ScriptFrequency = ScriptFrequencyProperty.getInt(20);
ScriptIgnoreTimeProperty = config.get(LOGGING, "Script Ignore Time Buffer", 2000, "IN Milliseconds 1s = 1000s. If a recent LOG of the same event is SENT within this threshold it will be ignored.");
ScriptIgnoreTime = ScriptIgnoreTimeProperty.getInt(2000);
ScriptLogIgnoreTypeProperty = config.get(LOGGING, "Script Type Ignore", "TICK", "Comma separated list of NPC Script Types that will omit these from the logs,\n" +
"INIT,TICK,INTERACT,DIALOG,DAMAGED,KILLED,ATTACK,TARGET,COLLIDE,KILLS,DIALOG_CLOSE,TIMER");
"INIT,TICK,INTERACT,DIALOG,DAMAGED,KILLED,ATTACK,TARGET,COLLIDE,KILLS,DIALOG_CLOSE,TIMER");
ScriptLogIgnoreType = ScriptLogIgnoreTypeProperty.getString();
// Convert to Legacy
if(CustomNpcs.legacyExist) {
if (CustomNpcs.legacyExist) {
PlayerLogging = LegacyConfig.PlayerLogging;
PlayerLoggingProperty.set(PlayerLogging);
@@ -93,8 +90,8 @@ public class ConfigDebug
String[] ignoreTypes = ScriptLogIgnoreType.split(",");
for (String s : ignoreTypes) {
EnumScriptType type = EnumScriptType.valueOfIgnoreCase(s);
if(type != null){
switch (type){
if (type != null) {
switch (type) {
case INIT:
CustomNpcs.InitIgnore = true;
break;
@@ -136,17 +133,14 @@ public class ConfigDebug
}
}
}
} catch (Exception ignored) {}
}
catch (Exception e)
{
} catch (Exception ignored) {
}
} catch (Exception e) {
FMLLog.log(Level.ERROR, e, "CNPC+ has had a problem loading its debug configuration");
}
finally
{
} finally {
if (config.hasChanged()) {
config.save();
}
}
}
}
}