mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Describe module settings for studio as LoadedPack.schema()
PackSchema (com.volmit.host.schema) is a JSON-free description of every catalogued settings type: features with their module, JSON field and targets, every reachable class once by name (cycles end at the name), options with value kind, description, required, bounds, defaults read from a no-argument instance and @Ref references, plus object generator settings and snippets. Everything is in a fixed order. The pack load fails, naming class, field and module, on unsupported field types, @Ref on fields that are not text, classes without a working no-argument constructor and snippet names that are not folder names or are used twice. GrassSettings.block becomes a BlockState, a block reference without @Ref.
This commit is contained in:
1 parent
93c755ffe4
commit
3465f8d390
19 files changed
+1302
-6
No files matched your search
@@ -26,7 +26,7 @@ public final class GrassModule implements IrisModule {
|
||||
}
|
||||
|
||||
private static void cover(ChunkStageContext context, GrassSettings grass) {
|
||||
var top = new BlockState(grass.block());
|
||||
var top = grass.block();
|
||||
var heights = context.output(TerrainModule.SURFACE);
|
||||
var blocks = context.hunk(BlockState.class);
|
||||
for (int x = 0; x < blocks.getWidth(); x++) {
|
||||
|
||||
@@ -2,13 +2,17 @@ package com.volmit.example.chunk;
|
||||
|
||||
import com.volmit.FeatureAttachment;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
@Desc("Covers the top of every terrain column")
|
||||
@Feature(id = "example:grass", name = "Grass", field = "grass", targets = FeatureAttachment.Target.BIOME)
|
||||
public final class GrassSettings implements IrisFeature {
|
||||
private String block = "minecraft:grass_block";
|
||||
@Desc("Block placed on top of each column")
|
||||
private BlockState block = new BlockState("minecraft:grass_block");
|
||||
|
||||
public String block() {
|
||||
public BlockState block() {
|
||||
return block;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
import com.volmit.config.MinNumber;
|
||||
|
||||
@Desc("Fills the space below an object down to the ground")
|
||||
@Feature(id = "iris:stilt", name = "Stilt", field = "stilt", targets = FeatureAttachment.Target.OBJECT_PLACEMENT)
|
||||
public final class StiltSettings implements IrisFeature {
|
||||
@Desc("Maximum blocks filled below each lowest object block")
|
||||
|
||||
Reference in new issue
Block a user