Skip to content

Commit c7882a7

Browse files
committed
Add Gametests only to gametest run configurations
1 parent 83664c6 commit c7882a7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

neoforge/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ neoForge {
9999

100100
sourceSet = sourceSets.getByName("gametest")
101101
systemProperty("neoforge.enabledGameTestNamespaces", "lithium-gametest")
102-
environment("LITHIUM_GAMETEST_RESOURCES", file("src/gametest/resources").path)
102+
environment("LITHIUM_GAMETEST_RESOURCES", file("../../../common/src/gametest/resources/data/lithium-gametest/gametest/structure").path)
103103
}
104104
create("gametestServer") {
105105
type = "gameTestServer"
106106
gameDirectory.set(file("runs/gametestServer"))
107107

108108
sourceSet = sourceSets.getByName("gametest")
109109
systemProperty("neoforge.enabledGameTestNamespaces", "lithium-gametest")
110-
environment("LITHIUM_GAMETEST_RESOURCES", file("src/gametest/resources").path)
110+
environment("LITHIUM_GAMETEST_RESOURCES", file("../../../common/src/gametest/resources/data/lithium-gametest/gametest/structure").path)
111111
}
112112
}
113113

neoforge/src/gametest/java/net/caffeinemc/mods/lithium/neoforge/test/LithiumNeoforgeGameTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
@GameTestHolder("lithium-gametest")
2525
public class LithiumNeoforgeGameTest {
2626

27-
//Not very nice to do this but it works
28-
public static final String LITHIUM_GAMETEST_SNBT_PATH = "../../../common/src/gametest/resources/data/lithium-gametest/gametest/structure";
27+
public static final String LITHIUM_GAMETEST_SNBT_PATH = System.getenv("LITHIUM_GAMETEST_RESOURCES");
2928

3029
//Some tests are excluded because Neoforge is breaking them, not lithium.
3130
//test_redstone.lava_push_speed broken by https://github.com/neoforged/NeoForge/issues/1575
@@ -113,6 +112,10 @@ private static Optional<BlockPos> checkFailureBlocks(GameTestHelper gameTestHelp
113112

114113
@GameTestGenerator
115114
public Collection<TestFunction> getAllRedstoneTests() {
115+
if (LITHIUM_GAMETEST_SNBT_PATH == null) {
116+
return List.of();
117+
}
118+
116119
List<String> structureNames = null;
117120
try {
118121
structureNames = getLithiumSNBTFilenames();

0 commit comments

Comments
 (0)