Put IrisApi on the modded adapters' classpath

The fabric, forge and neoforge builds resolved neither core's dependencies on
IrisApi nor the IrisApi types the adapters read (ResourceId, BlockTurn), so
none of them compiled. They apply the IrisApi source resolution like the root
build and compile against iris-api. NativeStructureReferenceRepairTest drops
the placement identity argument that NativeStructureStartPlan lost in batch 6.
This commit is contained in:
piexel committed 2026-10-28 03:29:45 +01:00
1 parent fe730fc8bd
commit 3e8c22422f
25 files changed
+15 -1310

No files matched your search

+2
View File
@@ -140,6 +140,8 @@ dependencies {
add('implementation', notation)
}
compileOnly('org.slf4j:slf4j-api:2.0.17')
compileOnly('com.volmit:iris-api')
testImplementation('com.volmit:iris-api')
compileOnly(libs.spigot) {
transitive = false
}
+2
View File
@@ -43,6 +43,8 @@ dependencyResolutionManagement {
// Shared VolmLib source resolution; see gradle/volmlib-resolution.settings.gradle.
apply from: new File(settingsDir, '../../gradle/volmlib-resolution.settings.gradle').canonicalFile
// Core's own dependencies on IrisApi must resolve here too, and the adapter reads IrisApi types (ResourceId, BlockTurn).
apply from: new File(settingsDir, '../../gradle/irisapi-resolution.settings.gradle').canonicalFile
includeBuild('../..') {
dependencySubstitution {
+2
View File
@@ -133,6 +133,8 @@ dependencies {
testImplementation('junit:junit:4.13.2')
testImplementation('org.mockito:mockito-core:5.23.0')
compileOnly('org.slf4j:slf4j-api:2.0.17')
compileOnly('com.volmit:iris-api')
testImplementation('com.volmit:iris-api')
compileOnly(libs.spigot) {
transitive = false
}
+2
View File
@@ -43,6 +43,8 @@ dependencyResolutionManagement {
// Shared VolmLib source resolution; see gradle/volmlib-resolution.settings.gradle.
apply from: new File(settingsDir, '../../gradle/volmlib-resolution.settings.gradle').canonicalFile
// Core's own dependencies on IrisApi must resolve here too, and the adapter reads IrisApi types (ResourceId, BlockTurn).
apply from: new File(settingsDir, '../../gradle/irisapi-resolution.settings.gradle').canonicalFile
includeBuild('../..') {
dependencySubstitution {
@@ -61,7 +61,6 @@ import static org.mockito.Mockito.mockStatic;
import static org.mockito.Mockito.when;
public class NativeStructureReferenceRepairTest {
private static final long MONUMENT_PLACEMENT_IDENTITY = 0x4D4F4E554D454E54L;
@BeforeClass
public static void bootstrapMinecraftRegistries() {
@@ -192,7 +191,7 @@ public class NativeStructureReferenceRepairTest {
private static NativeStructureStartPlan plan(ChunkPos origin, int baseY) {
return new NativeStructureStartPlan("minecraft:monument", origin.x(), origin.z(), baseY, false, false,
MONUMENT_PLACEMENT_IDENTITY, null, null);
null, null);
}
private static ChunkPos outsideLiveBounds(NativeStructureOwnershipRecord ownership,
+2
View File
@@ -109,6 +109,8 @@ dependencies {
testRuntimeOnly('org.junit.platform:junit-platform-launcher:6.1.2')
testRuntimeOnly('org.junit.vintage:junit-vintage-engine:6.1.2')
compileOnly('org.slf4j:slf4j-api:2.0.17')
compileOnly('com.volmit:iris-api')
testImplementation('com.volmit:iris-api')
compileOnly(libs.spigot) {
transitive = false
}
+2
View File
@@ -43,6 +43,8 @@ dependencyResolutionManagement {
// Shared VolmLib source resolution; see gradle/volmlib-resolution.settings.gradle.
apply from: new File(settingsDir, '../../gradle/volmlib-resolution.settings.gradle').canonicalFile
// Core's own dependencies on IrisApi must resolve here too, and the adapter reads IrisApi types (ResourceId, BlockTurn).
apply from: new File(settingsDir, '../../gradle/irisapi-resolution.settings.gradle').canonicalFile
includeBuild('../..') {
dependencySubstitution {
@@ -1,74 +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.core.modules;
import art.arcane.iris.builtin.objects.ObjectPlacement;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.function.Supplier;
/**
* Reads the object placements an Iris resource nests, such as a mod's placement injectors, the way {@code iris:objects}
* reads its own: with the modules' Gson, keeping the JSON that declares the placement's module settings. Register it
* before the factory that resolves snippets: Gson asks later registrations first, so that factory reads a snippet
* reference and this one decodes the snippet's JSON.
*/
public final class ObjectPlacementSettingsReader implements TypeAdapterFactory {
private final Supplier<ModuleSettingsDecoder> decoder;
/** {@code decoder} is asked for on the first placement read, so reading no placement loads no modules. */
public ObjectPlacementSettingsReader(Supplier<ModuleSettingsDecoder> decoder) {
this.decoder = decoder;
}
@Override
@SuppressWarnings("unchecked") // The type is checked to be ObjectPlacement.
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (type.getRawType() != ObjectPlacement.class) {
return null;
}
TypeAdapter<JsonElement> elements = gson.getAdapter(JsonElement.class);
return (TypeAdapter<T>) new TypeAdapter<ObjectPlacement>() {
@Override
public void write(JsonWriter out, ObjectPlacement placement) throws IOException {
if (placement == null || placement.json() == null) {
out.nullValue();
return;
}
out.jsonValue(placement.json());
}
@Override
public ObjectPlacement read(JsonReader in) throws IOException {
JsonElement json = elements.read(in);
if (json == null || json.isJsonNull()) {
return null;
}
return decoder.get().decodeResource(ObjectPlacement.class, json.toString());
}
};
}
}
@@ -1,98 +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.core.pack;
import art.arcane.volmlib.util.json.JSONObject;
import java.io.File;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
final class PackCaveProfileValidator {
private static final String CAVE_PROFILE_SNIPPET_FOLDER = "snippet/iris/carve/cave-profile";
private static final List<LegacyField> LEGACY_FIELDS = List.of(
new LegacyField("allowWater", "allowFluid"),
new LegacyField("waterMinDepthBelowSurface", "fluidMinDepthBelowSurface"),
new LegacyField("waterRequiresFloor", "fluidRequiresFloor")
);
private PackCaveProfileValidator() {
}
static List<String> validateLegacyFields(File packFolder) {
List<String> blockingErrors = new ArrayList<>();
if (packFolder == null || !packFolder.isDirectory()) {
return blockingErrors;
}
for (String folderName : PackValidator.STRUCTURE_HOST_FOLDERS) {
File resourceFolder = new File(packFolder, folderName);
if (!resourceFolder.isDirectory()) {
continue;
}
List<File> resourceFiles = PackValidationIo.listJsonRecursive(resourceFolder);
resourceFiles.sort(Comparator.comparing(File::getPath));
String resourceType = PackStructurePlacementValidator.structureHostType(folderName);
for (File resourceFile : resourceFiles) {
JSONObject resource = PackValidationIo.readJson(resourceFile);
if (resource == null) {
continue;
}
JSONObject caveProfile = resource.optJSONObject("caveProfile");
if (caveProfile == null) {
continue;
}
String resourceKey = PackValidationIo.deriveKey(resourceFolder, resourceFile);
validateFields(resourceType + " '" + resourceKey + "' caveProfile.", "caveProfile.", caveProfile,
blockingErrors);
}
}
File snippetFolder = new File(packFolder, CAVE_PROFILE_SNIPPET_FOLDER);
if (!snippetFolder.isDirectory()) {
return blockingErrors;
}
List<File> snippetFiles = PackValidationIo.listJsonRecursive(snippetFolder);
snippetFiles.sort(Comparator.comparing(File::getPath));
for (File snippetFile : snippetFiles) {
JSONObject caveProfile = PackValidationIo.readJson(snippetFile);
if (caveProfile == null) {
continue;
}
String snippetKey = PackValidationIo.deriveKey(snippetFolder, snippetFile);
validateFields("Cave-profile snippet '" + snippetKey + "' ", "", caveProfile, blockingErrors);
}
return blockingErrors;
}
private static void validateFields(String location, String replacementPrefix, JSONObject caveProfile,
List<String> blockingErrors) {
for (LegacyField field : LEGACY_FIELDS) {
if (caveProfile.has(field.oldName())) {
blockingErrors.add(location + field.oldName() + " was removed; use " + replacementPrefix
+ field.newName()
+ ". Cave aquifers use the dimension fluidPalette, which defaults to water.");
}
}
}
private record LegacyField(String oldName, String newName) {
}
}
@@ -1,158 +0,0 @@
package art.arcane.iris.engine.framework.placer;
import art.arcane.iris.platform.bukkit.BukkitBlockResolution;
import art.arcane.iris.core.loader.IrisData;
import art.arcane.iris.core.tools.IrisToolbelt;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.core.events.InventorySlotType;
import art.arcane.iris.core.events.IrisLootEvent;
import art.arcane.iris.engine.mantle.EngineMantle;
import art.arcane.iris.engine.platform.EngineBukkitOps;
import art.arcane.iris.engine.platform.PlatformChunkGenerator;
import art.arcane.iris.engine.object.placement.IObjectPlacer;
import art.arcane.iris.engine.object.prefab.TileData;
import art.arcane.iris.platform.bukkit.BukkitBlockState;
import art.arcane.iris.spi.IrisLogging;
import art.arcane.iris.spi.PlatformBlockState;
import art.arcane.iris.util.common.scheduling.J;
import art.arcane.volmlib.util.collection.KList;
import com.volmit.service.Loot;
import art.arcane.iris.util.common.data.IrisCustomData;
import art.arcane.volmlib.util.math.RNG;
import art.arcane.volmlib.util.matter.MatterCavern;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.inventory.InventoryHolder;
@Getter
@EqualsAndHashCode(exclude = {"engine", "mantle"})
public class WorldObjectPlacer implements IObjectPlacer {
private final World world;
private final Engine engine;
private final EngineMantle mantle;
public WorldObjectPlacer(World world) {
PlatformChunkGenerator a = IrisToolbelt.access(world);
if (a == null || a.getEngine() == null) throw new IllegalStateException(world.getName() + " is not an Iris World!");
this.world = world;
this.engine = a.getEngine();
this.mantle = engine.getMantle();
}
@Override
public int getHighest(int x, int z, IrisData data) {
return mantle.getHighest(x, z, data);
}
@Override
public int getHighest(int x, int z, IrisData data, boolean ignoreFluid) {
return mantle.getHighest(x, z, data, ignoreFluid);
}
@Override
public void set(int x, int y, int z, PlatformBlockState state) {
BlockData d = (BlockData) state.nativeHandle();
int worldY = y + world.getMinHeight();
if (worldY < world.getMinHeight() || worldY >= world.getMaxHeight()) return;
Block block = world.getBlockAt(x, worldY, z);
if (block.getType() == Material.BEDROCK) return;
boolean storageChest = BukkitBlockResolution.isStorageChest(d);
if (d instanceof IrisCustomData data) {
block.setBlockData(data.getBase(), false);
// Reached per block for every custom block in the pack; the pack is what needs changing, and
// one statement of that is enough.
IrisLogging.warnOnce("custom-block-placer", "Tried to place custom block at " + x + ", " + y + ", " + z + " which is not supported.");
} else block.setBlockData(d, false);
if (storageChest && !J.runRegion(world, x >> 4, z >> 4, () -> fillLoot(block), 1)) {
IrisLogging.warn("Failed to schedule loot resolution at " + x + ", " + worldY + ", " + z);
}
}
private void fillLoot(Block block) {
if (!BukkitBlockResolution.isStorageChest(block.getBlockData()) || !EngineBukkitOps.isCanonicalContainer(block)) {
return;
}
int x = block.getX();
int y = block.getY();
int z = block.getZ();
KList<Loot.Source> tables = EngineBukkitOps.getLootTables(engine, block);
try {
Bukkit.getPluginManager().callEvent(new IrisLootEvent(engine, block, InventorySlotType.STORAGE, tables));
if (tables.isEmpty()) {
return;
}
InventoryHolder holder = (InventoryHolder) block.getState();
EngineBukkitOps.addItems(engine, false, holder.getInventory(), tables, world, x, y, z);
} catch (Throwable e) {
IrisLogging.reportError(e);
}
}
@Override
public PlatformBlockState get(int x, int y, int z) {
return BukkitBlockState.of(world.getBlockAt(x, y + world.getMinHeight(), z).getBlockData());
}
@Override
public boolean isPreventingDecay() {
return mantle.isPreventingDecay();
}
@Override
public boolean isCarved(int x, int y, int z) {
return mantle.getMantle().get(x, y, z, MatterCavern.class) != null;
}
@Override
public boolean isSurfaceSolid(int x, int y, int z) {
return isSolid(x, y, z);
}
@Override
public boolean isSolid(int x, int y, int z) {
return world.getBlockAt(x, y + world.getMinHeight(), z).getType().isSolid();
}
@Override
public boolean isUnderwater(int x, int z) {
return mantle.isUnderwater(x, z);
}
@Override
public int getFluidHeight() {
return mantle.getFluidHeight();
}
@Override
public void setTile(int xx, int yy, int zz, TileData tile) {
int worldY = yy + world.getMinHeight();
if (worldY < world.getMinHeight() || worldY >= world.getMaxHeight()) return;
tile.toBukkitTry(world.getBlockAt(xx, worldY, zz));
}
@Override
public <T> void setData(int xx, int yy, int zz, T data) {
if (data == null || yy < 0 || yy >= engine.getHeight()) {
return;
}
mantle.getMantle().set(xx, yy, zz, data);
}
@Override
public <T> T getData(int xx, int yy, int zz, Class<T> t) {
if (yy < 0 || yy >= engine.getHeight()) {
return null;
}
return mantle.getMantle().get(xx, yy, zz, t);
}
}
@@ -1,115 +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.mod;
import art.arcane.iris.engine.object.prefab.IrisObject;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
import art.arcane.iris.engine.object.world.region.IrisRegion;
import art.arcane.iris.core.loader.IrisRegistrant;
import art.arcane.iris.engine.object.annotations.ArrayType;
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 art.arcane.iris.engine.object.annotations.RegistryListResource;
import art.arcane.iris.engine.object.annotations.Required;
import art.arcane.volmlib.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Desc("Represents a pack modification schema")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisMod extends IrisRegistrant {
@MinNumber(2)
@Required
@Desc("The human-readable name of this pack modification")
private String name = "A Pack Modification";
@Desc("The optional dimension load key this modification targets. An empty value does not restrict the target.")
private String forDimension = "";
@MinNumber(-1)
@MaxNumber(512)
@Desc("Override the fluid height. Otherwise set it to -1")
private int overrideFluidHeight = -1;
@Desc("A list of biomes to remove")
@RegistryListResource(IrisBiome.class)
@ArrayType(type = String.class, min = 1)
private KList<String> removeBiomes = new KList<>();
@Desc("A list of objects to remove")
@RegistryListResource(IrisObject.class)
@ArrayType(type = String.class, min = 1)
private KList<String> removeObjects = new KList<>();
@Desc("A list of regions to remove")
@RegistryListResource(IrisRegion.class)
@ArrayType(type = String.class, min = 1)
private KList<String> removeRegions = new KList<>();
@Desc("A list of regions to inject")
@RegistryListResource(IrisRegion.class)
@ArrayType(type = String.class, min = 1)
private KList<String> injectRegions = new KList<>();
@ArrayType(min = 1, type = IrisModBiomeInjector.class)
@Desc("Inject biomes into existing regions")
private KList<IrisModBiomeInjector> biomeInjectors = new KList<>();
@ArrayType(min = 1, type = IrisModBiomeReplacer.class)
@Desc("Replace biomes with other biomes")
private KList<IrisModBiomeReplacer> biomeReplacers = new KList<>();
@ArrayType(min = 1, type = IrisModObjectReplacer.class)
@Desc("Replace objects with other objects")
private KList<IrisModObjectReplacer> objectReplacers = new KList<>();
@ArrayType(min = 1, type = IrisModObjectPlacementBiomeInjector.class)
@Desc("Inject placers into existing biomes")
private KList<IrisModObjectPlacementBiomeInjector> biomeObjectPlacementInjectors = new KList<>();
@ArrayType(min = 1, type = IrisModObjectPlacementRegionInjector.class)
@Desc("Inject placers into existing regions")
private KList<IrisModObjectPlacementRegionInjector> regionObjectPlacementInjectors = new KList<>();
@ArrayType(min = 1, type = IrisModRegionReplacer.class)
@Desc("Replace regions with other regions")
private KList<IrisModRegionReplacer> regionReplacers = new KList<>();
@ArrayType(min = 1, type = IrisModNoiseStyleReplacer.class)
@Desc("Replace noise styles with other styles")
private KList<IrisModNoiseStyleReplacer> styleReplacers = new KList<>();
@Override
public String getFolderName() {
return "mods";
}
@Override
public String getTypeName() {
return "Mod";
}
}
@@ -1,51 +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.mod;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
import art.arcane.iris.engine.object.world.region.IrisRegion;
import art.arcane.iris.engine.object.annotations.ArrayType;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.RegistryListResource;
import art.arcane.iris.engine.object.annotations.Required;
import art.arcane.iris.engine.object.annotations.Snippet;
import art.arcane.volmlib.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Snippet("biome-injector")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("A biome injector")
@Data
public class IrisModBiomeInjector {
@Required
@Desc("The region to find")
@RegistryListResource(IrisRegion.class)
private String region = "";
@Required
@Desc("A biome to inject into the region")
@RegistryListResource(IrisBiome.class)
@ArrayType(type = String.class, min = 1)
private KList<String> inject = new KList<>();
}
@@ -1,50 +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.mod;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
import art.arcane.iris.engine.object.annotations.ArrayType;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.RegistryListResource;
import art.arcane.iris.engine.object.annotations.Required;
import art.arcane.iris.engine.object.annotations.Snippet;
import art.arcane.volmlib.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Snippet("biome-replacer")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("A biome replacer")
@Data
public class IrisModBiomeReplacer {
@Required
@Desc("A list of biomes to find")
@RegistryListResource(IrisBiome.class)
@ArrayType(type = String.class, min = 1)
private KList<String> find = new KList<>();
@Required
@Desc("A biome to replace it with")
@RegistryListResource(IrisBiome.class)
private String replace = "";
}
@@ -1,49 +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.mod;
import art.arcane.iris.engine.object.noise.IrisGeneratorStyle;
import art.arcane.iris.engine.object.noise.NoiseStyle;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.Required;
import art.arcane.iris.engine.object.annotations.Snippet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Snippet("noise-style-replacer")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("A noise style replacer")
@Data
public class IrisModNoiseStyleReplacer {
@Required
@Desc("A noise style to find")
private NoiseStyle find = NoiseStyle.IRIS;
@Required
@Desc("If replaceTypeOnly is set to true, Iris will keep the existing generator style and only replace the type itself. Otherwise it will use the replace tag for every style using the find type.")
private boolean replaceTypeOnly = false;
@Required
@Desc("A noise style to replace it with")
private IrisGeneratorStyle replace = new IrisGeneratorStyle();
}
@@ -1,50 +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.mod;
import art.arcane.iris.builtin.objects.ObjectPlacement;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
import art.arcane.iris.engine.object.annotations.ArrayType;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.RegistryListResource;
import art.arcane.iris.engine.object.annotations.Required;
import art.arcane.iris.engine.object.annotations.Snippet;
import art.arcane.volmlib.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Snippet("object-placement-biome-injector")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("An object placement injector")
@Data
public class IrisModObjectPlacementBiomeInjector {
@Required
@Desc("The biome to find")
@RegistryListResource(IrisBiome.class)
private String biome = "";
@Required
@Desc("Object placements to inject into the biome")
@ArrayType(type = ObjectPlacement.class, min = 1)
private KList<ObjectPlacement> place = new KList<>();
}
@@ -1,50 +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.mod;
import art.arcane.iris.builtin.objects.ObjectPlacement;
import art.arcane.iris.engine.object.world.region.IrisRegion;
import art.arcane.iris.engine.object.annotations.ArrayType;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.RegistryListResource;
import art.arcane.iris.engine.object.annotations.Required;
import art.arcane.iris.engine.object.annotations.Snippet;
import art.arcane.volmlib.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Snippet("object-placement-region-injector")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("An object placement injector")
@Data
public class IrisModObjectPlacementRegionInjector {
@Required
@Desc("The region to find")
@RegistryListResource(IrisRegion.class)
private String biome = "";
@Required
@Desc("Object placements to inject into the region")
@ArrayType(type = ObjectPlacement.class, min = 1)
private KList<ObjectPlacement> place = new KList<>();
}
@@ -1,50 +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.mod;
import art.arcane.iris.engine.object.prefab.IrisObject;
import art.arcane.iris.engine.object.annotations.ArrayType;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.RegistryListResource;
import art.arcane.iris.engine.object.annotations.Required;
import art.arcane.iris.engine.object.annotations.Snippet;
import art.arcane.volmlib.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Snippet("object-replacer")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("An object replacer")
@Data
public class IrisModObjectReplacer {
@Required
@Desc("A list of objects to find")
@RegistryListResource(IrisObject.class)
@ArrayType(type = String.class, min = 1)
private KList<String> find = new KList<>();
@Required
@Desc("An object to replace it with")
@RegistryListResource(IrisObject.class)
private String replace = "";
}
@@ -1,50 +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.mod;
import art.arcane.iris.engine.object.world.region.IrisRegion;
import art.arcane.iris.engine.object.annotations.ArrayType;
import art.arcane.iris.engine.object.annotations.Desc;
import art.arcane.iris.engine.object.annotations.RegistryListResource;
import art.arcane.iris.engine.object.annotations.Required;
import art.arcane.iris.engine.object.annotations.Snippet;
import art.arcane.volmlib.util.collection.KList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Snippet("region-replacer")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("A region replacer")
@Data
public class IrisModRegionReplacer {
@Required
@Desc("A list of regions to find")
@RegistryListResource(IrisRegion.class)
@ArrayType(type = String.class, min = 1)
private KList<String> find = new KList<>();
@Required
@Desc("A region to replace it with")
@RegistryListResource(IrisRegion.class)
private String replace = "";
}
@@ -1,67 +0,0 @@
package art.arcane.iris.core.pack;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class PackCaveProfileValidatorTest {
@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();
@Test
public void rejectsLegacyWaterFieldsAcrossEveryCaveProfileLocation() throws Exception {
File pack = temporaryFolder.newFolder("pack");
write(pack, "dimensions/main.json", "{\"caveProfile\":{\"allowWater\":false}}");
write(pack, "regions/nested/region.json", "{\"caveProfile\":{\"waterMinDepthBelowSurface\":20}}");
write(pack, "biomes/nested/biome.json", "{\"caveProfile\":{\"waterRequiresFloor\":true}}");
write(pack, "snippet/iris/carve/cave-profile/nested/profile.json", "{\"allowWater\":true}");
assertEquals(List.of(
"Dimension 'main' caveProfile.allowWater was removed; use caveProfile.allowFluid. Cave aquifers use the dimension fluidPalette, which defaults to water.",
"Region 'nested/region' caveProfile.waterMinDepthBelowSurface was removed; use caveProfile.fluidMinDepthBelowSurface. Cave aquifers use the dimension fluidPalette, which defaults to water.",
"Biome 'nested/biome' caveProfile.waterRequiresFloor was removed; use caveProfile.fluidRequiresFloor. Cave aquifers use the dimension fluidPalette, which defaults to water.",
"Cave-profile snippet 'nested/profile' allowWater was removed; use allowFluid. Cave aquifers use the dimension fluidPalette, which defaults to water."
), PackCaveProfileValidator.validateLegacyFields(pack));
}
@Test
public void acceptsGenericFluidFields() throws Exception {
File pack = temporaryFolder.newFolder("pack");
write(pack, "dimensions/main.json", "{\"caveProfile\":{\"allowFluid\":true,"
+ "\"fluidMinDepthBelowSurface\":20,\"fluidRequiresFloor\":true}}");
write(pack, "snippet/iris/carve/cave-profile/profile.json", "{\"allowFluid\":true,"
+ "\"fluidMinDepthBelowSurface\":20,\"fluidRequiresFloor\":true}");
assertTrue(PackCaveProfileValidator.validateLegacyFields(pack).isEmpty());
}
@Test
public void legacyFieldBlocksFullPackValidation() throws Exception {
File pack = temporaryFolder.newFolder("pack");
write(pack, "dimensions/main.json", "{\"regions\":[\"region\"]}");
write(pack, "regions/region.json", "{\"landBiomes\":[\"biome\"]}");
write(pack, "biomes/biome.json", "{\"name\":\"Biome\",\"caveProfile\":{\"allowWater\":false}}");
PackValidationResult result = PackValidator.validate(pack);
assertFalse(result.isLoadable());
assertTrue(result.getBlockingErrors().contains(
"Biome 'biome' caveProfile.allowWater was removed; use caveProfile.allowFluid. Cave aquifers use the dimension fluidPalette, which defaults to water."));
}
private void write(File root, String relative, String content) throws Exception {
Path path = root.toPath().resolve(relative);
Files.createDirectories(path.getParent());
Files.writeString(path, content, StandardCharsets.UTF_8);
}
}
@@ -1,54 +0,0 @@
package art.arcane.iris.core.pack;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class PackValidatorRemovedWorldgenFieldTest {
@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();
@Test
public void rejectsFluidBodiesAcrossEveryFormerHost() throws Exception {
File pack = temporaryFolder.newFolder("pack");
write(pack, "dimensions/main.json", "{\"fluidBodies\":{}}");
write(pack, "regions/nested/region.json", "{\"fluidBodies\":null}");
write(pack, "biomes/nested/biome.json", "{\"fluidBodies\":{\"lakes\":[]}}");
assertEquals(List.of(
"Dimension 'main' declares removed field 'fluidBodies'. Remove it because fluid-body generation is not supported.",
"Region 'nested/region' declares removed field 'fluidBodies'. Remove it because fluid-body generation is not supported.",
"Biome 'nested/biome' declares removed field 'fluidBodies'. Remove it because fluid-body generation is not supported."
), PackObjectSurfaceValidator.validateRemovedWorldgenFields(pack));
}
@Test
public void removedFluidBodiesBlocksFullPackValidation() throws Exception {
File pack = temporaryFolder.newFolder("pack");
write(pack, "dimensions/main.json", "{\"regions\":[\"region\"]}");
write(pack, "regions/region.json", "{\"landBiomes\":[\"biome\"]}");
write(pack, "biomes/biome.json", "{\"name\":\"Biome\",\"fluidBodies\":{}}");
PackValidationResult result = PackValidator.validate(pack);
assertFalse(result.isLoadable());
assertTrue(result.getBlockingErrors().contains(
"Biome 'biome' declares removed field 'fluidBodies'. Remove it because fluid-body generation is not supported."));
}
private void write(File root, String relative, String content) throws Exception {
Path path = root.toPath().resolve(relative);
Files.createDirectories(path.getParent());
Files.writeString(path, content, StandardCharsets.UTF_8);
}
}
+2 -1
View File
@@ -36,7 +36,8 @@
* When nothing is found the build fails here, naming where it looked, rather than later with an
* unresolvable dependency.
*
* The modded adapters do not apply this: they compile against core's jar and use no IrisApi type.
* The three modded adapter builds apply it too: core's dependencies on IrisApi must resolve in them, and the adapters
* read IrisApi types (ResourceId, BlockTurn).
*/
import java.io.File
@@ -1,270 +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.probe;
import art.arcane.iris.engine.loot.LootResources;
import art.arcane.iris.engine.spawn.SpawnResources;
import art.arcane.iris.core.loader.IrisData;
import art.arcane.iris.engine.framework.MeteredCache;
import art.arcane.iris.engine.framework.PreservationRegistry;
import art.arcane.iris.builtin.spawn.EntityDefinition;
import art.arcane.iris.builtin.spawn.EntitySpawn;
import art.arcane.iris.builtin.loot.LootEntry;
import art.arcane.iris.builtin.loot.LootTable;
import art.arcane.iris.builtin.spawn.Spawner;
import art.arcane.iris.spi.IrisPlatforms;
import art.arcane.iris.spi.IrisServices;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public final class DeserializationProbe {
private static final String FIXTURE_RESOURCE = "deserialization-pack";
private static final String ENTITY_KEY = "probe_entity";
private static final String SPAWNER_KEY = "probe_spawner";
private static final String LOOT_KEY = "probe_loot";
private static final List<Throwable> REPORTED = Collections.synchronizedList(new ArrayList<>());
@FunctionalInterface
private interface ProbeStep {
void run() throws Exception;
}
private static final class InertPreservation implements PreservationRegistry {
@Override
public void register(Thread thread) {
}
@Override
public void register(ExecutorService service) {
}
@Override
public void registerCache(MeteredCache cache) {
}
@Override
public void dereference() {
}
}
public static void main(String[] args) throws Exception {
IrisPlatforms.bind(new StubPlatform());
StubPlatform.verbose(false);
StubPlatform.errorSink(REPORTED::add);
IrisServices.register(PreservationRegistry.class, new InertPreservation());
boolean bukkitPresent = bukkitPresent();
System.out.println("[deserprobe] org.bukkit on classpath: " + bukkitPresent);
if (bukkitPresent) {
System.out.println("[deserprobe] FAIL: org.bukkit is on the probe runtime classpath; this gate only proves the Bukkit-free deserialization contract when Bukkit is absent.");
System.exit(1);
return;
}
File fixtureSource = resolveFixture(args);
if (fixtureSource == null || !fixtureSource.isDirectory()) {
System.out.println("[deserprobe] FAIL: fixture pack folder not found"
+ (fixtureSource == null ? "" : ": " + fixtureSource.getAbsolutePath()));
System.exit(1);
return;
}
File workRoot = Files.createTempDirectory("iris-deserprobe").toFile();
File pack = clonePack(fixtureSource, workRoot);
System.out.println("[deserprobe] fixture: " + fixtureSource.getAbsolutePath());
System.out.println("[deserprobe] work copy: " + pack.getAbsolutePath());
IrisData data;
try {
data = IrisData.get(pack);
} catch (Throwable e) {
System.out.println("[deserprobe] FAIL: IrisData loader construction threw before any deserialization");
e.printStackTrace(System.out);
printReported(drain());
System.exit(1);
return;
}
int failures = 0;
failures += run("entity<" + ENTITY_KEY + ">", () -> assertEntity(data));
failures += run("spawner<" + SPAWNER_KEY + ">", () -> assertSpawner(data));
failures += run("loot<" + LOOT_KEY + ">", () -> assertLoot(data));
List<Throwable> residual = drain();
if (!residual.isEmpty()) {
System.out.println("[deserprobe] FAIL: " + residual.size() + " residual error(s) reported after deserialization:");
printReported(residual);
failures += residual.size();
}
System.out.println("[deserprobe] RESULT: " + (failures == 0 ? "PASS" : "FAIL"));
System.exit(failures == 0 ? 0 : 1);
}
private static void assertEntity(IrisData data) {
EntityDefinition entity = SpawnResources.entity(data.getPackResources(), ENTITY_KEY);
require(entity != null, "entity deserialized");
require("minecraft:panda".equals(entity.type()), "type round-trips as authored namespaced string");
require("COMMAND".equals(entity.reason()), "reason retained as string");
require("BROWN".equals(entity.pandaMainGene()), "pandaMainGene retained as string");
require("LAZY".equals(entity.pandaHiddenGene()), "pandaHiddenGene retained as string");
require(entity.baby(), "baby flag retained");
require(entity.glowing(), "glowing flag retained");
LootEntry helmet = entity.helmet();
require(helmet != null, "helmet equipment loot deserialized");
require(helmet.unbreakable(), "helmet unbreakable flag retained");
require(helmet.itemFlags().contains("HIDE_ATTRIBUTES"), "helmet item flags retained as strings");
List<?> helmetEnchants = helmet.enchantments();
require(!helmetEnchants.isEmpty(), "helmet enchantments deserialized");
require(entity.mainHand() != null, "mainHand equipment loot deserialized");
List<EntityDefinition> passengers = entity.passengers();
require(passengers.size() == 1, "single passenger entity deserialized");
require("minecraft:zombie".equals(passengers.get(0).type()), "nested passenger type round-trips");
require(entity.attributes().size() == 1, "attribute modifier deserialized");
require("generic.max_health".equals(entity.attributes().get(0).attribute()), "attribute key retained as string");
require(entity.loot() != null, "loot reference deserialized");
require(entity.loot().tables().contains(LOOT_KEY), "loot reference table retained");
}
private static void assertSpawner(IrisData data) {
Spawner spawner = SpawnResources.spawner(data.getPackResources(), SPAWNER_KEY);
require(spawner != null, "spawner deserialized");
List<EntitySpawn> spawns = spawner.spawns();
require(spawns.size() == 1, "single entity spawn deserialized");
require(ENTITY_KEY.equals(spawns.get(0).entity()), "spawn references the probe entity by key");
require("NORMAL".equals(spawner.group().name()), "spawn group enum deserialized");
require(spawner.maxEntitiesPerChunk() == 4, "spawner numeric field retained");
}
private static void assertLoot(IrisData data) {
LootTable table = LootResources.table(data.getPackResources(), LOOT_KEY);
require(table != null, "loot table deserialized");
require(LOOT_KEY.equals(table.name()), "loot table name retained");
require(table.rarity() == 4, "loot table rarity retained");
List<LootEntry> items = table.loot();
require(!items.isEmpty(), "loot items deserialized");
LootEntry item = items.get(0);
require(item.maxAmount() == 3, "loot item amount retained");
require("STORAGE".equals(item.slotTypes().name()), "loot item slot type enum deserialized");
require(item.itemFlags().contains("HIDE_ENCHANTS"), "loot item flags retained as strings");
require(!item.enchantments().isEmpty(), "loot item enchantments deserialized");
require("unbreaking".equals(item.enchantments().get(0).enchantment()), "loot item enchantment key retained as string");
}
private static void require(boolean condition, String description) {
if (!condition) {
throw new IllegalStateException("assertion failed: " + description);
}
}
private static int run(String label, ProbeStep step) {
drain();
Throwable thrown = null;
try {
step.run();
} catch (Throwable e) {
thrown = e;
}
List<Throwable> reported = drain();
int failures = 0;
if (thrown != null) {
System.out.println("[deserprobe] " + label + " FAILED: " + thrown.getClass().getName() + ": " + thrown.getMessage());
thrown.printStackTrace(System.out);
failures++;
}
if (!reported.isEmpty()) {
System.out.println("[deserprobe] " + label + " FAILED: " + reported.size() + " error(s) reported (swallowed) during deserialization:");
printReported(reported);
failures += reported.size();
}
if (failures == 0) {
System.out.println("[deserprobe] " + label + " OK");
}
return failures;
}
private static boolean bukkitPresent() {
try {
Class.forName("org.bukkit.Bukkit", false, DeserializationProbe.class.getClassLoader());
return true;
} catch (ClassNotFoundException absent) {
return false;
}
}
private static File resolveFixture(String[] args) throws Exception {
if (args.length > 0 && !args[0].isBlank()) {
return new File(args[0]);
}
URL resource = DeserializationProbe.class.getClassLoader().getResource(FIXTURE_RESOURCE);
if (resource == null) {
return null;
}
return new File(resource.toURI());
}
private static File clonePack(File source, File workRoot) throws IOException {
Path sourcePath = source.toPath();
Path destinationPath = workRoot.toPath().resolve(source.getName());
List<Path> paths;
try (Stream<Path> walk = Files.walk(sourcePath)) {
paths = walk.collect(Collectors.toList());
}
for (Path path : paths) {
Path target = destinationPath.resolve(sourcePath.relativize(path).toString());
if (Files.isDirectory(path)) {
Files.createDirectories(target);
} else {
Files.createDirectories(target.getParent());
Files.copy(path, target, StandardCopyOption.REPLACE_EXISTING);
}
}
return destinationPath.toFile();
}
private static List<Throwable> drain() {
synchronized (REPORTED) {
List<Throwable> drained = new ArrayList<>(REPORTED);
REPORTED.clear();
return drained;
}
}
private static void printReported(List<Throwable> errors) {
for (Throwable error : errors) {
error.printStackTrace(System.out);
}
}
}
@@ -1,67 +0,0 @@
{
"type": "minecraft:panda",
"reason": "COMMAND",
"customName": "&aProbe Panda",
"customNameVisible": true,
"glowing": true,
"baby": true,
"pandaMainGene": "BROWN",
"pandaHiddenGene": "LAZY",
"helmet": {
"type": "minecraft:diamond_helmet",
"slotTypes": "STORAGE",
"rarity": 2,
"minAmount": 1,
"maxAmount": 1,
"unbreakable": true,
"itemFlags": [
"HIDE_ATTRIBUTES"
],
"enchantments": [
{
"enchantment": "protection",
"minLevel": 3,
"maxLevel": 4,
"chance": 1.0
}
],
"lore": [
"&7Probe helmet"
]
},
"mainHand": {
"type": "minecraft:diamond_sword",
"rarity": 1,
"enchantments": [
{
"enchantment": "sharpness",
"minLevel": 5,
"maxLevel": 5
}
]
},
"passengers": [
{
"type": "minecraft:zombie",
"reason": "NATURAL",
"baby": false
}
],
"attributes": [
{
"attribute": "generic.max_health",
"name": "probe_health",
"operation": "ADD_NUMBER",
"minAmount": 20,
"maxAmount": 20,
"chance": 1.0
}
],
"loot": {
"mode": "ADD",
"tables": [
"probe_loot"
],
"multiplier": 1.5
}
}
@@ -1,31 +0,0 @@
{
"name": "probe_loot",
"rarity": 4,
"maxPicked": 3,
"minPicked": 1,
"maxTries": 8,
"loot": [
{
"type": "minecraft:diamond",
"slotTypes": "STORAGE",
"rarity": 2,
"minAmount": 1,
"maxAmount": 3,
"unbreakable": false,
"itemFlags": [
"HIDE_ENCHANTS"
],
"enchantments": [
{
"enchantment": "unbreaking",
"minLevel": 3,
"maxLevel": 3,
"chance": 1.0
}
],
"lore": [
"&bShiny"
]
}
]
}
@@ -1,23 +0,0 @@
{
"spawns": [
{
"entity": "probe_entity",
"rarity": 1,
"minSpawns": 1,
"maxSpawns": 2
}
],
"maxEntitiesPerChunk": 4,
"group": "NORMAL",
"weather": "ANY",
"maximumRate": {
"amount": 1,
"per": {
"seconds": 30
}
},
"allowedLightLevels": {
"min": 0,
"max": 7
}
}