mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-04 14:56:28 +00:00
Change layer signatures
This commit is contained in:
@@ -12,8 +12,9 @@ import java.util.Map;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.properties.Properties;
|
||||
import com.dfsek.terra.api.world.biome.Biome;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.chunk.generation.util.Palette;
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
|
||||
|
||||
public abstract class LayerPalette {
|
||||
@@ -27,7 +28,7 @@ public abstract class LayerPalette {
|
||||
this.resetsGroup = resetsGroup;
|
||||
}
|
||||
|
||||
public abstract Palette get(long seed, Biome biome, int x, int y, int z);
|
||||
public abstract Palette get(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider);
|
||||
|
||||
public final Group getGroup() {
|
||||
return group;
|
||||
|
||||
@@ -5,5 +5,5 @@ import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
|
||||
|
||||
public interface LayerPredicate {
|
||||
boolean test(int x, int y, int z, WorldProperties properties, BiomeProvider provider);
|
||||
boolean test(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette;
|
||||
import com.dfsek.terra.api.event.events.config.ConfigurationLoadEvent;
|
||||
import com.dfsek.terra.api.properties.Properties;
|
||||
import com.dfsek.terra.api.world.biome.Biome;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.chunk.generation.util.Palette;
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
|
||||
|
||||
public class BiomeDefinedLayerPalette extends LayerPalette {
|
||||
@@ -28,8 +30,8 @@ public class BiomeDefinedLayerPalette extends LayerPalette {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Palette get(long seed, Biome biome, int x, int y, int z) {
|
||||
return biome.getContext().get(BiomeLayerPalettes.class).palettes().get(this);
|
||||
public Palette get(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider) {
|
||||
return biomeProvider.getBiome(x, y, z, worldProperties.getSeed()).getContext().get(BiomeLayerPalettes.class).palettes().get(this);
|
||||
}
|
||||
|
||||
public Optional<Palette> getDefaultPalette() {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.dfsek.terra.addons.chunkgenerator.layer.palette;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette;
|
||||
import com.dfsek.terra.api.world.biome.Biome;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.chunk.generation.util.Palette;
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
|
||||
|
||||
public class SimpleLayerPalette extends LayerPalette {
|
||||
@@ -15,7 +16,7 @@ public class SimpleLayerPalette extends LayerPalette {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Palette get(long seed, Biome biome, int x, int y, int z) {
|
||||
public Palette get(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) {
|
||||
return palette;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class BelowLayerPredicate implements LayerPredicate {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test(int x, int y, int z, WorldProperties properties, BiomeProvider biomeProvider) {
|
||||
public boolean test(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider) {
|
||||
return y < this.y;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class RangeLayerPredicate implements LayerPredicate {
|
||||
this.range = range;
|
||||
}
|
||||
@Override
|
||||
public boolean test(int x, int y, int z, WorldProperties world, BiomeProvider provider) {
|
||||
public boolean test(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider) {
|
||||
return range.isInRange(y);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user