mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-23 17:09:29 +00:00
preload mob spawning position
This commit is contained in:
@@ -5,13 +5,17 @@ import org.dreeam.leaf.config.EnumConfigCategory;
|
||||
|
||||
public class OptimizeBiome extends ConfigModules {
|
||||
public String getBasePath() {
|
||||
return EnumConfigCategory.PERF.getBaseKeyName() + ".cache-mob-spawning-biome";
|
||||
return EnumConfigCategory.PERF.getBaseKeyName() + ".cache-biome";
|
||||
}
|
||||
|
||||
public static boolean enabled = false;
|
||||
public static boolean mobSpawn = false;
|
||||
public static boolean advancement = false;
|
||||
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
enabled = config().getBoolean(getBasePath(), enabled);
|
||||
enabled = config().getBoolean(getBasePath() + ".enabled", enabled);
|
||||
mobSpawn = config.getBoolean(getBasePath() + ".mob-spawning", false);
|
||||
advancement = config.getBoolean(getBasePath() + ".advancements", false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.dreeam.leaf.config.modules.opt;
|
||||
|
||||
import org.dreeam.leaf.config.ConfigModules;
|
||||
import org.dreeam.leaf.config.EnumConfigCategory;
|
||||
|
||||
public class PreloadNaturalMobSpawning extends ConfigModules {
|
||||
public String getBasePath() {
|
||||
return EnumConfigCategory.PERF.getBaseKeyName() + ".preload-mob-spawning-position";
|
||||
}
|
||||
|
||||
public static boolean enabled = false;
|
||||
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
enabled = config.getBoolean(getBasePath() + ".enabled", enabled);
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import net.minecraft.world.entity.MobCategory;
|
||||
import org.dreeam.leaf.config.ConfigModules;
|
||||
import org.dreeam.leaf.config.EnumConfigCategory;
|
||||
|
||||
public class ThrottleNaturalSpawnMob extends ConfigModules {
|
||||
public class ThrottleNaturalMobSpawning extends ConfigModules {
|
||||
public String getBasePath() {
|
||||
return EnumConfigCategory.PERF.getBaseKeyName() + ".throttled-mob-spawning";
|
||||
return EnumConfigCategory.PERF.getBaseKeyName() + ".throttle-mob-spawning";
|
||||
}
|
||||
|
||||
public static boolean enabled = false;
|
||||
@@ -21,7 +21,7 @@ public class ThrottleNaturalSpawnMob extends ConfigModules {
|
||||
spawnChance = new int[categories.length];
|
||||
for (int i = 0; i < categories.length; i++) {
|
||||
String category = getBasePath() + "." + categories[i].getSerializedName();
|
||||
long attempts = config.getLong(category + ".min-failed-attempts", 8);
|
||||
long attempts = config.getLong(category + ".min-failed", 8);
|
||||
double chance = config.getDouble(category + ".spawn-chance", 25.0);
|
||||
|
||||
failedAttempts[i] = Math.max(-1, attempts);
|
||||
Reference in New Issue
Block a user