Added config for verbose logging )on by default, #41)
This commit is contained in:
parent
887cb3c8f1
commit
87d0c8b07e
7 changed files with 28 additions and 12 deletions
|
@ -1,6 +1,7 @@
|
|||
package org.betterx.bclib.api.v2.levelgen.biomes;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.config.Configs;
|
||||
import org.betterx.bclib.mixin.common.BiomeGenerationSettingsAccessor;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
|
@ -180,6 +181,7 @@ public class InternalBiomeAPI {
|
|||
}
|
||||
|
||||
public static void applyModifications(BiomeSource source, ResourceKey<LevelStem> dimension) {
|
||||
if (Configs.MAIN_CONFIG.verboseLogging())
|
||||
BCLib.LOGGER.info("\nApply Modifications for " + dimension.location() + source.toString()
|
||||
.replace("\n", "\n "));
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import net.fabricmc.loader.api.ModContainer;
|
|||
|
||||
public class PrintInfo {
|
||||
static int printDimensions(CommandContext<CommandSourceStack> ctx) {
|
||||
|
||||
MutableComponent result = Component.literal("World Dimensions: ")
|
||||
.setStyle(Style.EMPTY.withBold(true).withColor(ChatFormatting.BLUE));
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ public abstract class Config {
|
|||
DataExchangeAPI.addAutoSyncFile(aid.modID, aid.uniqueID, keeper.getConfigFile());
|
||||
|
||||
AUTO_SYNC_CONFIGS.put(aid, this);
|
||||
|
||||
BCLib.LOGGER.info("Added Config " + configID + " to auto sync (" + (diffContent
|
||||
? "content diff"
|
||||
: "file hash") + ")");
|
||||
|
|
|
@ -20,6 +20,7 @@ public class Configs {
|
|||
public static final BiomesConfig BIOMES_CONFIG = new BiomesConfig();
|
||||
|
||||
public static final String MAIN_PATCH_CATEGORY = "patches";
|
||||
public static final String MAIN_LOG_CATEGORY = "logs";
|
||||
|
||||
public static void save() {
|
||||
MAIN_CONFIG.saveChanges();
|
||||
|
|
|
@ -3,6 +3,11 @@ package org.betterx.bclib.config;
|
|||
import org.betterx.bclib.BCLib;
|
||||
|
||||
public class MainConfig extends NamedPathConfig {
|
||||
public static final ConfigToken<Boolean> VERBOSE_LOGGING = ConfigToken.Boolean(
|
||||
true,
|
||||
"verbose",
|
||||
Configs.MAIN_LOG_CATEGORY
|
||||
);
|
||||
public static final ConfigToken<Boolean> APPLY_PATCHES = ConfigToken.Boolean(
|
||||
true,
|
||||
"applyPatches",
|
||||
|
@ -30,4 +35,8 @@ public class MainConfig extends NamedPathConfig {
|
|||
public boolean repairBiomes() {
|
||||
return get(REPAIR_BIOMES);
|
||||
}
|
||||
|
||||
public boolean verboseLogging() {
|
||||
return get(VERBOSE_LOGGING);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.betterx.worlds.together.world.event;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.config.Configs;
|
||||
import org.betterx.worlds.together.WorldsTogether;
|
||||
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
||||
import org.betterx.worlds.together.mixin.common.RegistryOpsAccessor;
|
||||
|
@ -303,6 +304,7 @@ public class WorldBootstrap {
|
|||
entry.getValue()
|
||||
));
|
||||
|
||||
if (Configs.MAIN_CONFIG.verboseLogging())
|
||||
output += "\n - " + entry.getKey().location().toString() + ": " +
|
||||
"\n " + entry.getValue().generator().toString() + " " +
|
||||
entry.getValue()
|
||||
|
@ -311,6 +313,7 @@ public class WorldBootstrap {
|
|||
.toString()
|
||||
.replace("\n", "\n ");
|
||||
}
|
||||
if (Configs.MAIN_CONFIG.verboseLogging())
|
||||
BCLib.LOGGER.info(output);
|
||||
SurfaceRuleUtil.injectSurfaceRulesToAllDimensions(worldGenSettings);
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.betterx.worlds.together.worldPreset;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.config.Configs;
|
||||
import org.betterx.worlds.together.WorldsTogether;
|
||||
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
||||
import org.betterx.worlds.together.mixin.common.WorldPresetAccessor;
|
||||
|
@ -105,7 +106,7 @@ public class TogetherWorldPreset extends WorldPreset {
|
|||
|
||||
public static @NotNull Map<ResourceKey<LevelStem>, ChunkGenerator> loadWorldDimensions() {
|
||||
final RegistryAccess registryAccess = WorldBootstrap.getLastRegistryAccessOrElseBuiltin();
|
||||
if (registryAccess == BuiltinRegistries.ACCESS) {
|
||||
if (registryAccess == BuiltinRegistries.ACCESS && Configs.MAIN_CONFIG.verboseLogging()) {
|
||||
BCLib.LOGGER.info("Loading from builtin Registry");
|
||||
}
|
||||
final RegistryOps<Tag> registryOps = RegistryOps.create(NbtOps.INSTANCE, registryAccess);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue