Skip to content

Commit

Permalink
Continued work on adding translations for configs, and fix a couple d…
Browse files Browse the repository at this point in the history
…eprecations for defining config lists
  • Loading branch information
pupnewfster committed Aug 21, 2024
1 parent 98abd60 commit 847ab18
Show file tree
Hide file tree
Showing 28 changed files with 285 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import mekanism.additions.common.config.AdditionsConfigTranslations.BabySpawnTranslations;
import mekanism.additions.common.entity.baby.BabyType;
import mekanism.additions.common.registries.AdditionsEntityTypes;
import mekanism.api.functions.ConstantPredicates;
import mekanism.common.config.BaseMekanismConfig;
import mekanism.common.config.IMekanismConfig;
import mekanism.common.config.value.CachedBooleanValue;
Expand All @@ -18,6 +17,7 @@
import net.minecraft.SharedConstants;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.biome.MobSpawnSettings;
Expand All @@ -43,7 +43,7 @@ public class AdditionsConfig extends BaseMekanismConfig {
obsidianTNTDelay = CachedIntValue.wrap(this, AdditionsConfigTranslations.SERVER_OBSIDIAN_DELAY.applyToBuilder(builder)
.defineInRange("delay", 5 * SharedConstants.TICKS_PER_SECOND, 0, Integer.MAX_VALUE));
obsidianTNTBlastRadius = CachedFloatValue.wrap(this, AdditionsConfigTranslations.SERVER_OBSIDIAN_RADIUS.applyToBuilder(builder)
.defineInRange("blast_radius", 12, 0.1, 1_000));
.defineInRange("blastRadius", 12, 0.1, 1_000));
builder.pop();

AdditionsConfigTranslations.SERVER_VOICE.applyToBuilder(builder).push("voice_server");
Expand Down Expand Up @@ -136,9 +136,9 @@ private SpawnConfig(IMekanismConfig config, ModConfigSpec.Builder builder, Strin
.worldRestart()
.defineInRange("maxSpawnCostPercentage", 1D, 0, 100));
this.biomeBlackList = CachedResourceLocationListValue.define(config, translations.biomeBlacklist().applyToBuilder(builder)
.worldRestart(), "biomeBlackList", ConstantPredicates.alwaysTrue());
.worldRestart(), "biomeBlackList", ResourceLocation.withDefaultNamespace("plains"));
this.structureBlackList = CachedResourceLocationListValue.define(config, translations.structureBlacklist().applyToBuilder(builder)
.worldRestart(), "structureBlackList", BuiltInRegistries.STRUCTURE_TYPE::containsKey);
.worldRestart(), "structureBlackList", ResourceLocation.withDefaultNamespace("fortress"), BuiltInRegistries.STRUCTURE_TYPE::containsKey);
builder.pop();
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public class GeneratorsJEI implements IModPlugin {
@NotNull
@Override
public ResourceLocation getPluginUid() {
return MekanismGenerators.rl("jei_plugin");
//Note: Can't use MekanismGenerators.rl, as JEI needs this in the constructor and the class may not be loaded yet.
// we can still reference the modid though because of constant inlining
return ResourceLocation.fromNamespaceAndPath(MekanismGenerators.MODID, "jei_plugin");
}

@Override
Expand Down
Loading

0 comments on commit 847ab18

Please sign in to comment.