Skip to content

Commit 1b81dd8

Browse files
committed
enabled in-game config
1 parent 0a27bad commit 1b81dd8

File tree

3 files changed

+8
-32
lines changed

3 files changed

+8
-32
lines changed

Diff for: src/main/java/de/ellpeck/naturesaura/ModConfig.java

-31
Original file line numberDiff line numberDiff line change
@@ -55,133 +55,102 @@ public ModConfig(ModConfigSpec.Builder builder) {
5555
builder.push("general");
5656
this.additionalBotanistPickaxeConversions = builder
5757
.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).")
58-
.translation("config." + NaturesAura.MOD_ID + ".additionalBotanistPickaxeConversions")
5958
.defineList("additionalBotanistPickaxeConversions", Collections.emptyList(), () -> "", s -> true);
6059
this.auraTypeOverrides = builder
6160
.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).")
62-
.translation("config." + NaturesAura.MOD_ID + ".auraTypeOverrides")
6361
.defineList("auraTypeOverrides", Collections.emptyList(), () -> "", s -> true);
6462
this.additionalOres = builder
6563
.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).")
66-
.translation("config." + NaturesAura.MOD_ID + ".additionalOres")
6764
.defineList("additionalOres", Collections.emptyList(), () -> "", s -> true);
6865
this.oreExceptions = builder
6966
.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).")
70-
.translation("config." + NaturesAura.MOD_ID + ".oreExceptions")
7167
.defineList("oreExceptions", Collections.emptyList(), () -> "", s -> true);
7268
this.plantBoostExceptions = builder
7369
.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).")
74-
.translation("config." + NaturesAura.MOD_ID + ".plantBoostExceptions")
7570
.defineList("plantBoostExceptions", Collections.emptyList(), () -> "", s -> true);
7671
this.additionalProjectiles = builder
7772
.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).")
78-
.translation("config." + NaturesAura.MOD_ID + ".additionalProjectiles")
7973
.defineList("additionalProjectiles", Collections.emptyList(), () -> "", s -> true);
8074
this.fieldCreatorRange = builder
8175
.comment("The amount of blocks that can be between two Aura Field Creators for them to be connectable and work together")
82-
.translation("config." + NaturesAura.MOD_ID + ".fieldCreatorRange")
8376
.define("fieldCreatorRange", 24);
8477
this.auraToRFRatio = builder
8578
.comment("The Aura to RF ratio used by the RF converter, read as aura*ratio = rf")
86-
.translation("config." + NaturesAura.MOD_ID + ".auraToRFRatio")
8779
.define("auraToRFRatio", 0.05);
8880
this.maxAnimalsAroundPowder = builder
8981
.comment("The maximum amount of animals that can be around the powder of fertility before it stops working")
90-
.translation("config." + NaturesAura.MOD_ID + ".maxAnimalsAroundPowder")
9182
.define("maxAnimalsAroundPowder", 200);
9283
this.maxAuraSpreadRange = builder
9384
.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.")
94-
.translation("config." + NaturesAura.MOD_ID + ".maxAuraSpreadRange")
9585
.define("maxAuraSpreadRange", 150);
9686
builder.pop();
9787

9888
builder.push("features");
9989
this.rfConverter = builder
10090
.comment("If the RF converter block should be enabled")
101-
.translation("config." + NaturesAura.MOD_ID + ".rfConverter")
10291
.define("rfConverter", true);
10392
this.chunkLoader = builder
10493
.comment("If the chunk loader block should be enabled")
105-
.translation("config." + NaturesAura.MOD_ID + ".chunkLoader")
10694
.define("chunkLoader", true);
10795
this.grassDieEffect = builder
10896
.comment("If the Aura Imbalance effect of grass and trees dying in the area if the Aura levels are too low should occur")
109-
.translation("config." + NaturesAura.MOD_ID + ".grassDieEffect")
11097
.define("grassDieEffect", true);
11198
this.netherDecayEffect = builder
11299
.comment("If the Aura Imbalance effect of nether blocks degrading in the area if the Aura levels are too low should occur")
113-
.translation("config." + NaturesAura.MOD_ID + ".netherDecayEffect")
114100
.define("netherDecayEffect", true);
115101
this.plantBoostEffect = builder
116102
.comment("If the Aura Imbalance effect of plant growth being boosted if the Aura levels are high enough should occur")
117-
.translation("config." + NaturesAura.MOD_ID + ".plantBoostEffect")
118103
.define("plantBoostEffect", true);
119104
this.cacheRechargeEffect = builder
120105
.comment("If the Aura Imbalance effect of aura containers in players' inventories being filled if the Aura levels are high enough should occur")
121-
.translation("config." + NaturesAura.MOD_ID + ".cacheRechargeEffect")
122106
.define("cacheRechargeEffect", true);
123107
this.explosionEffect = builder
124108
.comment("If the Aura Imbalance effect of explosions happening randomly if Aura levels are too low should occur")
125-
.translation("config." + NaturesAura.MOD_ID + ".explosionEffect")
126109
.define("explosionEffect", true);
127110
this.breathlessEffect = builder
128111
.comment("If the Aura Imbalance effect of breathlessness if Aura levels are too low should occur")
129-
.translation("config." + NaturesAura.MOD_ID + ".breathlessEffect")
130112
.define("breathlessEffect", true);
131113
this.angerEffect = builder
132114
.comment("If the Aura Imbalance effect of passive mobs being angered if Aura levels are too low should occur")
133-
.translation("config." + NaturesAura.MOD_ID + ".angerEffect")
134115
.define("angerEffect", true);
135116
this.animalEffect = builder
136117
.comment("If the Aura Imbalance effect of farm animals being affected in positive ways if Aura levels are too high should occur")
137-
.translation("config." + NaturesAura.MOD_ID + ".animalEffect")
138118
.define("animalEffect", true);
139119
this.oreEffect = builder
140120
.comment("If the Aura Imbalance effect of ores spawning in the area if Aura levels are too high should occur")
141-
.translation("config." + NaturesAura.MOD_ID + ".oreEffect")
142121
.define("oreEffect", true);
143122
this.auraBlooms = builder
144123
.comment("If Aura Blooms and Aura Cacti should generate in the level")
145-
.translation("config." + NaturesAura.MOD_ID + ".auraBlooms")
146124
.define("auraBlooms", true);
147125
this.netherGrassEffect = builder
148126
.comment("If the Aura Imbalance effect of grass growing on netherrack if the Aura levels are high enough should occur")
149-
.translation("config." + NaturesAura.MOD_ID + ".netherGrassEffect")
150127
.define("netherGrassEffect", true);
151128
builder.pop();
152129

