mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-18 10:32:30 +00:00
Make Biome Search Resolution configurable.
This commit is contained in:
parent
dada49f6bf
commit
6a70972ea8
@ -1,6 +1,7 @@
|
||||
package com.dfsek.terra.async;
|
||||
|
||||
import com.dfsek.terra.biome.grid.TerraBiomeGrid;
|
||||
import com.dfsek.terra.config.base.ConfigUtil;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -27,11 +28,11 @@ public class AsyncBiomeFinder extends AsyncFeatureFinder<Biome> {
|
||||
*/
|
||||
@Override
|
||||
public boolean isValid(int x, int z, Biome target) {
|
||||
return getGrid().getBiome(x << 2, z << 2, GenerationPhase.POST_GEN).equals(target);
|
||||
return getGrid().getBiome(x * ConfigUtil.biomeSearchRes, z * ConfigUtil.biomeSearchRes, GenerationPhase.POST_GEN).equals(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector finalizeVector(Vector orig) {
|
||||
return orig.multiply(4);
|
||||
return orig.multiply(ConfigUtil.biomeSearchRes);
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ public final class ConfigUtil {
|
||||
public static boolean debug;
|
||||
public static long dataSave; // Period of population data saving, in ticks.
|
||||
public static boolean masterDisableCaves;
|
||||
public static int biomeSearchRes;
|
||||
|
||||
public static void loadConfig(JavaPlugin main) {
|
||||
main.saveDefaultConfig();
|
||||
@ -38,6 +39,7 @@ public final class ConfigUtil {
|
||||
debug = config.getBoolean("debug", false);
|
||||
dataSave = Duration.parse(Objects.requireNonNull(config.getString("data-save", "PT6M"))).toMillis() / 20L;
|
||||
masterDisableCaves = config.getBoolean("master-disable.caves", false);
|
||||
biomeSearchRes = config.getInt("biome-search-resolution", 4);
|
||||
|
||||
if(config.getBoolean("dump-default", true)) {
|
||||
try(JarFile jar = new JarFile(new File(Terra.class.getProtectionDomain().getCodeSource().getLocation().toURI()))) {
|
||||
|
@ -3,5 +3,6 @@ data-save: PT6M
|
||||
language: "en_us"
|
||||
fail-type: SHUTDOWN
|
||||
dump-default: true
|
||||
biome-search-resolution: 4
|
||||
master-disable:
|
||||
caves: false
|
Loading…
x
Reference in New Issue
Block a user