Skip to content

Commit

Permalink
修改配置设计
Browse files Browse the repository at this point in the history
  • Loading branch information
TartaricAcid committed Sep 27, 2023
1 parent be12f04 commit 1f4faac
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ dependencies {

compileOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}")

implementation fg.deobf("teamtwilight:twilightforest:${twilight_forest_version}:universal")
}

tasks.withType(JavaCompile).configureEach {
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
mod_version=1.1.0-hotfix4
mod_version=1.1.1
forge_version=1.18.2-40.1.0
jei_version=9.7.0.194
patchouli_version=1.18.2-67
patchouli_version=1.18.2-67
twilight_forest_version=4.1.1494
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.github.tartaricacid.touhoulittlemaid.config.subconfig;

import com.google.common.collect.Lists;
import net.minecraft.world.level.biome.Biome;
import net.minecraftforge.common.ForgeConfigSpec;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

import static net.minecraft.world.level.biome.Biome.BiomeCategory.*;

Expand Down Expand Up @@ -35,12 +33,7 @@ public static void init(ForgeConfigSpec.Builder builder) {
builder.comment("The following biome do not spawn maid fairy",
"Available names: " + StringUtils.join(biomes, ", "));
MAID_FAIRY_BLACKLIST_BIOME = builder.defineList("MaidFairyBlacklistBiome", Lists.newArrayList(NETHER.getName(), THEEND.getName(),
NONE.getName(), MUSHROOM.getName()), o -> {
if (o instanceof String name) {
return byName(name) != null;
}
return false;
});
NONE.getName(), MUSHROOM.getName()), MiscConfig::checkBiome);

builder.comment("Loss power point after player death");
PLAYER_DEATH_LOSS_POWER_POINT = builder.defineInRange("PlayerDeathLossPowerPoint", 1.0, 0, 5);
Expand All @@ -59,4 +52,12 @@ public static void init(ForgeConfigSpec.Builder builder) {

builder.pop();
}

@SuppressWarnings("all")
private static boolean checkBiome(Object o) {
if (o instanceof String name) {
return byName(name) != null;
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.minecraftforge.fml.common.Mod;

import static com.github.tartaricacid.touhoulittlemaid.config.subconfig.MiscConfig.MAID_FAIRY_BLACKLIST_BIOME;
import static net.minecraft.world.level.biome.Biome.BiomeCategory.*;


@Mod.EventBusSubscriber
Expand Down

0 comments on commit 1f4faac

Please sign in to comment.