153130
builder.push("client");
154131
this.particleAmount = builder
155132
.comment("The percentage of particles that should be displayed, where 1 is 100% and 0 is 0%")
156-
.translation("config." + NaturesAura.MOD_ID + ".particleAmount")
157133
.defineInRange("particleAmount", 1D, 0, 1);
158134
this.respectVanillaParticleSettings = builder
159135
.comment("If particle spawning should respect the particle setting in Minecraft's video settings screen")
160-
.translation("config." + NaturesAura.MOD_ID + ".respectVanillaParticleSettings")
161136
.define("respectVanillaParticleSettings", false);
162137
this.excessParticleAmount = builder
163138
.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%")
164-
.translation("config." + NaturesAura.MOD_ID + ".excessParticleAmount")
165139
.define("excessParticleAmount", 1D);
166140
this.auraBarLocation = builder
167141
.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")
168-
.translation("config." + NaturesAura.MOD_ID + ".auraBarLocation")
169142
.defineInRange("auraBarLocation", 0, 0, 3);
170143
this.cacheBarLocation = builder
171144
.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")
172-
.translation("config." + NaturesAura.MOD_ID + ".cacheBarLocation")
173145
.defineInRange("cacheBarLocation", 0, 0, 1);
174146
this.debugText = builder
175147
.comment("If debug information about Aura around the player should be displayed in the F3 debug menu if the player is in creative mode")
176-
.translation("config." + NaturesAura.MOD_ID + ".debugText")
177148
.define("debugText", true);
178149
this.debugLevel = builder
179150
.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")
180-
.translation("config." + NaturesAura.MOD_ID + ".debugLevel")
181151
.define("debugLevel", false);
182152
this.renderItemsOnPlayer = builder
183153
.comment("If certain equippable items, like the Environmental Eye, should be rendered on the player")
184-
.translation("config." + NaturesAura.MOD_ID + ".renderItemsOnPlayer")
185154
.define("renderItemsOnPlayer", true);
186155
builder.pop();
187156
}

Diff for: src/main/java/de/ellpeck/naturesaura/NaturesAura.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public final class NaturesAura {
3131

3232
public NaturesAura(ModContainer container) {
3333
NaturesAura.instance = this;
34-
NaturesAura.proxy = FMLEnvironment.dist.isClient() ? new ClientProxy() : new ServerProxy();
34+
NaturesAura.proxy = FMLEnvironment.dist.isClient() ? new ClientProxy(container) : new ServerProxy();
3535

3636
container.getEventBus().addListener(this::setup);
3737

Diff for: src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java

+7
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,18 @@
2727
import net.minecraft.resources.ResourceLocation;
2828
import net.minecraft.world.item.Item;
2929
import net.minecraft.world.level.block.Block;
30+
import net.neoforged.fml.ModContainer;
3031
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
32+
import net.neoforged.neoforge.client.gui.ConfigurationScreen;
33+
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
3134
import net.neoforged.neoforge.common.NeoForge;
3235

3336
public class ClientProxy implements IProxy {
3437

38+
public ClientProxy(ModContainer container) {
39+
container.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);
40+
}
41+
3542
@Override
3643
public void preInit(FMLCommonSetupEvent event) {
3744
NeoForge.EVENT_BUS.register(new ClientEvents());

0 commit comments

Comments
 (0)