enabled in-game config

This commit is contained in:
Ell 2024-12-05 21:50:06 +01:00
parent 0a27bad878
commit 1b81dd886b
3 changed files with 8 additions and 32 deletions

View file

@ -55,133 +55,102 @@ public final class ModConfig {
builder.push("general"); builder.push("general");
this.additionalBotanistPickaxeConversions = builder this.additionalBotanistPickaxeConversions = builder
.comment("Additional conversion recipes for the Botanist's Pickaxe right click function. Each entry needs to be formatted as modid:input_block[prop1=value1,...]->modid:output_block[prop1=value1,...] where block state properties are optional, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).") .comment("Additional conversion recipes for the Botanist's Pickaxe right click function. Each entry needs to be formatted as modid:input_block[prop1=value1,...]->modid:output_block[prop1=value1,...] where block state properties are optional, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).")
.translation("config." + NaturesAura.MOD_ID + ".additionalBotanistPickaxeConversions")
.defineList("additionalBotanistPickaxeConversions", Collections.emptyList(), () -> "", s -> true); .defineList("additionalBotanistPickaxeConversions", Collections.emptyList(), () -> "", s -> true);
this.auraTypeOverrides = builder this.auraTypeOverrides = builder
.comment("Additional dimensions that map to Aura types that should be present in them. This is useful if you have a modpack with custom dimensions that should have Aura act similarly to an existing dimension in them. Each entry needs to be formatted as dimension_name->aura_type, where aura_type can be any of naturesaura:overworld, naturesaura:nether and naturesaura:end, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).") .comment("Additional dimensions that map to Aura types that should be present in them. This is useful if you have a modpack with custom dimensions that should have Aura act similarly to an existing dimension in them. Each entry needs to be formatted as dimension_name->aura_type, where aura_type can be any of naturesaura:overworld, naturesaura:nether and naturesaura:end, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).")
.translation("config." + NaturesAura.MOD_ID + ".auraTypeOverrides")
.defineList("auraTypeOverrides", Collections.emptyList(), () -> "", s -> true); .defineList("auraTypeOverrides", Collections.emptyList(), () -> "", s -> true);
this.additionalOres = builder this.additionalOres = builder
.comment("Additional blocks that are recognized as generatable ores for the passive ore generation effect. Each entry needs to be formatted as tag_name->oreWeight->dimension where a higher weight makes the ore more likely to spawn with 5000 being the weight of coal, the default ore with the highest weight, and dimension being any of overworld and nether, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).") .comment("Additional blocks that are recognized as generatable ores for the passive ore generation effect. Each entry needs to be formatted as tag_name->oreWeight->dimension where a higher weight makes the ore more likely to spawn with 5000 being the weight of coal, the default ore with the highest weight, and dimension being any of overworld and nether, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).")
.translation("config." + NaturesAura.MOD_ID + ".additionalOres")
.defineList("additionalOres", Collections.emptyList(), () -> "", s -> true); .defineList("additionalOres", Collections.emptyList(), () -> "", s -> true);
this.oreExceptions = builder this.oreExceptions = builder
.comment("Blocks that are exempt from being recognized as generatable ores for the passive ore generation effect. Each entry needs to be formatted as modid:block[prop1=value1,...] where block state properties are optional, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).") .comment("Blocks that are exempt from being recognized as generatable ores for the passive ore generation effect. Each entry needs to be formatted as modid:block[prop1=value1,...] where block state properties are optional, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).")
.translation("config." + NaturesAura.MOD_ID + ".oreExceptions")
.defineList("oreExceptions", Collections.emptyList(), () -> "", s -> true); .defineList("oreExceptions", Collections.emptyList(), () -> "", s -> true);
this.plantBoostExceptions = builder this.plantBoostExceptions = builder
.comment("Blocks that are exept from being fertilized by the plant boost effect. Each entry needs to be formatted as modid:block, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).") .comment("Blocks that are exept from being fertilized by the plant boost effect. Each entry needs to be formatted as modid:block, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).")
.translation("config." + NaturesAura.MOD_ID + ".plantBoostExceptions")
.defineList("plantBoostExceptions", Collections.emptyList(), () -> "", s -> true); .defineList("plantBoostExceptions", Collections.emptyList(), () -> "", s -> true);
this.additionalProjectiles = builder this.additionalProjectiles = builder
.comment("Additional projectile types that are allowed to be consumed by the projectile generator. Each entry needs to be formatted as entity_registry_name->aura_amount, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).") .comment("Additional projectile types that are allowed to be consumed by the projectile generator. Each entry needs to be formatted as entity_registry_name->aura_amount, and entries follow standard TOML array formatting (https://toml.io/en/v1.0.0#array).")
.translation("config." + NaturesAura.MOD_ID + ".additionalProjectiles")
.defineList("additionalProjectiles", Collections.emptyList(), () -> "", s -> true); .defineList("additionalProjectiles", Collections.emptyList(), () -> "", s -> true);
this.fieldCreatorRange = builder this.fieldCreatorRange = builder
.comment("The amount of blocks that can be between two Aura Field Creators for them to be connectable and work together") .comment("The amount of blocks that can be between two Aura Field Creators for them to be connectable and work together")
.translation("config." + NaturesAura.MOD_ID + ".fieldCreatorRange")
.define("fieldCreatorRange", 24); .define("fieldCreatorRange", 24);
this.auraToRFRatio = builder this.auraToRFRatio = builder
.comment("The Aura to RF ratio used by the RF converter, read as aura*ratio = rf") .comment("The Aura to RF ratio used by the RF converter, read as aura*ratio = rf")
.translation("config." + NaturesAura.MOD_ID + ".auraToRFRatio")
.define("auraToRFRatio", 0.05); .define("auraToRFRatio", 0.05);
this.maxAnimalsAroundPowder = builder this.maxAnimalsAroundPowder = builder
.comment("The maximum amount of animals that can be around the powder of fertility before it stops working") .comment("The maximum amount of animals that can be around the powder of fertility before it stops working")
.translation("config." + NaturesAura.MOD_ID + ".maxAnimalsAroundPowder")
.define("maxAnimalsAroundPowder", 200); .define("maxAnimalsAroundPowder", 200);
this.maxAuraSpreadRange = builder this.maxAuraSpreadRange = builder
.comment("The maximum amount of blocks that aura can spread from an initial position before it starts fizzling out. It's recommended to lower this value on a large server to avoid lag caused by players chunk-loading their bases for extended amounts of time without an Aura Detector present.") .comment("The maximum amount of blocks that aura can spread from an initial position before it starts fizzling out. It's recommended to lower this value on a large server to avoid lag caused by players chunk-loading their bases for extended amounts of time without an Aura Detector present.")
.translation("config." + NaturesAura.MOD_ID + ".maxAuraSpreadRange")
.define("maxAuraSpreadRange", 150); .define("maxAuraSpreadRange", 150);
builder.pop(); builder.pop();
builder.push("features"); builder.push("features");
this.rfConverter = builder this.rfConverter = builder
.comment("If the RF converter block should be enabled") .comment("If the RF converter block should be enabled")
.translation("config." + NaturesAura.MOD_ID + ".rfConverter")
.define("rfConverter", true); .define("rfConverter", true);
this.chunkLoader = builder this.chunkLoader = builder
.comment("If the chunk loader block should be enabled") .comment("If the chunk loader block should be enabled")
.translation("config." + NaturesAura.MOD_ID + ".chunkLoader")
.define("chunkLoader", true); .define("chunkLoader", true);
this.grassDieEffect = builder this.grassDieEffect = builder
.comment("If the Aura Imbalance effect of grass and trees dying in the area if the Aura levels are too low should occur") .comment("If the Aura Imbalance effect of grass and trees dying in the area if the Aura levels are too low should occur")
.translation("config." + NaturesAura.MOD_ID + ".grassDieEffect")
.define("grassDieEffect", true); .define("grassDieEffect", true);
this.netherDecayEffect = builder this.netherDecayEffect = builder
.comment("If the Aura Imbalance effect of nether blocks degrading in the area if the Aura levels are too low should occur") .comment("If the Aura Imbalance effect of nether blocks degrading in the area if the Aura levels are too low should occur")
.translation("config." + NaturesAura.MOD_ID + ".netherDecayEffect")
.define("netherDecayEffect", true); .define("netherDecayEffect", true);
this.plantBoostEffect = builder this.plantBoostEffect = builder
.comment("If the Aura Imbalance effect of plant growth being boosted if the Aura levels are high enough should occur") .comment("If the Aura Imbalance effect of plant growth being boosted if the Aura levels are high enough should occur")
.translation("config." + NaturesAura.MOD_ID + ".plantBoostEffect")
.define("plantBoostEffect", true); .define("plantBoostEffect", true);
this.cacheRechargeEffect = builder this.cacheRechargeEffect = builder
.comment("If the Aura Imbalance effect of aura containers in players' inventories being filled if the Aura levels are high enough should occur") .comment("If the Aura Imbalance effect of aura containers in players' inventories being filled if the Aura levels are high enough should occur")
.translation("config." + NaturesAura.MOD_ID + ".cacheRechargeEffect")
.define("cacheRechargeEffect", true); .define("cacheRechargeEffect", true);
this.explosionEffect = builder this.explosionEffect = builder
.comment("If the Aura Imbalance effect of explosions happening randomly if Aura levels are too low should occur") .comment("If the Aura Imbalance effect of explosions happening randomly if Aura levels are too low should occur")
.translation("config." + NaturesAura.MOD_ID + ".explosionEffect")
.define("explosionEffect", true); .define("explosionEffect", true);
this.breathlessEffect = builder this.breathlessEffect = builder
.comment("If the Aura Imbalance effect of breathlessness if Aura levels are too low should occur") .comment("If the Aura Imbalance effect of breathlessness if Aura levels are too low should occur")
.translation("config." + NaturesAura.MOD_ID + ".breathlessEffect")
.define("breathlessEffect", true); .define("breathlessEffect", true);
this.angerEffect = builder this.angerEffect = builder
.comment("If the Aura Imbalance effect of passive mobs being angered if Aura levels are too low should occur") .comment("If the Aura Imbalance effect of passive mobs being angered if Aura levels are too low should occur")
.translation("config." + NaturesAura.MOD_ID + ".angerEffect")
.define("angerEffect", true); .define("angerEffect", true);
this.animalEffect = builder this.animalEffect = builder
.comment("If the Aura Imbalance effect of farm animals being affected in positive ways if Aura levels are too high should occur") .comment("If the Aura Imbalance effect of farm animals being affected in positive ways if Aura levels are too high should occur")
.translation("config." + NaturesAura.MOD_ID + ".animalEffect")
.define("animalEffect", true); .define("animalEffect", true);
this.oreEffect = builder this.oreEffect = builder
.comment("If the Aura Imbalance effect of ores spawning in the area if Aura levels are too high should occur") .comment("If the Aura Imbalance effect of ores spawning in the area if Aura levels are too high should occur")
.translation("config." + NaturesAura.MOD_ID + ".oreEffect")
.define("oreEffect", true); .define("oreEffect", true);
this.auraBlooms = builder this.auraBlooms = builder
.comment("If Aura Blooms and Aura Cacti should generate in the level") .comment("If Aura Blooms and Aura Cacti should generate in the level")
.translation("config." + NaturesAura.MOD_ID + ".auraBlooms")
.define("auraBlooms", true); .define("auraBlooms", true);
this.netherGrassEffect = builder this.netherGrassEffect = builder
.comment("If the Aura Imbalance effect of grass growing on netherrack if the Aura levels are high enough should occur") .comment("If the Aura Imbalance effect of grass growing on netherrack if the Aura levels are high enough should occur")
.translation("config." + NaturesAura.MOD_ID + ".netherGrassEffect")
.define("netherGrassEffect", true); .define("netherGrassEffect", true);
builder.pop(); builder.pop();
builder.push("client"); builder.push("client");
this.particleAmount = builder this.particleAmount = builder
.comment("The percentage of particles that should be displayed, where 1 is 100% and 0 is 0%") .comment("The percentage of particles that should be displayed, where 1 is 100% and 0 is 0%")
.translation("config." + NaturesAura.MOD_ID + ".particleAmount")
.defineInRange("particleAmount", 1D, 0, 1); .defineInRange("particleAmount", 1D, 0, 1);
this.respectVanillaParticleSettings = builder this.respectVanillaParticleSettings = builder
.comment("If particle spawning should respect the particle setting in Minecraft's video settings screen") .comment("If particle spawning should respect the particle setting in Minecraft's video settings screen")
.translation("config." + NaturesAura.MOD_ID + ".respectVanillaParticleSettings")
.define("respectVanillaParticleSettings", false); .define("respectVanillaParticleSettings", false);
this.excessParticleAmount = builder this.excessParticleAmount = builder
.comment("The percentage of particles that should spawn when there is an excess amount of Aura in the environment, where 1 is 100% and 0 is 0%") .comment("The percentage of particles that should spawn when there is an excess amount of Aura in the environment, where 1 is 100% and 0 is 0%")
.translation("config." + NaturesAura.MOD_ID + ".excessParticleAmount")
.define("excessParticleAmount", 1D); .define("excessParticleAmount", 1D);
this.auraBarLocation = builder this.auraBarLocation = builder
.comment("The location of the aura bar, where 0 is top left, 1 is top right, 2 is bottom left and 3 is bottom right") .comment("The location of the aura bar, where 0 is top left, 1 is top right, 2 is bottom left and 3 is bottom right")
.translation("config." + NaturesAura.MOD_ID + ".auraBarLocation")
.defineInRange("auraBarLocation", 0, 0, 3); .defineInRange("auraBarLocation", 0, 0, 3);
this.cacheBarLocation = builder this.cacheBarLocation = builder
.comment("The location of the aura cache bar, where 0 is to the left of the hotbar and 1 is to the right of the hotbar") .comment("The location of the aura cache bar, where 0 is to the left of the hotbar and 1 is to the right of the hotbar")
.translation("config." + NaturesAura.MOD_ID + ".cacheBarLocation")
.defineInRange("cacheBarLocation", 0, 0, 1); .defineInRange("cacheBarLocation", 0, 0, 1);
this.debugText = builder this.debugText = builder
.comment("If debug information about Aura around the player should be displayed in the F3 debug menu if the player is in creative mode") .comment("If debug information about Aura around the player should be displayed in the F3 debug menu if the player is in creative mode")
.translation("config." + NaturesAura.MOD_ID + ".debugText")
.define("debugText", true); .define("debugText", true);
this.debugLevel = builder this.debugLevel = builder
.comment("If, when the F3 debug menu is open and the player is in creative mode, every Aura spot should be highlighted in the level for debug purposes") .comment("If, when the F3 debug menu is open and the player is in creative mode, every Aura spot should be highlighted in the level for debug purposes")
.translation("config." + NaturesAura.MOD_ID + ".debugLevel")
.define("debugLevel", false); .define("debugLevel", false);
this.renderItemsOnPlayer = builder this.renderItemsOnPlayer = builder
.comment("If certain equippable items, like the Environmental Eye, should be rendered on the player") .comment("If certain equippable items, like the Environmental Eye, should be rendered on the player")
.translation("config." + NaturesAura.MOD_ID + ".renderItemsOnPlayer")
.define("renderItemsOnPlayer", true); .define("renderItemsOnPlayer", true);
builder.pop(); builder.pop();
} }

View file

@ -31,7 +31,7 @@ public final class NaturesAura {
public NaturesAura(ModContainer container) { public NaturesAura(ModContainer container) {
NaturesAura.instance = this; NaturesAura.instance = this;
NaturesAura.proxy = FMLEnvironment.dist.isClient() ? new ClientProxy() : new ServerProxy(); NaturesAura.proxy = FMLEnvironment.dist.isClient() ? new ClientProxy(container) : new ServerProxy();
container.getEventBus().addListener(this::setup); container.getEventBus().addListener(this::setup);

View file

@ -27,11 +27,18 @@ import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
import net.neoforged.neoforge.client.gui.ConfigurationScreen;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.common.NeoForge;
public class ClientProxy implements IProxy { public class ClientProxy implements IProxy {
public ClientProxy(ModContainer container) {
container.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);
}
@Override @Override
public void preInit(FMLCommonSetupEvent event) { public void preInit(FMLCommonSetupEvent event) {
NeoForge.EVENT_BUS.register(new ClientEvents()); NeoForge.EVENT_BUS.register(new ClientEvents());