mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-03 03:31:32 +00:00
Follow the module snippet folders and the moved types
Pack validators read decorators from snippet/iris/decorant/decorator and cave profiles from snippet/iris/carve/cave-profile. Fixture packs and the procedural golden set move their snippet files to the new folders; digests are unchanged. Tests import the moved types from art.arcane.iris.modules. EntityKeyHandler names the entity kind by id instead of importing EntityDefinition (IrisPackResources gains ids(kindId)). ObjectPlacementRegressionTest compares the namespaced void-air key, as its other assertions do; it failed when an earlier test had initialized IrisObject.States under a platform with bare keys.
This commit is contained in:
1 parent
7471f9fc42
commit
9e4ac30423
63 files changed
+130
-118
No files matched your search
@@ -165,6 +165,14 @@ public final class IrisPackResources implements PackResources {
|
||||
return kindOf(kind).ids();
|
||||
}
|
||||
|
||||
/**
|
||||
* The ids of the resources of the kind {@code kindId} names, for Iris's own tools that list a module's resources
|
||||
* without the module's class for them, which the plugin's classes cannot reach when the kind ships in a module jar.
|
||||
*/
|
||||
public List<ResourceId> ids(ResourceId kindId) {
|
||||
return kindOf(kindId).ids();
|
||||
}
|
||||
|
||||
/** The id of the resource the pack names by {@code packKey}, such as {@code overworld:castle/keep} for {@code castle/keep}. */
|
||||
@Override
|
||||
public ResourceId idOf(String packKey) {
|
||||
@@ -182,13 +190,17 @@ public final class IrisPackResources implements PackResources {
|
||||
}
|
||||
|
||||
private Kind<?> kindOf(ResourceKind<?> kind) {
|
||||
Kind<?> iris = irisKinds.get(kind.id());
|
||||
return kindOf(kind.id());
|
||||
}
|
||||
|
||||
private Kind<?> kindOf(ResourceId kindId) {
|
||||
Kind<?> iris = irisKinds.get(kindId);
|
||||
if (iris != null) {
|
||||
return iris;
|
||||
}
|
||||
Kind<?> module = moduleKinds().get(kind.id());
|
||||
Kind<?> module = moduleKinds().get(kindId);
|
||||
if (module == null) {
|
||||
throw new IllegalArgumentException("Iris serves pack resources of " + SERVED_TYPES + ", not " + kind.id());
|
||||
throw new IllegalArgumentException("Iris serves pack resources of " + SERVED_TYPES + ", not " + kindId);
|
||||
}
|
||||
return module;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
final class PackCaveProfileValidator {
|
||||
private static final String CAVE_PROFILE_SNIPPET_FOLDER = "snippet/cave-profile";
|
||||
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"),
|
||||
|
||||
@@ -100,7 +100,7 @@ public final class PackValidator {
|
||||
new File(packFolder, "biomes"), PackSpawnValidator::resolveEntitySpawnCategory));
|
||||
blockingErrors.addAll(PackBiomeLayerValidator.validateCeilingLayerCounts(new File(packFolder, "biomes")));
|
||||
blockingErrors.addAll(PackBiomeLayerValidator.validateDecoratorPalettes(
|
||||
new File(packFolder, "biomes"), new File(packFolder, "snippet/decorator")));
|
||||
new File(packFolder, "biomes"), new File(packFolder, "snippet/iris/decorant/decorator")));
|
||||
PackStyledRangeDefaultValidator.Validation styledRanges = PackStyledRangeDefaultValidator.validate(packFolder);
|
||||
addDistinct(blockingErrors, styledRanges.errors());
|
||||
addDistinct(warnings, styledRanges.warnings());
|
||||
|
||||
+4
-5
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.util.common.director.specialhandlers;
|
||||
|
||||
import art.arcane.iris.builtin.spawn.EntityDefinition;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.modules.PackModulesException;
|
||||
import art.arcane.iris.core.pack.PackDirectoryResolver;
|
||||
@@ -26,7 +25,7 @@ import art.arcane.iris.spi.IrisPlatforms;
|
||||
import art.arcane.iris.util.common.director.DirectorParameterHandler;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.director.exceptions.DirectorParsingException;
|
||||
import com.volmit.resource.ResourceKind;
|
||||
import com.volmit.resource.ResourceId;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.LinkedHashSet;
|
||||
@@ -34,9 +33,9 @@ import java.util.Set;
|
||||
|
||||
/** The key of an entity of a pack: the open pack's, then those of the packs in the packs folder. */
|
||||
public final class EntityKeyHandler implements DirectorParameterHandler<String> {
|
||||
// iris:spawn's entity kind, named by id: its constant, SpawnResources.ENTITIES, ships only in the built-ins jar, which
|
||||
// the plugin's own classes cannot reach. Packs serve kinds by id.
|
||||
private static final ResourceKind<EntityDefinition> ENTITIES = ResourceKind.of("iris:spawn/entity", "entities", EntityDefinition.class);
|
||||
// iris:spawn's entity kind, named by id: its constant and its class ship only in the built-ins jar, which the
|
||||
// plugin's own classes cannot reach.
|
||||
private static final ResourceId ENTITIES = ResourceId.parse("iris:spawn/entity");
|
||||
|
||||
@Override
|
||||
public KList<String> getPossibilities() {
|
||||
|
||||
Reference in new issue
Block a user