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