mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
VanillaFeatures service: whether the platform's own placed features run over a world and which steps and features they skip
@Service(ALL): generates(world) (off unless a module turns it on), generatesStep(world, Optional<DecorationStep>) (empty for a step the API does not name) and generatesFeature(world, feature); any provider may refuse a step or a feature. Answers depend on the world only; the host asks once per world, step and feature. README services table, DESIGN services and feature map, CONTRACTS types and host duty; a test that a silent provider leaves the pass off.
This commit is contained in:
1 parent
cf8b2bb0f6
commit
8676ebc328
5 files changed
+60
-1
No files matched your search
@@ -3,6 +3,7 @@ package com.volmit;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.config.OptionsMetadata;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.service.VanillaFeatures;
|
||||
import com.volmit.service.VanillaStructures;
|
||||
import com.volmit.vanilla.DecorationStep;
|
||||
import com.volmit.vanilla.JigsawOverrides;
|
||||
@@ -124,6 +125,16 @@ class VanillaStructureValuesTest {
|
||||
assertEquals(VanillaStructureRule.GENERATE, new VanillaStructures() { }.rule(CITY, null));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aFeatureProviderThatSaysNothingLeavesThePlatformsFeaturesOff() {
|
||||
VanillaFeatures silent = new VanillaFeatures() { };
|
||||
|
||||
assertFalse(silent.generates(null));
|
||||
assertTrue(silent.generatesStep(null, Optional.of(DecorationStep.UNDERGROUND_ORES)));
|
||||
assertTrue(silent.generatesStep(null, Optional.empty()));
|
||||
assertTrue(silent.generatesFeature(null, ResourceId.parse("minecraft:ore_diamond")));
|
||||
}
|
||||
|
||||
private static List<String> names(Class<?> type) {
|
||||
return OptionsMetadata.inspect(type).options().stream().map(OptionsMetadata.Option::name).toList();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user