mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
Purpose seeds follow one rule; unknown noise styles fail
PackWorld.seed(purpose) is a default method, WorldRandom.purposeSeed of the world seed, for every host and purpose: the exception that let a host answer its own built-ins with older seeds is gone. An unknown style name or a missing expression now fails like a missing image map, instead of sampling flat or falling back to the base style.
This commit is contained in:
1 parent
264f754297
commit
e8fca6d8c6
9 files changed
+17
-32
No files matched your search
@@ -13,9 +13,8 @@ public interface NoiseFactory {
|
||||
* <p>A style with its own seed ({@link NoiseStyle#seed()}) ignores {@code seed}: the host rolls it from that number
|
||||
* and the seed of the world the pack generates, so every reader of the same seeded style gets the same noise.
|
||||
*
|
||||
* <p>A style name the host does not know samples as {@link NoiseStyle#FLAT}, and an expression the pack does not
|
||||
* have falls back to the base style, as packs have always been read. An image map the pack does not have, or cannot
|
||||
* use as noise, throws {@link IllegalArgumentException}.
|
||||
* <p>A style name the host does not know, an expression the pack does not have, and an image map the pack does not
|
||||
* have or cannot use as noise throw {@link IllegalArgumentException}.
|
||||
*/
|
||||
NoiseSampler sampler(NoiseStyle style, long seed);
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public final class NoiseStyle {
|
||||
public static final String FLAT = "FLAT";
|
||||
|
||||
@Ref(Reference.NOISE_STYLE)
|
||||
@Desc("The noise generator. Used when neither expression nor imageMap is set, and when an expression fails.")
|
||||
@Desc("The noise generator. Used when neither expression nor imageMap is set.")
|
||||
private String style = FLAT;
|
||||
|
||||
@Desc("Above 0, the noise is turned into cells of this frequency.")
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.volmit.world;
|
||||
import com.volmit.ModuleLog;
|
||||
import com.volmit.config.PackSettings;
|
||||
import com.volmit.placement.Placements;
|
||||
import com.volmit.random.WorldRandom;
|
||||
import com.volmit.resource.PackResources;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import java.util.Optional;
|
||||
@@ -30,11 +31,12 @@ public interface PackWorld {
|
||||
/**
|
||||
* The seed this world gives {@code purpose}, such as {@code example:moss/patches}: the same for the same world and
|
||||
* purpose, independent across purposes. Seed a module's own randoms and noise with it instead of mixing
|
||||
* {@link #seed()} by hand. A host answers {@link com.volmit.random.WorldRandom#purposeSeed} of the world's seed,
|
||||
* except for purposes of its own modules whose worlds already depend on other seeds: Iris answers the ids of
|
||||
* {@code iris:} purposes its built-in modules use with the seeds its worlds always had.
|
||||
* {@link #seed()} by hand. It is {@link com.volmit.random.WorldRandom#purposeSeed} of the world's seed, for every
|
||||
* purpose and every host.
|
||||
*/
|
||||
long seed(ResourceId purpose);
|
||||
default long seed(ResourceId purpose) {
|
||||
return WorldRandom.purposeSeed(seed(), purpose);
|
||||
}
|
||||
|
||||
/** The pack snapshot this world generates with. */
|
||||
PackResources resources();
|
||||
|
||||
Reference in new issue
Block a user