mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
Reconcile wave 1 test fixtures: one serveModules helper, stub the pack folder after it
This commit is contained in:
1 parent
25fd24b7c2
commit
4de4b346aa
3 files changed
+27
-10
No files matched your search
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"note": "Generated index of every structure available at runtime. Toggle vanilla/datapack generation via the dimension importedStructures block (by structure key). Place structures via biome/region/dimension structures lists.",
|
||||
"counts": {
|
||||
"vanillaStructures": 1,
|
||||
"datapackStructures": 1,
|
||||
"structureSets": 1,
|
||||
"irisStructures": 1
|
||||
},
|
||||
"structures": {
|
||||
"vanilla": [
|
||||
"minecraft:village"
|
||||
],
|
||||
"datapack": [
|
||||
"example:castle"
|
||||
]
|
||||
},
|
||||
"structureSets": {
|
||||
"vanilla": [
|
||||
"minecraft:villages"
|
||||
],
|
||||
"datapack": []
|
||||
},
|
||||
"iris": [
|
||||
"castle"
|
||||
]
|
||||
}
|
||||
@@ -77,15 +77,6 @@ public final class ModuleResourceFixture {
|
||||
return registry.freeze();
|
||||
}
|
||||
|
||||
/** Makes {@code data} (a mock) load {@code modules} as its pack's modules, so services and hooks of theirs answer. */
|
||||
public static void serveModules(IrisData data, IrisModule... modules) {
|
||||
LoadedPack pack = mock(LoadedPack.class);
|
||||
when(pack.catalog()).thenReturn(catalogOf(modules));
|
||||
PackModuleSet moduleSet = mock(PackModuleSet.class);
|
||||
when(moduleSet.pack()).thenReturn(pack);
|
||||
when(data.getModules()).thenReturn(moduleSet);
|
||||
}
|
||||
|
||||
/** Serves {@code resource} as the resource of {@code kind} the pack names by {@code key}. */
|
||||
public <T> ModuleResourceFixture resource(ResourceKind<T> kind, String key, T resource) {
|
||||
ResourceId id = idOf(key);
|
||||
|
||||
@@ -105,8 +105,8 @@ public class StructureIndexServiceTest {
|
||||
IrisData data = mock(IrisData.class);
|
||||
IrisPlatform platform = mock(IrisPlatform.class);
|
||||
PlatformStructureHooks structureHooks = mock(PlatformStructureHooks.class);
|
||||
when(data.getDataFolder()).thenReturn(pack);
|
||||
ModuleResourceFixture.serveModules(data, new StructureModule());
|
||||
when(data.getDataFolder()).thenReturn(pack);
|
||||
ModuleResourceFixture.serve(data)
|
||||
.resource(StructureResources.STRUCTURES, "castle", new IrisStructure())
|
||||
.resource(StructureResources.STRUCTURES, "structure-index", new IrisStructure());
|
||||
|
||||
Reference in new issue
Block a user