Move the vocabulary only Iris core uses back into Iris core

37 types of the object, value, image, world and runtime packages (the image map
enums and exceptions, the registry list annotations, the engine data, the world
boundary and environment, the custom biome enums, IrisRange) are read by Iris
core alone. They keep their packages. The 11 that the module's structure model
or ObjectRotation also reads stay.
This commit is contained in:
piexel committed 2026-10-28 04:09:40 +01:00
1 parent 83bc859b31
commit e0dda1699c
37 files changed
-1288

No files matched your search

@@ -1,18 +0,0 @@
package art.arcane.iris.engine.image;
import art.arcane.iris.engine.object.image.IrisImageColorMode;
public record IrisImageMapSourceMetadata(
String format,
IrisImageColorMode colorMode,
int width,
int height,
int colorComponents,
int channels,
int bitDepth,
boolean alpha,
double minimumAlpha,
double maximumAlpha,
String decodedContentHash
) {
}
@@ -1,35 +0,0 @@
package art.arcane.iris.engine.image;
import java.util.List;
public final class IrisImageMapValidationException extends IllegalArgumentException {
private final List<String> diagnostics;
public IrisImageMapValidationException(String diagnostic) {
this(List.of(diagnostic));
}
public IrisImageMapValidationException(List<String> diagnostics) {
super(message(diagnostics));
if (diagnostics == null || diagnostics.isEmpty()) {
throw new IllegalArgumentException("Image-map validation requires at least one diagnostic");
}
this.diagnostics = List.copyOf(diagnostics);
}
public IrisImageMapValidationException(String diagnostic, Throwable cause) {
super(diagnostic, cause);
this.diagnostics = List.of(diagnostic);
}
public List<String> getDiagnostics() {
return diagnostics;
}
private static String message(List<String> diagnostics) {
if (diagnostics == null || diagnostics.isEmpty()) {
return "Image-map validation failed";
}
return String.join("; ", diagnostics);
}
}
@@ -1,31 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target({FIELD})
public @interface DependsOn {
String[] value();
}
@@ -1,37 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks a String field (or a list of Strings) as a live biome-registry key, so schema completion offers every
* vanilla, datapack, and mod biome instead of nothing.
*/
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListBiome {
}
@@ -1,33 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListBlockType {
}
@@ -1,14 +0,0 @@
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListEnchantment {
}
@@ -1,33 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListEntityType {
}
@@ -1,33 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListFont {
}
@@ -1,33 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListItemType {
}
@@ -1,14 +0,0 @@
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListPotionEffect {
}
@@ -1,33 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListSpecialEntity {
}
@@ -1,12 +0,0 @@
package art.arcane.iris.engine.object.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface RegistryMapBlockState {
String value();
}
@@ -1,36 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.entity.spawn;
import art.arcane.volmlib.util.math.M;
import lombok.Data;
@Data
public class IrisEngineSpawnerCooldown {
private long lastSpawn = 0;
private String spawner;
public void spawn() {
lastSpawn = M.ms();
}
public boolean canSpawn(long intervalMilliseconds) {
return M.ms() - lastSpawn > intervalMilliseconds;
}
}
@@ -1,32 +0,0 @@
package art.arcane.iris.engine.object.entity.spawn;
import art.arcane.volmlib.util.collection.KMap;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import java.util.function.ToLongFunction;
@EqualsAndHashCode
public class IrisSpawnerCooldowns {
private final KMap<String, IrisEngineSpawnerCooldown> cooldowns = new KMap<>();
public IrisEngineSpawnerCooldown getCooldown(@NonNull String loadKey) {
return cooldowns.computeIfAbsent(loadKey, k -> {
IrisEngineSpawnerCooldown cd = new IrisEngineSpawnerCooldown();
cd.setSpawner(loadKey);
return cd;
});
}
/** Forgets the cooldowns that ran out and those of spawners {@code intervalMilliseconds} does not know (a negative interval). */
public void cleanup(ToLongFunction<String> intervalMilliseconds) {
cooldowns.values().removeIf(cd -> {
long interval = intervalMilliseconds.applyAsLong(cd.getSpawner());
return interval < 0 || cd.canSpawn(interval);
});
}
public boolean isEmpty() {
return cooldowns.isEmpty();
}
}
@@ -1,9 +0,0 @@
package art.arcane.iris.engine.object.image;
public enum IrisImageColorMode {
GRAYSCALE,
RGB,
RGBA,
INDEXED,
UNSUPPORTED
}
@@ -1,11 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("How alpha participates in decoded data")
public enum IrisImageMapAlpha {
IGNORE,
MASK,
TRANSPARENT_IS_FALLBACK,
ERROR
}
@@ -1,13 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("The generation input controlled by an image map")
public enum IrisImageMapApplication {
TERRAIN_HEIGHT,
BIOME,
REGION,
SURFACE_BLOCK,
MASK,
CUSTOM
}
@@ -1,33 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.MaxNumber;
import art.arcane.iris.engine.object.annotations.MinNumber;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@NoArgsConstructor
@Desc("A composable reference to a named MASK image map")
@Data
public class IrisImageMapMask {
@Desc("The key of a named imageMaps entry whose application is MASK")
private String map = "";
@Desc("How this mask combines with masks before it")
private IrisImageMapMaskOperation operation = IrisImageMapMaskOperation.MULTIPLY;
@Desc("Invert this mask before combining it")
private boolean inverted = false;
@MinNumber(0)
@MaxNumber(1)
@Desc("Values below this threshold become zero")
private double threshold = 0D;
@MinNumber(0)
@MaxNumber(1)
@Desc("Soft transition width above threshold; zero is a hard edge")
private double falloff = 0D;
}
@@ -1,12 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("How a referenced mask combines with masks before it")
public enum IrisImageMapMaskOperation {
MULTIPLY,
MINIMUM,
MAXIMUM,
ADD,
SUBTRACT
}
@@ -1,23 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@NoArgsConstructor
@Desc("A two-dimensional image-map coordinate")
@Data
public class IrisImageMapOrigin {
@Desc("X coordinate in world blocks for origin, or source pixels for sourceOrigin")
private double x = 0D;
@Desc("Z coordinate in world blocks for origin, or source image Y pixels for sourceOrigin")
private double z = 0D;
public IrisImageMapOrigin(double x, double z) {
this.x = x;
this.z = z;
}
}
@@ -1,12 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("How coordinates outside an image are resolved")
public enum IrisImageMapOutOfBounds {
FALLBACK,
CLAMP,
REPEAT,
MIRROR,
ERROR
}
@@ -1,11 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("Clockwise image-map rotation around sourceOrigin")
public enum IrisImageMapRotation {
DEG_0,
DEG_90,
DEG_180,
DEG_270
}
@@ -1,10 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("The filter used between source pixels")
public enum IrisImageMapSampling {
NEAREST,
BILINEAR,
BICUBIC
}
@@ -1,13 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("How Iris decodes each source pixel")
public enum IrisImageMapType {
GRAYSCALE_HEIGHT,
RGB_HEIGHT,
COLOR_MAP,
BINARY_MASK,
GRAYSCALE_MASK,
ALPHA_MASK
}
@@ -1,10 +0,0 @@
package art.arcane.iris.engine.object.image;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("How a color absent from a color-map legend is handled")
public enum IrisImageMapUnknownColor {
ERROR,
FALLBACK,
IGNORE
}
@@ -1,53 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.runtime;
import art.arcane.iris.engine.object.entity.spawn.IrisSpawnerCooldowns;
import art.arcane.volmlib.util.cache.CacheKey;
import art.arcane.volmlib.util.collection.KMap;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.function.ToLongFunction;
@Data
@EqualsAndHashCode(callSuper = true)
public class IrisEngineData extends IrisSpawnerCooldowns {
private IrisEngineStatistics statistics = new IrisEngineStatistics();
private KMap<Long, IrisSpawnerCooldowns> chunks = new KMap<>();
private Long seed = null;
public void removeChunk(int x, int z) {
chunks.remove(CacheKey.key(x, z));
}
public IrisSpawnerCooldowns getChunk(int x, int z) {
return chunks.computeIfAbsent(CacheKey.key(x, z), k -> new IrisSpawnerCooldowns());
}
@Override
public void cleanup(ToLongFunction<String> intervalMilliseconds) {
super.cleanup(intervalMilliseconds);
chunks.values().removeIf(chunk -> {
chunk.cleanup(intervalMilliseconds);
return chunk.isEmpty();
});
}
}
@@ -1,67 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.runtime;
import lombok.Data;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
@Data
public class IrisEngineStatistics {
private static final AtomicIntegerFieldUpdater<IrisEngineStatistics> TOTAL_HOTLOADS =
AtomicIntegerFieldUpdater.newUpdater(IrisEngineStatistics.class, "totalHotloads");
private static final AtomicIntegerFieldUpdater<IrisEngineStatistics> CHUNKS_GENERATED =
AtomicIntegerFieldUpdater.newUpdater(IrisEngineStatistics.class, "chunksGenerated");
private volatile int totalHotloads = 0;
private volatile int chunksGenerated = 0;
private volatile int IrisToUpgradedVersion = 0;
private volatile int IrisCreationVersion = 0;
private volatile int MinecraftVersion = 0;
public void generatedChunk() {
CHUNKS_GENERATED.incrementAndGet(this);
}
public void setUpgradedVersion(int i) {
IrisToUpgradedVersion = i;
}
public int getUpgradedVersion() {
return IrisToUpgradedVersion;
}
public void setVersion(int i) {
IrisCreationVersion = i;
}
public int getVersion() {
return IrisCreationVersion;
}
public void setMCVersion(int i) {
MinecraftVersion = i;
}
public int getMCVersion() {
return MinecraftVersion;
}
public void hotloaded() {
TOTAL_HOTLOADS.incrementAndGet(this);
}
}
@@ -1,59 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.value;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.Snippet;
import art.arcane.volmlib.util.math.RNG;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Snippet("range")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents a range")
@Data
public class IrisRange {
@Desc("The minimum value")
private double min = 16;
@Desc("The maximum value")
private double max = 32;
public double get(RNG rng) {
if (min == max) {
return min;
}
return rng.d(min, max);
}
public boolean contains(int v) {
return v >= min && v <= max;
}
public IrisRange merge(IrisRange other) {
min = Math.min(min, other.min);
max = Math.max(max, other.max);
return this;
}
}
@@ -1,36 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.world;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("Represents a world environment")
public enum IrisEnvironment {
@Desc("The overworld environment")
NORMAL,
@Desc("The nether environment")
NETHER,
@Desc("The end environment")
THE_END,
@Desc("A custom environment")
CUSTOM
}
@@ -1,91 +0,0 @@
package art.arcane.iris.engine.object.world;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.MaxNumber;
import art.arcane.iris.engine.object.annotations.MinNumber;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.Objects;
@Accessors(chain = true)
@NoArgsConstructor
@Desc("The native Minecraft world border applied to worlds using this dimension")
@Data
public class IrisWorldBoundary {
public static final double DEFAULT_DAMAGE_AMOUNT = 0.2D;
public static final double DEFAULT_DAMAGE_BUFFER = 5D;
public static final double MAXIMUM_CENTER = 29_999_984D;
public static final double MAXIMUM_SIZE = 59_999_968D;
@Desc("The center of the boundary")
private IrisWorldBoundaryCenter center = new IrisWorldBoundaryCenter();
@MinNumber(1)
@MaxNumber(59_999_968)
@Desc("The full border diameter in blocks, matching Minecraft world-border terminology")
private double size = 16_384D;
@MinNumber(0)
@MaxNumber(Integer.MAX_VALUE)
@Desc("Distance from the border at which the client warning begins")
private int warningDistance = 16;
@MinNumber(0)
@Desc("Safe distance outside the border before damage begins")
private double damageBuffer = DEFAULT_DAMAGE_BUFFER;
@MinNumber(0)
@Desc("Damage per block beyond damageBuffer")
private double damageAmount = DEFAULT_DAMAGE_AMOUNT;
public static IrisWorldBoundary snapshot(IrisWorldBoundary configured) {
IrisWorldBoundary source = Objects.requireNonNull(configured, "Configured worldBoundary");
source.validate();
return new IrisWorldBoundary()
.setCenter(new IrisWorldBoundaryCenter(source.getCenter().getX(), source.getCenter().getZ()))
.setSize(source.getSize())
.setWarningDistance(source.getWarningDistance())
.setDamageBuffer(source.getDamageBuffer())
.setDamageAmount(source.getDamageAmount());
}
public void validate() {
if (center == null) {
throw new IllegalArgumentException("worldBoundary.center is required");
}
if (!Double.isFinite(center.getX()) || Math.abs(center.getX()) > MAXIMUM_CENTER
|| !Double.isFinite(center.getZ()) || Math.abs(center.getZ()) > MAXIMUM_CENTER) {
throw new IllegalArgumentException("worldBoundary.center must be finite and within +/-" + MAXIMUM_CENTER);
}
if (!Double.isFinite(size) || size < 1D || size > MAXIMUM_SIZE) {
throw new IllegalArgumentException("worldBoundary.size must be between 1 and " + MAXIMUM_SIZE);
}
if (warningDistance < 0) {
throw new IllegalArgumentException("worldBoundary.warningDistance cannot be negative");
}
if (!Double.isFinite(damageBuffer) || damageBuffer < 0D) {
throw new IllegalArgumentException("worldBoundary.damageBuffer must be finite and non-negative");
}
if (!Double.isFinite(damageAmount) || damageAmount < 0D) {
throw new IllegalArgumentException("worldBoundary.damageAmount must be finite and non-negative");
}
}
public double minimumX() {
return center.getX() - size / 2D;
}
public double maximumX() {
return center.getX() + size / 2D;
}
public double minimumZ() {
return center.getZ() - size / 2D;
}
public double maximumZ() {
return center.getZ() + size / 2D;
}
}
@@ -1,29 +0,0 @@
package art.arcane.iris.engine.object.world;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.MaxNumber;
import art.arcane.iris.engine.object.annotations.MinNumber;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@NoArgsConstructor
@Desc("The world-border center in block coordinates")
@Data
public class IrisWorldBoundaryCenter {
@MinNumber(-29_999_984)
@MaxNumber(29_999_984)
@Desc("The world-border center X coordinate")
private double x = 0D;
@MinNumber(-29_999_984)
@MaxNumber(29_999_984)
@Desc("The world-border center Z coordinate")
private double z = 0D;
public IrisWorldBoundaryCenter(double x, double z) {
this.x = x;
this.z = z;
}
}
@@ -1,36 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.world.biome;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("Represents a biome type")
public enum InferredType {
@Desc("Represents any shore biome type")
SHORE,
@Desc("Represents any land biome type")
LAND,
@Desc("Represents any sea biome type")
SEA,
@Desc("Represents any cave biome type")
CAVE
}
@@ -1,75 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.world.biome.custom;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("The custom biome category. Vanilla asks for this, basically what represents your biome closest?")
public enum IrisBiomeCustomCategory {
@Desc("Tags the generated datapack biome as vanilla category 'beach' (shoreline biomes).")
beach,
@Desc("Tags the generated datapack biome as vanilla category 'desert' (hot, dry sand biomes).")
desert,
@Desc("Tags the generated datapack biome as vanilla category 'extreme_hills' (mountain biomes).")
extreme_hills,
@Desc("Tags the generated datapack biome as vanilla category 'forest' (tree-dense temperate biomes).")
forest,
@Desc("Tags the generated datapack biome as vanilla category 'icy' (snow and ice biomes).")
icy,
@Desc("Tags the generated datapack biome as vanilla category 'jungle'.")
jungle,
@Desc("Tags the generated datapack biome as vanilla category 'mesa' (badlands).")
mesa,
@Desc("Tags the generated datapack biome as vanilla category 'mushroom' (mushroom fields).")
mushroom,
@Desc("Tags the generated datapack biome as vanilla category 'nether'.")
nether,
@Desc("Tags the generated datapack biome as vanilla category 'none' (no classification).")
none,
@Desc("Tags the generated datapack biome as vanilla category 'ocean'.")
ocean,
@Desc("Tags the generated datapack biome as vanilla category 'plains'. This is the default when category is omitted.")
plains,
@Desc("Tags the generated datapack biome as vanilla category 'river'.")
river,
@Desc("Tags the generated datapack biome as vanilla category 'savanna'.")
savanna,
@Desc("Tags the generated datapack biome as vanilla category 'swamp'.")
swamp,
@Desc("Tags the generated datapack biome as vanilla category 'taiga'.")
taiga,
@Desc("Tags the generated datapack biome as vanilla category 'the_end'.")
the_end
}
@@ -1,33 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.world.biome.custom;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("Snow, rain, or nothing")
public enum IrisBiomeCustomPrecipType {
@Desc("No downfall")
none,
@Desc("Rain downfall")
rain,
@Desc("Snow downfall")
snow
}
@@ -1,48 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2022 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.world.biome.custom;
import art.arcane.iris.engine.object.annotations.Desc;
@Desc("The mob spawn group")
public enum IrisBiomeCustomSpawnType {
@Desc("Typical monsters that spawn at night, like zombies and skeletons")
MONSTER,
@Desc("Typical creatures like sheep, pigs, cows")
CREATURE,
@Desc("Eg bats")
AMBIENT,
@Desc("Axolotls")
AXOLOTLS,
@Desc("Odd spawn group but ok")
UNDERGROUND_WATER_CREATURE,
@Desc("Water mobs like squid, dolphins")
WATER_CREATURE,
@Desc("Fish")
WATER_AMBIENT,
@Desc("Unknown")
MISC
}
@@ -1,185 +0,0 @@
/*
* Iris is a World Generator for Minecraft Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.world.biome.custom;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
* Direct vanilla biome tag membership, generated from the MC 26.2 built-in datapack
* (data/minecraft/tags/worldgen/biome). Used to give Iris custom biomes the tag membership of the vanilla
* biome they derive from, so tag selectors written by vanilla and by mods (#minecraft:is_overworld and
* friends) resolve against Iris terrain.
*
* <p>Only DIRECT membership is listed. Vanilla's derived tags reference other tags rather than repeating
* biomes (#minecraft:is_ocean includes #minecraft:is_deep_ocean, water_on_map_outlines includes
* #minecraft:is_river, and so on), so adding a custom biome to the direct tags carries it into the derived
* tags for free.
*
* <p>The has_structure/* tags are deliberately absent. Iris resolves native structure placement through the
* biome's structure derivative, never through the custom biome, so injecting custom biomes there would place
* a structure twice.
*
* <p>{@code stronghold_biased_to} is absent for the same reason, even though it is not a has_structure tag.
* It is a structure-placement input: {@code worldgen/structure_set/strongholds.json} reads it as
* {@code preferred_biomes} when it rings strongholds around spawn. Inheriting it would enter every Iris biome
* derived from a tagged vanilla biome into that ring - which is the entire overworld surface of a typical pack -
* and let vanilla place strongholds where the pack's own structure configuration did not ask for them.
*
* <p>An unknown key (a mod biome, a datapack biome, or a vanilla biome added after 26.2) contributes nothing;
* the pack author's explicit tags still apply.
*/
public final class IrisVanillaBiomeTags {
private static final String TAG_NAMESPACE = "minecraft:";
private static final Map<String, List<String>> DIRECT_TAGS = new HashMap<>(96);
private IrisVanillaBiomeTags() {
}
/**
* Tags the given vanilla biome key belongs to directly. Never null; empty for unknown keys. Keys are
* returned fully namespaced and lowercase.
*/
public static List<String> tagsFor(String biomeKey) {
if (biomeKey == null || biomeKey.isBlank()) {
return List.of();
}
String normalized = biomeKey.trim().toLowerCase(Locale.ROOT);
if (normalized.indexOf(':') < 0) {
normalized = TAG_NAMESPACE + normalized;
}
List<String> tags = DIRECT_TAGS.get(normalized);
return tags == null ? List.of() : tags;
}
static int knownBiomeCount() {
return DIRECT_TAGS.size();
}
private static void put(String biomeKey, String... tagPaths) {
String[] namespaced = new String[tagPaths.length];
for (int i = 0; i < tagPaths.length; i++) {
namespaced[i] = TAG_NAMESPACE + tagPaths[i];
}
DIRECT_TAGS.put(biomeKey, List.of(namespaced));
}
static {
put("minecraft:badlands", "is_badlands", "is_overworld");
put("minecraft:bamboo_jungle", "is_jungle", "is_overworld");
put("minecraft:basalt_deltas", "is_nether");
put("minecraft:beach", "is_beach", "is_overworld");
put("minecraft:birch_forest", "is_forest", "is_overworld");
put("minecraft:cherry_grove", "is_mountain", "is_overworld");
put("minecraft:cold_ocean", "is_ocean", "is_overworld", "spawns_cold_variant_farm_animals");
put("minecraft:crimson_forest", "is_nether");
put("minecraft:dark_forest", "is_forest", "is_overworld");
put("minecraft:deep_cold_ocean", "is_deep_ocean", "is_overworld", "spawns_cold_variant_farm_animals");
put("minecraft:deep_dark",
"is_overworld", "mineshaft_blocking", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs");
put("minecraft:deep_frozen_ocean",
"is_deep_ocean", "is_overworld", "polar_bears_spawn_on_alternate_blocks", "spawns_cold_variant_farm_animals",
"spawns_cold_variant_frogs");
put("minecraft:deep_lukewarm_ocean", "is_deep_ocean", "is_overworld", "spawns_warm_variant_farm_animals");
put("minecraft:deep_ocean", "is_deep_ocean", "is_overworld");
put("minecraft:desert",
"is_overworld", "spawns_gold_rabbits", "spawns_warm_variant_farm_animals", "spawns_warm_variant_frogs");
put("minecraft:dripstone_caves", "is_overworld");
put("minecraft:end_barrens", "is_end");
put("minecraft:end_highlands", "is_end");
put("minecraft:end_midlands", "is_end");
put("minecraft:eroded_badlands", "is_badlands", "is_overworld");
put("minecraft:flower_forest", "is_forest", "is_overworld");
put("minecraft:forest", "is_forest", "is_overworld");
put("minecraft:frozen_ocean",
"is_ocean", "is_overworld", "polar_bears_spawn_on_alternate_blocks", "spawns_cold_variant_farm_animals",
"spawns_cold_variant_frogs", "spawns_snow_foxes", "spawns_white_rabbits");
put("minecraft:frozen_peaks",
"is_mountain", "is_overworld", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs",
"spawns_snow_foxes", "spawns_white_rabbits");
put("minecraft:frozen_river",
"is_overworld", "is_river", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs",
"spawns_snow_foxes", "spawns_white_rabbits");
put("minecraft:grove",
"is_forest", "is_overworld", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs",
"spawns_snow_foxes", "spawns_white_rabbits");
put("minecraft:ice_spikes",
"is_overworld", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs", "spawns_snow_foxes",
"spawns_white_rabbits");
put("minecraft:jagged_peaks",
"is_mountain", "is_overworld", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs",
"spawns_snow_foxes", "spawns_white_rabbits");
put("minecraft:jungle", "is_jungle", "is_overworld");
put("minecraft:lukewarm_ocean", "is_ocean", "is_overworld", "spawns_warm_variant_farm_animals");
put("minecraft:lush_caves", "allows_tropical_fish_spawns_at_any_height", "is_overworld");
put("minecraft:mangrove_swamp",
"allows_surface_slime_spawns", "is_overworld", "spawns_warm_variant_farm_animals",
"spawns_warm_variant_frogs", "water_on_map_outlines");
put("minecraft:meadow", "is_mountain", "is_overworld");
put("minecraft:mushroom_fields", "is_overworld", "without_zombie_sieges");
put("minecraft:nether_wastes", "is_nether");
put("minecraft:ocean", "is_ocean", "is_overworld");
put("minecraft:old_growth_birch_forest", "is_forest", "is_overworld");
put("minecraft:old_growth_pine_taiga",
"is_overworld", "is_taiga", "spawns_cold_variant_farm_animals");
put("minecraft:old_growth_spruce_taiga",
"is_overworld", "is_taiga", "spawns_cold_variant_farm_animals");
put("minecraft:pale_garden", "is_forest", "is_overworld");
put("minecraft:plains", "is_overworld");
put("minecraft:river", "is_overworld", "is_river");
put("minecraft:savanna", "is_overworld", "is_savanna");
put("minecraft:savanna_plateau", "is_overworld", "is_savanna");
put("minecraft:small_end_islands", "is_end");
put("minecraft:snowy_beach",
"is_beach", "is_overworld", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs",
"spawns_snow_foxes", "spawns_white_rabbits");
put("minecraft:snowy_plains",
"is_overworld", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs", "spawns_snow_foxes",
"spawns_white_rabbits");
put("minecraft:snowy_slopes",
"is_mountain", "is_overworld", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs",
"spawns_snow_foxes", "spawns_white_rabbits");
put("minecraft:snowy_taiga",
"is_overworld", "is_taiga", "spawns_cold_variant_farm_animals", "spawns_cold_variant_frogs",
"spawns_snow_foxes", "spawns_white_rabbits");
put("minecraft:soul_sand_valley", "is_nether");
put("minecraft:sparse_jungle", "is_jungle", "is_overworld");
put("minecraft:stony_peaks", "is_mountain", "is_overworld", "spawns_cold_variant_farm_animals");
put("minecraft:stony_shore", "is_overworld");
put("minecraft:sulfur_caves", "is_overworld");
put("minecraft:sunflower_plains", "is_overworld");
put("minecraft:swamp", "allows_surface_slime_spawns", "is_overworld", "water_on_map_outlines");
put("minecraft:taiga", "is_overworld", "is_taiga", "spawns_cold_variant_farm_animals");
put("minecraft:the_end", "is_end");
put("minecraft:the_void", "without_wandering_trader_spawns");
put("minecraft:warm_ocean",
"is_ocean", "is_overworld", "produces_corals_from_bonemeal", "spawns_coral_variant_zombie_nautilus",
"spawns_warm_variant_farm_animals", "spawns_warm_variant_frogs");
put("minecraft:warped_forest", "is_nether");
put("minecraft:windswept_forest",
"is_hill", "is_overworld", "spawns_cold_variant_farm_animals");
put("minecraft:windswept_gravelly_hills",
"is_hill", "is_overworld", "spawns_cold_variant_farm_animals");
put("minecraft:windswept_hills", "is_hill", "is_overworld", "spawns_cold_variant_farm_animals");
put("minecraft:windswept_savanna", "is_overworld", "is_savanna");
put("minecraft:wooded_badlands", "is_badlands", "is_overworld");
}
}
@@ -1,25 +0,0 @@
/*
* Iris is a World Generator for Minecraft Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.engine.object.world.dimension;
public final class IrisDimensionContractException extends IllegalStateException {
public IrisDimensionContractException(String message) {
super(message);
}
}