From 34874080e7bd70251312fcc53c6075baa91e8d25 Mon Sep 17 00:00:00 2001 From: Julian Krings Date: Tue, 2 Sep 2025 12:28:54 +0200 Subject: [PATCH] cleanup some array types for json schema generation --- .../volmit/iris/engine/modifier/IrisCarveModifier.java | 8 ++++++-- .../java/com/volmit/iris/engine/object/IrisBiome.java | 6 +++--- .../java/com/volmit/iris/engine/object/IrisCommand.java | 2 ++ .../volmit/iris/engine/object/IrisCommandRegistry.java | 1 + .../java/com/volmit/iris/engine/object/IrisEffect.java | 1 - .../com/volmit/iris/engine/object/IrisJigsawPiece.java | 3 +-- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/volmit/iris/engine/modifier/IrisCarveModifier.java b/core/src/main/java/com/volmit/iris/engine/modifier/IrisCarveModifier.java index 36bca62e5..d8585fe93 100644 --- a/core/src/main/java/com/volmit/iris/engine/modifier/IrisCarveModifier.java +++ b/core/src/main/java/com/volmit/iris/engine/modifier/IrisCarveModifier.java @@ -220,11 +220,15 @@ public class IrisCarveModifier extends EngineAssignedModifier { break; } - if (!B.isSolid(output.get(rx, zone.floor - i - 1, rz))) { + BlockData b = blocks.get(i); + BlockData down = output.get(rx, zone.ceiling + i - 1, rz); + + if (!B.isSolid(down)) { continue; } - if (B.isOre(output.get(rx, zone.floor - i - 1, rz))) { + if (B.isOre(down)) { + output.set(rx, zone.ceiling + i - 1, rz, B.toDeepSlateOre(down, b)); continue; } diff --git a/core/src/main/java/com/volmit/iris/engine/object/IrisBiome.java b/core/src/main/java/com/volmit/iris/engine/object/IrisBiome.java index ac1390d83..42caee79e 100644 --- a/core/src/main/java/com/volmit/iris/engine/object/IrisBiome.java +++ b/core/src/main/java/com/volmit/iris/engine/object/IrisBiome.java @@ -143,14 +143,14 @@ public class IrisBiome extends IrisRegistrant implements IRare { @Desc("The default wall if iris decides to place a wall higher than 2 blocks (steep hills or possibly cliffs)") private IrisBiomePaletteLayer wall = new IrisBiomePaletteLayer().zero(); @Required - @ArrayType(min = 1, type = IrisBiomePaletteLayer.class) + @ArrayType(type = IrisBiomePaletteLayer.class) @Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.") private KList layers = new KList().qadd(new IrisBiomePaletteLayer()); @Required - @ArrayType(min = 1, type = IrisBiomePaletteLayer.class) + @ArrayType(type = IrisBiomePaletteLayer.class) @Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.") private KList caveCeilingLayers = new KList().qadd(new IrisBiomePaletteLayer()); - @ArrayType(min = 1, type = IrisBiomePaletteLayer.class) + @ArrayType(type = IrisBiomePaletteLayer.class) @Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.") private KList seaLayers = new KList<>(); @ArrayType(min = 1, type = IrisDecorator.class) diff --git a/core/src/main/java/com/volmit/iris/engine/object/IrisCommand.java b/core/src/main/java/com/volmit/iris/engine/object/IrisCommand.java index 36f47fb44..0555bb6bb 100644 --- a/core/src/main/java/com/volmit/iris/engine/object/IrisCommand.java +++ b/core/src/main/java/com/volmit/iris/engine/object/IrisCommand.java @@ -21,6 +21,7 @@ package com.volmit.iris.engine.object; import com.volmit.iris.Iris; import com.volmit.iris.engine.object.annotations.ArrayType; import com.volmit.iris.engine.object.annotations.Desc; +import com.volmit.iris.engine.object.annotations.Required; import com.volmit.iris.engine.object.annotations.Snippet; import com.volmit.iris.util.collection.KList; import lombok.Data; @@ -37,6 +38,7 @@ import org.bukkit.World; @Data public class IrisCommand { + @Required @ArrayType(min = 1, type = String.class) @Desc("List of commands. Iris replaces {x} {y} and {z} with the location of the entity spawn") private KList commands = new KList<>(); diff --git a/core/src/main/java/com/volmit/iris/engine/object/IrisCommandRegistry.java b/core/src/main/java/com/volmit/iris/engine/object/IrisCommandRegistry.java index e9599d56f..39f36c3b5 100644 --- a/core/src/main/java/com/volmit/iris/engine/object/IrisCommandRegistry.java +++ b/core/src/main/java/com/volmit/iris/engine/object/IrisCommandRegistry.java @@ -33,6 +33,7 @@ import org.bukkit.entity.Player; @Desc("Represents a casting location for a command") @Data public class IrisCommandRegistry { + @Required @ArrayType(min = 1, type = IrisCommand.class) @Desc("Run commands, at the exact location of the player") private KList rawCommands = new KList<>(); diff --git a/core/src/main/java/com/volmit/iris/engine/object/IrisEffect.java b/core/src/main/java/com/volmit/iris/engine/object/IrisEffect.java index c28467877..d2c6eca6b 100644 --- a/core/src/main/java/com/volmit/iris/engine/object/IrisEffect.java +++ b/core/src/main/java/com/volmit/iris/engine/object/IrisEffect.java @@ -146,7 +146,6 @@ public class IrisEffect { @MinNumber(1) @Desc("The chance is 1 in CHANCE per interval") private int chance = 50; - @ArrayType(min = 1, type = IrisCommandRegistry.class) @Desc("Run commands, with configurable location parameters") private IrisCommandRegistry commandRegistry = null; diff --git a/core/src/main/java/com/volmit/iris/engine/object/IrisJigsawPiece.java b/core/src/main/java/com/volmit/iris/engine/object/IrisJigsawPiece.java index c69aca0e4..09d94a6d4 100644 --- a/core/src/main/java/com/volmit/iris/engine/object/IrisJigsawPiece.java +++ b/core/src/main/java/com/volmit/iris/engine/object/IrisJigsawPiece.java @@ -50,8 +50,7 @@ public class IrisJigsawPiece extends IrisRegistrant { @Desc("The object this piece represents") private String object = ""; - @Required - @ArrayType(type = IrisJigsawPieceConnector.class, min = 1) + @ArrayType(type = IrisJigsawPieceConnector.class) @Desc("The connectors this object contains") private KList connectors = new KList<>();