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;
|
package org.betterx.bclib.api.v2.levelgen.biomes;
|
||||||
|
|
||||||
import org.betterx.bclib.BCLib;
|
import org.betterx.bclib.BCLib;
|
||||||
|
import org.betterx.bclib.config.Configs;
|
||||||
import org.betterx.bclib.mixin.common.BiomeGenerationSettingsAccessor;
|
import org.betterx.bclib.mixin.common.BiomeGenerationSettingsAccessor;
|
||||||
|
|
||||||
import net.minecraft.core.Holder;
|
import net.minecraft.core.Holder;
|
||||||
|
@ -180,8 +181,9 @@ public class InternalBiomeAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void applyModifications(BiomeSource source, ResourceKey<LevelStem> dimension) {
|
public static void applyModifications(BiomeSource source, ResourceKey<LevelStem> dimension) {
|
||||||
BCLib.LOGGER.info("\nApply Modifications for " + dimension.location() + source.toString()
|
if (Configs.MAIN_CONFIG.verboseLogging())
|
||||||
.replace("\n", "\n "));
|
BCLib.LOGGER.info("\nApply Modifications for " + dimension.location() + source.toString()
|
||||||
|
.replace("\n", "\n "));
|
||||||
|
|
||||||
final Set<Holder<Biome>> biomes = source.possibleBiomes();
|
final Set<Holder<Biome>> biomes = source.possibleBiomes();
|
||||||
List<BiConsumer<ResourceLocation, Holder<Biome>>> modifications = MODIFICATIONS.get(dimension);
|
List<BiConsumer<ResourceLocation, Holder<Biome>>> modifications = MODIFICATIONS.get(dimension);
|
||||||
|
|
|
@ -22,7 +22,6 @@ import net.fabricmc.loader.api.ModContainer;
|
||||||
|
|
||||||
public class PrintInfo {
|
public class PrintInfo {
|
||||||
static int printDimensions(CommandContext<CommandSourceStack> ctx) {
|
static int printDimensions(CommandContext<CommandSourceStack> ctx) {
|
||||||
|
|
||||||
MutableComponent result = Component.literal("World Dimensions: ")
|
MutableComponent result = Component.literal("World Dimensions: ")
|
||||||
.setStyle(Style.EMPTY.withBold(true).withColor(ChatFormatting.BLUE));
|
.setStyle(Style.EMPTY.withBold(true).withColor(ChatFormatting.BLUE));
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ public abstract class Config {
|
||||||
DataExchangeAPI.addAutoSyncFile(aid.modID, aid.uniqueID, keeper.getConfigFile());
|
DataExchangeAPI.addAutoSyncFile(aid.modID, aid.uniqueID, keeper.getConfigFile());
|
||||||
|
|
||||||
AUTO_SYNC_CONFIGS.put(aid, this);
|
AUTO_SYNC_CONFIGS.put(aid, this);
|
||||||
|
|
||||||
BCLib.LOGGER.info("Added Config " + configID + " to auto sync (" + (diffContent
|
BCLib.LOGGER.info("Added Config " + configID + " to auto sync (" + (diffContent
|
||||||
? "content diff"
|
? "content diff"
|
||||||
: "file hash") + ")");
|
: "file hash") + ")");
|
||||||
|
|
|
@ -20,6 +20,7 @@ public class Configs {
|
||||||
public static final BiomesConfig BIOMES_CONFIG = new BiomesConfig();
|
public static final BiomesConfig BIOMES_CONFIG = new BiomesConfig();
|
||||||
|
|
||||||
public static final String MAIN_PATCH_CATEGORY = "patches";
|
public static final String MAIN_PATCH_CATEGORY = "patches";
|
||||||
|
public static final String MAIN_LOG_CATEGORY = "logs";
|
||||||
|
|
||||||
public static void save() {
|
public static void save() {
|
||||||
MAIN_CONFIG.saveChanges();
|
MAIN_CONFIG.saveChanges();
|
||||||
|
|
|
@ -3,6 +3,11 @@ package org.betterx.bclib.config;
|
||||||
import org.betterx.bclib.BCLib;
|
import org.betterx.bclib.BCLib;
|
||||||
|
|
||||||
public class MainConfig extends NamedPathConfig {
|
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(
|
public static final ConfigToken<Boolean> APPLY_PATCHES = ConfigToken.Boolean(
|
||||||
true,
|
true,
|
||||||
"applyPatches",
|
"applyPatches",
|
||||||
|
@ -30,4 +35,8 @@ public class MainConfig extends NamedPathConfig {
|
||||||
public boolean repairBiomes() {
|
public boolean repairBiomes() {
|
||||||
return get(REPAIR_BIOMES);
|
return get(REPAIR_BIOMES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean verboseLogging() {
|
||||||
|
return get(VERBOSE_LOGGING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.betterx.worlds.together.world.event;
|
package org.betterx.worlds.together.world.event;
|
||||||
|
|
||||||
import org.betterx.bclib.BCLib;
|
import org.betterx.bclib.BCLib;
|
||||||
|
import org.betterx.bclib.config.Configs;
|
||||||
import org.betterx.worlds.together.WorldsTogether;
|
import org.betterx.worlds.together.WorldsTogether;
|
||||||
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
||||||
import org.betterx.worlds.together.mixin.common.RegistryOpsAccessor;
|
import org.betterx.worlds.together.mixin.common.RegistryOpsAccessor;
|
||||||
|
@ -303,15 +304,17 @@ public class WorldBootstrap {
|
||||||
entry.getValue()
|
entry.getValue()
|
||||||
));
|
));
|
||||||
|
|
||||||
output += "\n - " + entry.getKey().location().toString() + ": " +
|
if (Configs.MAIN_CONFIG.verboseLogging())
|
||||||
"\n " + entry.getValue().generator().toString() + " " +
|
output += "\n - " + entry.getKey().location().toString() + ": " +
|
||||||
entry.getValue()
|
"\n " + entry.getValue().generator().toString() + " " +
|
||||||
.generator()
|
entry.getValue()
|
||||||
.getBiomeSource()
|
.generator()
|
||||||
.toString()
|
.getBiomeSource()
|
||||||
.replace("\n", "\n ");
|
.toString()
|
||||||
|
.replace("\n", "\n ");
|
||||||
}
|
}
|
||||||
BCLib.LOGGER.info(output);
|
if (Configs.MAIN_CONFIG.verboseLogging())
|
||||||
|
BCLib.LOGGER.info(output);
|
||||||
SurfaceRuleUtil.injectSurfaceRulesToAllDimensions(worldGenSettings);
|
SurfaceRuleUtil.injectSurfaceRulesToAllDimensions(worldGenSettings);
|
||||||
|
|
||||||
WorldEventsImpl.ON_FINALIZED_WORLD_LOAD.emit(e -> e.done(worldGenSettings));
|
WorldEventsImpl.ON_FINALIZED_WORLD_LOAD.emit(e -> e.done(worldGenSettings));
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.betterx.worlds.together.worldPreset;
|
package org.betterx.worlds.together.worldPreset;
|
||||||
|
|
||||||
import org.betterx.bclib.BCLib;
|
import org.betterx.bclib.BCLib;
|
||||||
|
import org.betterx.bclib.config.Configs;
|
||||||
import org.betterx.worlds.together.WorldsTogether;
|
import org.betterx.worlds.together.WorldsTogether;
|
||||||
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
import org.betterx.worlds.together.levelgen.WorldGenUtil;
|
||||||
import org.betterx.worlds.together.mixin.common.WorldPresetAccessor;
|
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() {
|
public static @NotNull Map<ResourceKey<LevelStem>, ChunkGenerator> loadWorldDimensions() {
|
||||||
final RegistryAccess registryAccess = WorldBootstrap.getLastRegistryAccessOrElseBuiltin();
|
final RegistryAccess registryAccess = WorldBootstrap.getLastRegistryAccessOrElseBuiltin();
|
||||||
if (registryAccess == BuiltinRegistries.ACCESS) {
|
if (registryAccess == BuiltinRegistries.ACCESS && Configs.MAIN_CONFIG.verboseLogging()) {
|
||||||
BCLib.LOGGER.info("Loading from builtin Registry");
|
BCLib.LOGGER.info("Loading from builtin Registry");
|
||||||
}
|
}
|
||||||
final RegistryOps<Tag> registryOps = RegistryOps.create(NbtOps.INSTANCE, registryAccess);
|
final RegistryOps<Tag> registryOps = RegistryOps.create(NbtOps.INSTANCE, registryAccess);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue