mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
LinkedBiomes: settings name the pack biomes they bring into the layout; CaveBiomes service: the cave biome a module puts at a position and a biome's minimum cave depth
This commit is contained in:
1 parent
6757cbdd0f
commit
25f9ea2f37
5 files changed
+80
-2
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package com.volmit.config;
|
||||
|
||||
import com.volmit.IrisFeature;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Implemented by settings that make pack biomes part of a pack's layout besides the ones its regions list: the biome
|
||||
* that a cave band puts underground, or the target of a floating island. The host asks the settings of every dimension
|
||||
* and biome it reaches, without knowing the module behind them, so such a biome is loaded, registered and given its own
|
||||
* settings like any other. Keys are pack biome keys as packs write them; blank keys and keys naming no biome are
|
||||
* ignored.
|
||||
*/
|
||||
public interface LinkedBiomes {
|
||||
/**
|
||||
* Biomes that join the biome tree of every region the owner is part of, like the owner's children: the host registers
|
||||
* them with the region, so their terrain generators take part in the region's terrain.
|
||||
*/
|
||||
default Set<String> treeBiomes() {
|
||||
return Set.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* Biomes the settings use besides, which a dimension reaches (their objects, decorators and settings take part in
|
||||
* generation) without joining the region's biome tree.
|
||||
*
|
||||
* @param dimension the settings the owner's dimension declares, for settings that name something the dimension
|
||||
* declares, such as a band of its caves
|
||||
*/
|
||||
default Set<String> usedBiomes(Collection<IrisFeature> dimension) {
|
||||
return Set.of();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.volmit.service;
|
||||
|
||||
import com.volmit.world.PackWorld;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Which biome a module puts underground. The host places the cave biome of a position itself, from the biome its regions give
|
||||
* the column and its terrain; this service tells it where a module overrides that and where a cave biome gives way to the
|
||||
* surface's. A pack has one provider, since two modules deciding the biome of the same cave could not both be right.
|
||||
*/
|
||||
@Service(Providers.ONE)
|
||||
public interface CaveBiomes {
|
||||
/**
|
||||
* The pack biome the module puts at the position whatever the regions say, such as a band of the deep dark. Empty where it
|
||||
* overrides nothing.
|
||||
*
|
||||
* @param y the height above the dimension's bottom
|
||||
* @return the biome key as packs write it
|
||||
*/
|
||||
Optional<String> overriddenBiome(PackWorld world, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* How many blocks below the surface a position must lie for the pack biome {@code biomeKey} to be the cave biome there;
|
||||
* nearer the surface the surface's biome is. 0 for a biome that has no such limit.
|
||||
*/
|
||||
int minDepthBelowSurface(PackWorld world, String biomeKey);
|
||||
}
|
||||
Reference in new issue
Block a user