mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-11 19:14:11 +00:00
Modded test fixes
- Language asset test locates the directory through the English file - Structure template test reads the mixin class bytes instead of loading it - Water spawn test initializes block state caches before running - Logging policy check runs after the native sources are unpacked - Native class boundary check runs after classes compile
This commit is contained in:
+3
-3
@@ -72,10 +72,10 @@ public class IrisModLanguageAssetsTest {
|
||||
}
|
||||
|
||||
private Set<String> resourceFiles() throws Exception {
|
||||
URL resource = IrisModLanguageAssetsTest.class.getClassLoader().getResource(ROOT);
|
||||
assertNotNull("Missing mod language resource directory: " + ROOT, resource);
|
||||
URL resource = IrisModLanguageAssetsTest.class.getClassLoader().getResource(ROOT + "en_us.json");
|
||||
assertNotNull("Missing English mod language resource", resource);
|
||||
assertEquals("Mod language resources must resolve to a directory on disk", "file", resource.getProtocol());
|
||||
Path directory = Path.of(resource.toURI());
|
||||
Path directory = Path.of(resource.toURI()).getParent();
|
||||
try (Stream<Path> paths = Files.list(directory)) {
|
||||
return paths
|
||||
.filter(Files::isRegularFile)
|
||||
|
||||
+7
-4
@@ -1,6 +1,7 @@
|
||||
package art.arcane.iris.modded;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -62,9 +63,11 @@ public class ModdedStructureTemplateCacheTest {
|
||||
config = new String(input.readAllBytes(), StandardCharsets.UTF_8);
|
||||
}
|
||||
assertTrue(config.contains("\"StructureTemplatePaletteConcurrencyMixin\""));
|
||||
assertNotNull(Class.forName(
|
||||
"art.arcane.volmlib.nativelib.minecraft26_2.modded.mixin.StructureTemplatePaletteConcurrencyMixin",
|
||||
false,
|
||||
ModdedStructureTemplateCacheTest.class.getClassLoader()));
|
||||
String mixin = "art/arcane/volmlib/nativelib/minecraft26_2/modded/mixin/StructureTemplatePaletteConcurrencyMixin";
|
||||
try (InputStream input = ModdedStructureTemplateCacheTest.class.getClassLoader()
|
||||
.getResourceAsStream(mixin + ".class")) {
|
||||
assertNotNull(input);
|
||||
assertEquals(mixin, new ClassReader(input).getClassName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -11,9 +11,12 @@ import art.arcane.iris.generation.decoration.IrisSurface;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.server.Bootstrap;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@@ -34,6 +37,11 @@ public class ModdedWaterEntitySpawnTest {
|
||||
public static void bootstrapMinecraftRegistries() {
|
||||
SharedConstants.tryDetectVersion();
|
||||
Bootstrap.bootStrap();
|
||||
for (Block block : BuiltInRegistries.BLOCK) {
|
||||
for (BlockState state : block.getStateDefinition().getPossibleStates()) {
|
||||
state.initCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -37,6 +37,14 @@ tasks.named('processResources').configure {
|
||||
dependsOn(unpackNativeMinecraftSources)
|
||||
}
|
||||
|
||||
tasks.named('verifyLoggingPolicy').configure {
|
||||
dependsOn(unpackNativeMinecraftSources)
|
||||
}
|
||||
|
||||
tasks.named('verifyNativeClassBoundary').configure {
|
||||
dependsOn(tasks.named('classes'))
|
||||
}
|
||||
|
||||
tasks.matching { Task task -> task.name == 'createMinecraftArtifacts' }.configureEach {
|
||||
dependsOn(unpackNativeMinecraftSources)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user