mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-29 09:15:27 +00:00
Merge branch 'wave3b/3' into feat/irisapi-host
# Conflicts: # core/src/main/java/art/arcane/iris/core/modules/IrisModuleHost.java # core/src/test/java/art/arcane/iris/core/modules/BuiltInPack.java
This commit is contained in:
commit
4928a80035
61 files changed
+1784
-1307
No files matched your search
+25
-20
@@ -23,8 +23,6 @@ import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.GenerationSessionLease;
|
||||
import art.arcane.iris.engine.framework.NativeFeatureGenerationPolicy;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.decoration.IrisDecorationStep;
|
||||
import art.arcane.iris.engine.object.decoration.IrisImportedFeatureControl;
|
||||
import art.arcane.iris.util.project.context.IrisContext;
|
||||
import it.unimi.dsi.fastutil.ints.IntArraySet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
@@ -49,6 +47,7 @@ import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.BitSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
@@ -172,23 +171,23 @@ final class ModdedImportedFeatureStage {
|
||||
}
|
||||
|
||||
private void build(Engine engine, long generation) {
|
||||
IrisImportedFeatureControl control;
|
||||
boolean enabled;
|
||||
try {
|
||||
control = NativeFeatureGenerationPolicy.control(engine);
|
||||
enabled = NativeFeatureGenerationPolicy.isEnabled(engine);
|
||||
} catch (RuntimeException error) {
|
||||
ModdedIrisLog.error("Iris could not read importedFeatures for this dimension; features off: {}",
|
||||
error.toString());
|
||||
markInert(generation);
|
||||
return;
|
||||
}
|
||||
if (!control.shouldGenerateFeatures()) {
|
||||
if (!enabled) {
|
||||
markInert(generation);
|
||||
return;
|
||||
}
|
||||
FeatureTable built;
|
||||
try (GenerationSessionLease lease = engine.acquireGenerationLease("modded_imported_features");
|
||||
IrisContext.Scope ignored = IrisContext.open(engine, lease.sessionId(), null)) {
|
||||
built = buildTable(engine, control, generation);
|
||||
built = buildTable(engine, generation);
|
||||
} catch (Throwable error) {
|
||||
ModdedIrisLog.error("Iris importedFeatures is off for {}: feature table construction failed: {}",
|
||||
dimensionKey(engine), error.toString());
|
||||
@@ -214,7 +213,7 @@ final class ModdedImportedFeatureStage {
|
||||
inertGeneration = generation;
|
||||
}
|
||||
|
||||
private FeatureTable buildTable(Engine engine, IrisImportedFeatureControl control, long generation) {
|
||||
private FeatureTable buildTable(Engine engine, long generation) {
|
||||
// Registry-ordered biome list. FeatureSorter's cycle detection walks it, so an unordered list makes
|
||||
// detection depend on JVM hash order and turns a real cycle into an intermittent one.
|
||||
List<Holder<Biome>> biomes = biomeSource.orderedPossibleBiomes();
|
||||
@@ -248,9 +247,17 @@ final class ModdedImportedFeatureStage {
|
||||
dimensionKey(engine), message);
|
||||
return null;
|
||||
}
|
||||
boolean filtered = control.getDisabled() != null && !control.getDisabled().isEmpty();
|
||||
return new FeatureTable(generation, control, List.copyOf(biomes), Set.copyOf(biomes),
|
||||
Map.copyOf(byKey), steps, Map.copyOf(derivatives), filtered);
|
||||
return new FeatureTable(generation, List.copyOf(biomes), Set.copyOf(biomes),
|
||||
Map.copyOf(byKey), steps, Map.copyOf(derivatives), generatedSteps(engine, steps.size()));
|
||||
}
|
||||
|
||||
/** The decoration steps whose features generate, by the platform's step index. */
|
||||
private static BitSet generatedSteps(Engine engine, int stepCount) {
|
||||
BitSet generated = new BitSet(stepCount);
|
||||
for (int stepIndex = 0; stepIndex < stepCount; stepIndex++) {
|
||||
generated.set(stepIndex, NativeFeatureGenerationPolicy.shouldGenerateStep(engine, stepIndex));
|
||||
}
|
||||
return generated;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,10 +331,10 @@ final class ModdedImportedFeatureStage {
|
||||
|
||||
try {
|
||||
for (int stepIndex = 0; stepIndex < steps.size(); stepIndex++) {
|
||||
if (!table.control().shouldGenerateStep(IrisDecorationStep.byOrdinal(stepIndex))) {
|
||||
if (!table.generatedSteps().get(stepIndex)) {
|
||||
continue;
|
||||
}
|
||||
placeStep(level, table, steps.get(stepIndex), featureRegistry, chunkBiomes, owner,
|
||||
placeStep(level, engine, table, steps.get(stepIndex), featureRegistry, chunkBiomes, owner,
|
||||
random, decorationSeed, origin, stepIndex);
|
||||
}
|
||||
} catch (Throwable error) {
|
||||
@@ -340,7 +347,7 @@ final class ModdedImportedFeatureStage {
|
||||
WorldCheckFeaturePlacement.recordPlacementPass();
|
||||
}
|
||||
|
||||
private void placeStep(WorldGenLevel level, FeatureTable table, FeatureSorter.StepFeatureData stepData,
|
||||
private void placeStep(WorldGenLevel level, Engine engine, FeatureTable table, FeatureSorter.StepFeatureData stepData,
|
||||
Registry<PlacedFeature> featureRegistry, Set<Holder<Biome>> chunkBiomes,
|
||||
IrisModdedChunkGenerator owner, WorldgenRandom random, long decorationSeed,
|
||||
BlockPos origin, int stepIndex) {
|
||||
@@ -363,11 +370,9 @@ final class ModdedImportedFeatureStage {
|
||||
Arrays.sort(featureIndices);
|
||||
for (int globalIndex : featureIndices) {
|
||||
PlacedFeature feature = stepData.features().get(globalIndex);
|
||||
if (table.filtered()) {
|
||||
Identifier featureId = featureRegistry.getKey(feature);
|
||||
if (featureId != null && !table.control().shouldGenerate(featureId.toString())) {
|
||||
continue;
|
||||
}
|
||||
Identifier featureId = featureRegistry.getKey(feature);
|
||||
if (featureId != null && !NativeFeatureGenerationPolicy.shouldGenerate(engine, featureId.toString())) {
|
||||
continue;
|
||||
}
|
||||
random.setFeatureSeed(decorationSeed, globalIndex, stepIndex);
|
||||
level.setCurrentlyGenerating(() -> describeFeature(featureRegistry, feature));
|
||||
@@ -423,10 +428,10 @@ final class ModdedImportedFeatureStage {
|
||||
return identifier == null ? null : identifier.toString().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
private record FeatureTable(long generation, IrisImportedFeatureControl control,
|
||||
private record FeatureTable(long generation,
|
||||
List<Holder<Biome>> biomes, Set<Holder<Biome>> biomeSet,
|
||||
Map<String, Holder<Biome>> byKey,
|
||||
List<FeatureSorter.StepFeatureData> steps,
|
||||
Map<String, Holder<Biome>> derivatives, boolean filtered) {
|
||||
Map<String, Holder<Biome>> derivatives, BitSet generatedSteps) {
|
||||
}
|
||||
}
|
||||
+10
-10
@@ -19,7 +19,7 @@
|
||||
package art.arcane.iris.modded;
|
||||
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.IrisStructureLocator;
|
||||
import art.arcane.iris.core.modules.ModuleServices;
|
||||
import art.arcane.iris.engine.framework.NativeStructureGenerationPolicy;
|
||||
import art.arcane.iris.engine.framework.NativeStructureLayouts;
|
||||
import art.arcane.iris.engine.framework.nativefit.NativeStructureFitting;
|
||||
@@ -129,7 +129,7 @@ final class ModdedNativeStructureStage {
|
||||
throw new IllegalStateException("Native structure locate received an unregistered structure holder");
|
||||
}
|
||||
String structureId = id.toString();
|
||||
if (!IrisStructureLocator.hasNativePlacement(current, structureId)) {
|
||||
if (!ModuleServices.startsStructure(current, structureId)) {
|
||||
continue;
|
||||
}
|
||||
NativeStructureLocatePersistence.Probe probe = NativeStructureLocatePersistence.probe(
|
||||
@@ -141,19 +141,19 @@ final class ModdedNativeStructureStage {
|
||||
searches.sort(Comparator.comparing(IrisNativeLocateSearch::structureId));
|
||||
for (int attempt = 0; attempt < NativeStructureLocatePersistence.MAX_SELECTED_CANDIDATE_RETRIES; attempt++) {
|
||||
IrisNativeLocateSearch bestSearch = null;
|
||||
IrisStructureLocator.LocateResult bestResult = null;
|
||||
ModuleServices.StructureSearch bestResult = null;
|
||||
long bestDistance = Long.MAX_VALUE;
|
||||
for (IrisNativeLocateSearch search : searches) {
|
||||
IrisStructureLocator.LocateResult result = search.search().predict();
|
||||
if (result.status() == IrisStructureLocator.LocateStatus.SEARCH_LIMIT_REACHED) {
|
||||
ModuleServices.StructureSearch result = search.search().predict();
|
||||
if (result.outcome() == ModuleServices.StructureSearch.Outcome.SEARCH_LIMIT_REACHED) {
|
||||
throw new IllegalStateException("Iris structure locate reached its safety limit for "
|
||||
+ search.structureId() + " within " + radius + " placement rings");
|
||||
}
|
||||
if (!result.found()) {
|
||||
continue;
|
||||
}
|
||||
long dx = (long) result.originX() - pos.getX();
|
||||
long dz = (long) result.originZ() - pos.getZ();
|
||||
long dx = (long) result.x() - pos.getX();
|
||||
long dz = (long) result.z() - pos.getZ();
|
||||
long distance = dx * dx + dz * dz;
|
||||
if (distance < bestDistance) {
|
||||
bestDistance = distance;
|
||||
@@ -166,7 +166,7 @@ final class ModdedNativeStructureStage {
|
||||
pos, null, () -> { }, nativeLocated, nativeReference);
|
||||
}
|
||||
Pair<BlockPos, Holder<Structure>> predicted = Pair.of(
|
||||
new BlockPos(bestResult.originX(), bestResult.baseY(), bestResult.originZ()),
|
||||
new BlockPos(bestResult.x(), bestResult.y(), bestResult.z()),
|
||||
bestSearch.holder());
|
||||
if (NativeStructureLocateResults.nearest(pos, predicted, nativeLocated) != predicted) {
|
||||
return NativeStructureLocateResults.selectAndReference(
|
||||
@@ -179,8 +179,8 @@ final class ModdedNativeStructureStage {
|
||||
continue;
|
||||
}
|
||||
BlockPos located = new BlockPos(
|
||||
bestResult.originX(), verified.ownership().locatorY(),
|
||||
bestResult.originZ());
|
||||
bestResult.x(), verified.ownership().locatorY(),
|
||||
bestResult.z());
|
||||
Pair<BlockPos, Holder<Structure>> irisLocated = Pair.of(located, bestSearch.holder());
|
||||
IrisNativeLocateSearch selectedSearch = bestSearch;
|
||||
NativeStructureLocatePersistence.VerifiedStart selectedStart = verified;
|
||||
|
||||
+3
-4
@@ -23,7 +23,6 @@ import art.arcane.iris.modded.ModdedIrisLog;
|
||||
import art.arcane.iris.spi.IrisPlatforms;
|
||||
import art.arcane.iris.core.pack.PackDirectoryResolver;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.IrisStructureLocator;
|
||||
import art.arcane.iris.engine.framework.NativeStructureGenerationPolicy;
|
||||
import art.arcane.iris.engine.framework.StructureReachability;
|
||||
import art.arcane.iris.engine.framework.NativeStructureGenerationStatus;
|
||||
@@ -133,9 +132,9 @@ final class ModdedCommandSuggestions {
|
||||
String key = identifier.toString();
|
||||
registeredKeys.add(normalizeKey(key));
|
||||
NativeStructureGenerationStatus status = NativeStructureGenerationPolicy.resolve(engine, key);
|
||||
boolean nativePlacement = IrisStructureLocator.hasNativePlacement(engine, key);
|
||||
boolean nativePlacement = ModuleServices.startsStructure(engine, key);
|
||||
boolean locatableNativePlacement = nativePlacement
|
||||
&& IrisStructureLocator.hasLocatableNativePlacement(engine, key);
|
||||
&& ModuleServices.canLocateStart(engine, key);
|
||||
boolean locatableEditableReplacement = !nativePlacement
|
||||
&& status == NativeStructureGenerationStatus.REPLACED_BY_IRIS
|
||||
&& ModuleServices.canLocateStructure(engine, key);
|
||||
@@ -147,7 +146,7 @@ final class ModdedCommandSuggestions {
|
||||
}
|
||||
Collection<String> unregisteredIrisKeys = eligibleUnregisteredEditableKeys(
|
||||
irisKeys, registeredKeys,
|
||||
(String candidate) -> IrisStructureLocator.hasNativePlacement(engine, candidate));
|
||||
(String candidate) -> ModuleServices.startsStructure(engine, candidate));
|
||||
return SharedSuggestionProvider.suggest(
|
||||
combineStructureKeys(unregisteredIrisKeys, nativeKeys), builder);
|
||||
} catch (Throwable e) {
|
||||
|
||||
+5
-6
@@ -25,7 +25,6 @@ import art.arcane.iris.core.localization.ModdedCommandMessages;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.GenerationSessionException;
|
||||
import art.arcane.iris.engine.framework.GenerationSessionLease;
|
||||
import art.arcane.iris.engine.framework.IrisStructureLocator;
|
||||
import art.arcane.iris.engine.framework.Locator;
|
||||
import art.arcane.iris.engine.framework.NativeStructureGenerationPolicy;
|
||||
import art.arcane.iris.engine.framework.StructureReachability;
|
||||
@@ -156,7 +155,7 @@ final class ModdedLocateCommands {
|
||||
}
|
||||
Optional<NativeStructureTarget> resolved = resolveNativeStructure(source, level, engine, key);
|
||||
if (resolved.isEmpty()) {
|
||||
if (!IrisStructureLocator.hasNativePlacement(engine, key)
|
||||
if (!ModuleServices.startsStructure(engine, key)
|
||||
&& ModuleServices.canLocateStructure(engine, key)) {
|
||||
locateIrisStructure(source, level, engine, player, key);
|
||||
return 1;
|
||||
@@ -168,9 +167,9 @@ final class ModdedLocateCommands {
|
||||
NativeStructureGenerationStatus status = NativeStructureGenerationPolicy.resolve(engine, target.key());
|
||||
boolean nativeGenerationEnabled =
|
||||
source.getServer().getWorldGenSettings().options().generateStructures();
|
||||
boolean nativePlacement = IrisStructureLocator.hasNativePlacement(engine, target.key());
|
||||
boolean nativePlacement = ModuleServices.startsStructure(engine, target.key());
|
||||
boolean locatableNativePlacement = nativePlacement
|
||||
&& IrisStructureLocator.hasLocatableNativePlacement(engine, target.key());
|
||||
&& ModuleServices.canLocateStart(engine, target.key());
|
||||
boolean locatableEditableReplacement = !nativePlacement
|
||||
&& status == NativeStructureGenerationStatus.REPLACED_BY_IRIS
|
||||
&& ModuleServices.canLocateStructure(engine, target.key());
|
||||
@@ -357,7 +356,7 @@ final class ModdedLocateCommands {
|
||||
case NO_PLACEMENT -> unsupported++;
|
||||
}
|
||||
}
|
||||
int irisPlaced = IrisStructureLocator.placedKeys(engine).size();
|
||||
int irisPlaced = ModuleServices.placedStructures(engine).size();
|
||||
IrisModdedCommands.ok(source, IrisLanguage.plain(ModdedCommandMessages.IRIS_MODDED_COMMANDS_STRUCTURE_REACHABILITY_NATIVE_GENERATION_ELIGIBLE_IRIS_PLACED_NATIVE_DISABLED_NATIVE, MessageArgument.untrusted("available", available), MessageArgument.untrusted("irisPlaced", irisPlaced), MessageArgument.untrusted("disabled", disabled), MessageArgument.untrusted("suppressed", suppressed), MessageArgument.untrusted("unreachableBiomes", unreachableBiomes), MessageArgument.untrusted("unsupported", unsupported)));
|
||||
return 1;
|
||||
}
|
||||
@@ -365,7 +364,7 @@ final class ModdedLocateCommands {
|
||||
private static int verifyStructure(CommandSourceStack source, ServerLevel level, Engine engine, String key) {
|
||||
Optional<NativeStructureTarget> target = resolveNativeStructure(source, level, engine, key);
|
||||
if (target.isEmpty()) {
|
||||
if (IrisStructureLocator.isPlaced(engine, key)) {
|
||||
if (ModuleServices.placesStructure(engine, key)) {
|
||||
IrisModdedCommands.ok(source, IrisLanguage.plain(ModdedCommandMessages.IRIS_MODDED_COMMANDS_STRUCTURE_IS_IRIS_PLACED_LOCATABLE_WITH_IRIS_GOTO_STRUCTURE, MessageArgument.untrusted("key", key), MessageArgument.untrusted("key2", key)));
|
||||
return 1;
|
||||
}
|
||||
|
||||
+3
-20
@@ -38,7 +38,7 @@ import art.arcane.iris.engine.object.terrain.IrisGenerator;
|
||||
import art.arcane.iris.core.pack.ModuleResourceClosure;
|
||||
import art.arcane.iris.core.pack.PackExportClosure;
|
||||
import art.arcane.iris.engine.object.world.region.IrisRegion;
|
||||
import art.arcane.iris.engine.object.structure.IrisStructurePlacement;
|
||||
import art.arcane.iris.engine.object.structure.IrisStructure;
|
||||
import art.arcane.iris.modded.ModdedDimensionManager;
|
||||
import art.arcane.iris.modded.ModdedEngineBootstrap;
|
||||
import art.arcane.iris.modded.ModdedScheduler;
|
||||
@@ -881,9 +881,8 @@ public final class ModdedStudioCommands {
|
||||
LinkedHashSet<String> regionKeys = new LinkedHashSet<>();
|
||||
LinkedHashSet<String> biomeKeys = new LinkedHashSet<>();
|
||||
LinkedHashSet<String> generatorKeys = new LinkedHashSet<>();
|
||||
ModuleResourceClosure moduleResources = new ModuleResourceClosure(dm);
|
||||
ModuleResourceClosure moduleResources = new ModuleResourceClosure(dm).exportingElsewhere(IrisStructure.class);
|
||||
LinkedHashSet<String> objectKeys = new LinkedHashSet<>();
|
||||
LinkedHashSet<String> structureKeys = new LinkedHashSet<>();
|
||||
|
||||
dimension.getAllRegions(() -> dm).forEach((IrisRegion region) -> {
|
||||
if (region != null && region.getLoadKey() != null) {
|
||||
@@ -896,7 +895,6 @@ public final class ModdedStudioCommands {
|
||||
}
|
||||
});
|
||||
moduleResources.followSettingsOf(dimension);
|
||||
collectStructureKeys(structureKeys, dimension.getStructures());
|
||||
|
||||
for (String regionKey : regionKeys) {
|
||||
IrisRegion region = dm.getRegionLoader().load(regionKey);
|
||||
@@ -910,7 +908,6 @@ public final class ModdedStudioCommands {
|
||||
});
|
||||
moduleResources.followSettingsOf(region);
|
||||
moduleResources.follow(region.getObjects());
|
||||
collectStructureKeys(structureKeys, region.getStructures());
|
||||
objectKeys.addAll(PackExportClosure.collectObjectKeys(region.getObjects()));
|
||||
}
|
||||
for (String biomeKey : biomeKeys) {
|
||||
@@ -921,11 +918,11 @@ public final class ModdedStudioCommands {
|
||||
biome.getGenerators().forEach((IrisBiomeGeneratorLink link) -> generatorKeys.add(link.getGenerator()));
|
||||
moduleResources.followSettingsOf(biome);
|
||||
moduleResources.follow(biome.getObjects());
|
||||
collectStructureKeys(structureKeys, biome.getStructures());
|
||||
objectKeys.addAll(PackExportClosure.collectObjectKeys(biome.getObjects()));
|
||||
}
|
||||
|
||||
StringBuilder hashes = new StringBuilder();
|
||||
List<String> structureKeys = moduleResources.keysOf(IrisStructure.class);
|
||||
StructurePackageClosure structureClosure = StructurePackageClosure.collect(packFolder, structureKeys);
|
||||
if (!structureClosure.isValid()) {
|
||||
throw new IOException("Structure package closure is invalid: " + String.join("; ", structureClosure.errors()));
|
||||
@@ -969,20 +966,6 @@ public final class ModdedStudioCommands {
|
||||
return output;
|
||||
}
|
||||
|
||||
private static void collectStructureKeys(LinkedHashSet<String> keys, List<IrisStructurePlacement> placements) {
|
||||
if (placements == null) {
|
||||
return;
|
||||
}
|
||||
for (IrisStructurePlacement placement : placements) {
|
||||
if (placement == null || placement.getStructures() == null) {
|
||||
continue;
|
||||
}
|
||||
for (String structureKey : placement.getStructures()) {
|
||||
keys.add(structureKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String copyJson(File folder, String category, String key, File file) {
|
||||
if (file == null || !file.isFile()) {
|
||||
return "";
|
||||
|
||||
+6
-7
@@ -21,7 +21,6 @@ package art.arcane.iris.modded.command;
|
||||
import art.arcane.iris.core.modules.ModuleServices;
|
||||
import art.arcane.iris.modded.ModdedIrisLog;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.IrisStructureLocator;
|
||||
import art.arcane.iris.engine.framework.NativeStructureGenerationPolicy;
|
||||
import art.arcane.iris.engine.framework.StructureReachability;
|
||||
import art.arcane.iris.engine.framework.NativeStructureGenerationStatus;
|
||||
@@ -107,9 +106,9 @@ final class ModdedUnregisteredStructures {
|
||||
continue;
|
||||
}
|
||||
NativeStructureGenerationStatus status = NativeStructureGenerationPolicy.resolve(engine, key);
|
||||
boolean nativePlacement = IrisStructureLocator.hasNativePlacement(engine, key);
|
||||
boolean nativePlacement = ModuleServices.startsStructure(engine, key);
|
||||
boolean locatableNativePlacement = nativePlacement
|
||||
&& IrisStructureLocator.hasLocatableNativePlacement(engine, key);
|
||||
&& ModuleServices.canLocateStart(engine, key);
|
||||
boolean locatableEditableReplacement = !nativePlacement
|
||||
&& status == NativeStructureGenerationStatus.REPLACED_BY_IRIS
|
||||
&& ModuleServices.canLocateStructure(engine, key);
|
||||
@@ -128,8 +127,8 @@ final class ModdedUnregisteredStructures {
|
||||
excluded.put(normalizedKey, new ExcludedStructure(ReportStatus.EXCLUDED, key, reason));
|
||||
}
|
||||
List<String> absentNativeKeys = missingConfiguredNativeKeys(
|
||||
IrisStructureLocator.placedKeys(engine), registeredKeys,
|
||||
(String key) -> IrisStructureLocator.hasNativePlacement(engine, key));
|
||||
ModuleServices.placedStructures(engine), registeredKeys,
|
||||
(String key) -> ModuleServices.startsStructure(engine, key));
|
||||
for (String key : absentNativeKeys) {
|
||||
String normalizedKey = ModdedCommandSuggestions.normalizeKey(key);
|
||||
excluded.putIfAbsent(normalizedKey, new ExcludedStructure(ReportStatus.UNREGISTERED, key,
|
||||
@@ -143,12 +142,12 @@ final class ModdedUnregisteredStructures {
|
||||
continue;
|
||||
}
|
||||
boolean registered = registeredKeys.contains(normalizedKey);
|
||||
boolean nativePlacement = IrisStructureLocator.hasNativePlacement(engine, key);
|
||||
boolean nativePlacement = ModuleServices.startsStructure(engine, key);
|
||||
boolean locatableEditable = ModuleServices.canLocateStructure(engine, key);
|
||||
if (!registered && !nativePlacement && locatableEditable) {
|
||||
continue;
|
||||
}
|
||||
boolean configured = IrisStructureLocator.hasEditablePlacement(engine, key);
|
||||
boolean configured = ModuleServices.placesStructure(engine, key);
|
||||
excluded.putIfAbsent(normalizedKey, new ExcludedStructure(
|
||||
ReportStatus.UNPLACED, key.trim(), editableExclusionReason(configured)));
|
||||
}
|
||||
|
||||
+9
-9
@@ -197,16 +197,16 @@ public class IrisModdedStructureCommandTest {
|
||||
|
||||
assertTrue(method.contains("ServerLevel level = source.getLevel()"));
|
||||
assertTrue(method.contains("Engine engine = IrisModdedCommands.engineFor(level)"));
|
||||
assertFalse(method.contains("IrisStructureLocator.locatableKeys(engine)"));
|
||||
assertFalse(method.contains("IrisStructureLocator"));
|
||||
assertTrue(method.contains("ModuleServices.locatableStructures(engine)"));
|
||||
assertTrue(method.contains("StructureReachability.reachableKeys(engine)"));
|
||||
assertTrue(method.contains("NativeStructureGenerationPolicy.resolve(engine, key)"));
|
||||
assertTrue(method.contains("IrisStructureLocator.hasLocatableNativePlacement(engine, key)"));
|
||||
assertTrue(method.contains("ModuleServices.canLocateStart(engine, key)"));
|
||||
assertTrue(method.contains("ModuleServices.canLocateStructure(engine, key)"));
|
||||
assertTrue(method.contains("reachableNativeKeys.contains(normalizeKey(key))"));
|
||||
assertTrue(method.contains("nativeGenerationEnabled"));
|
||||
assertTrue(method.contains("eligibleUnregisteredEditableKeys("));
|
||||
assertTrue(method.contains("IrisStructureLocator.hasNativePlacement(engine, candidate)"));
|
||||
assertTrue(method.contains("ModuleServices.startsStructure(engine, candidate)"));
|
||||
assertFalse(method.contains("NativeStructureGenerationKeys.active(level)"));
|
||||
assertFalse(method.contains("getPlacementsForStructure"));
|
||||
}
|
||||
@@ -219,7 +219,7 @@ public class IrisModdedStructureCommandTest {
|
||||
String method = source.substring(methodStart, methodEnd);
|
||||
int registryLookup = method.indexOf("level.registryAccess().lookupOrThrow(Registries.STRUCTURE)");
|
||||
int placedCheck = method.indexOf(
|
||||
"if (!IrisStructureLocator.hasNativePlacement(current, structureId))");
|
||||
"if (!ModuleServices.startsStructure(current, structureId))");
|
||||
int irisLocate = method.indexOf("NativeStructureLocatePersistence.search(", placedCheck);
|
||||
int nearestSelection = method.indexOf(
|
||||
"NativeStructureLocateResults.nearest(pos, predicted, nativeLocated)", irisLocate);
|
||||
@@ -235,7 +235,7 @@ public class IrisModdedStructureCommandTest {
|
||||
assertTrue(selectedReference > selectedVerification);
|
||||
assertTrue(method.contains("NativeStructureLocatePersistence.probe("));
|
||||
assertTrue(method.contains("findUnexplored"));
|
||||
assertTrue(method.contains("LocateStatus.SEARCH_LIMIT_REACHED"));
|
||||
assertTrue(method.contains("Outcome.SEARCH_LIMIT_REACHED"));
|
||||
assertTrue(method.contains("verified.ownership().locatorY()"));
|
||||
assertTrue(method.contains("selectedSearch.search().reference(selectedStart)"));
|
||||
assertTrue(method.contains("NativeStructureLocateResults.selectAndReference("));
|
||||
@@ -271,12 +271,12 @@ public class IrisModdedStructureCommandTest {
|
||||
assertTrue(eligibilityCheck > policyResolution);
|
||||
assertTrue(replacementLocate > eligibilityCheck);
|
||||
assertTrue(nativeLocate > replacementLocate);
|
||||
assertTrue(method.contains("IrisStructureLocator.hasLocatableNativePlacement(engine, target.key())"));
|
||||
assertTrue(method.contains("ModuleServices.canLocateStart(engine, target.key())"));
|
||||
assertTrue(method.contains("ModuleServices.canLocateStructure(engine, target.key())"));
|
||||
assertTrue(method.contains("!IrisStructureLocator.hasNativePlacement(engine, key)"));
|
||||
assertTrue(method.contains("!ModuleServices.startsStructure(engine, key)"));
|
||||
assertTrue(method.contains("StructureReachability.isReachable(engine, target.key())"));
|
||||
assertTrue(method.contains("getWorldGenSettings().options().generateStructures()"));
|
||||
assertFalse(method.contains("IrisStructureLocator.isPlaced(engine, key)"));
|
||||
assertFalse(method.contains("ModuleServices.placesStructure(engine, key)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -287,7 +287,7 @@ public class IrisModdedStructureCommandTest {
|
||||
methodStart);
|
||||
String method = source.substring(methodStart, methodEnd);
|
||||
int nativeResolution = method.indexOf("resolveNativeStructure(source, level, engine, key)");
|
||||
int genericIrisLookup = method.indexOf("IrisStructureLocator.isPlaced(engine, key)", nativeResolution);
|
||||
int genericIrisLookup = method.indexOf("ModuleServices.placesStructure(engine, key)", nativeResolution);
|
||||
|
||||
assertTrue(nativeResolution >= 0);
|
||||
assertTrue(genericIrisLookup > nativeResolution);
|
||||
|
||||
Reference in new issue
Block a user