Only log warnings with debug logging

This commit is contained in:
Astrash
2023-10-20 09:32:33 +11:00
parent fde29220af
commit e80e998cec
5 changed files with 19 additions and 3 deletions

View File

@@ -50,6 +50,7 @@ public class ImageBiomeProviderAddon implements AddonInitializer {
() -> new ImageProviderTemplate(event.getPack().getRegistry(Biome.class)));
})
.failThrough();
logger.warn("The biome-provider-image addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the biome-provider-image-v2 addon for future pack development instead.");
if(platform.getTerraConfig().isDebugLog())
logger.warn("The biome-provider-image addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the biome-provider-image-v2 addon for future pack development instead.");
}
}

View File

@@ -90,6 +90,7 @@ public class BiomePipelineAddon implements AddonInitializer {
event.getPack().applyLoader(BiomeDelegate.class, new BiomeDelegateLoader(biomeRegistry));
});
logger.warn("The biome-provider-pipeline addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the biome-provider-pipeline-v2 addon for future pack development instead.");
if(platform.getTerraConfig().isDebugLog())
logger.warn("The biome-provider-pipeline addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the biome-provider-pipeline-v2 addon for future pack development instead.");
}
}

View File

@@ -35,6 +35,7 @@ public class OreAddon implements AddonInitializer {
.then(event -> event.getPack().registerConfigType(new OreConfigType(), addon.key("ORE"), 1))
.failThrough();
logger.warn("The ore-config addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the ore-config-v2 addon for future pack development instead.");
if(platform.getTerraConfig().isDebugLog())
logger.warn("The ore-config addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the ore-config-v2 addon for future pack development instead.");
}
}

View File

@@ -21,6 +21,8 @@ public interface PluginConfig {
boolean isDebugScript();
boolean isDebugLog();
int getBiomeSearchResolution();
int getStructureCache();

View File

@@ -51,6 +51,10 @@ public class PluginConfigImpl implements ConfigTemplate, PluginConfig {
@Default
private boolean debugScript = false;
@Value("debug.log")
@Default
private boolean debugLog = false;
@Value("biome-search-resolution")
@Default
private int biomeSearch = 4;
@@ -91,6 +95,8 @@ public class PluginConfigImpl implements ConfigTemplate, PluginConfig {
logger.info("Debug profiler enabled.");
if(debugScript)
logger.info("Script debug blocks enabled.");
if(debugLog)
logger.info("Debug logging enabled.");
}
@Override
@@ -113,6 +119,11 @@ public class PluginConfigImpl implements ConfigTemplate, PluginConfig {
return debugScript;
}
@Override
public boolean isDebugLog() {
return debugLog;
}
@Override
public int getBiomeSearchResolution() {
return biomeSearch;