File tree Expand file tree Collapse file tree
src/integrationtest/java/org/cyclops/integrateddynamics/gametest Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import net .minecraft .nbt .CompoundTag ;
1010import net .minecraft .nbt .NbtIo ;
1111import net .minecraft .world .level .levelgen .structure .templatesystem .StructureTemplate ;
12+ import net .neoforged .neoforge .common .NeoForge ;
13+ import net .neoforged .neoforge .event .CommandEvent ;
1214import net .neoforged .neoforge .gametest .GameTestHolder ;
1315import net .neoforged .neoforge .gametest .PrefixGameTestTemplate ;
1416import org .apache .commons .compress .utils .Lists ;
@@ -72,6 +74,13 @@ public Collection<TestFunction> testsFuzzedNetwork() {
7274 int fuzzingIterations = getFuzzingIterations ();
7375 if (fuzzingIterations == 0 ) {
7476 IntegratedDynamics .clog (Level .INFO , "[Fuzzing] Disabled (FUZZING_ITERATIONS not set to a number)" );
77+ } else {
78+ // TODO: check if this hack can be removed in the next MC update.
79+ NeoForge .EVENT_BUS .addListener ((CommandEvent event ) -> {
80+ // Block all commands, as the `test runclosest` command is being invoked for some reason,
81+ // which causes GameTestTicker#clear to be invoked, which deadlocks the game test runner.
82+ event .setCanceled (true );
83+ });
7584 }
7685 for (int i = 0 ; i < fuzzingIterations ; i ++) {
7786 int finalI = i ;
Original file line number Diff line number Diff line change @@ -746,8 +746,8 @@ private void placeDryingBasinWithFluid(BlockPos pos) {
746746 private void placeRandomBlock (BlockPos pos ) {
747747 // Filter to only minecraft namespace blocks and get a random one
748748 var minecraftBlocks = BuiltInRegistries .BLOCK .stream ()
749- .filter (block -> BuiltInRegistries .BLOCK .getKey (block )
750- . getNamespace (). equals ("minecraft " ))
749+ .filter (block -> BuiltInRegistries .BLOCK .getKey (block ). getNamespace (). equals ( "minecraft" ))
750+ . filter ( block -> ! BuiltInRegistries . BLOCK . getKey ( block ). getPath (). equals ("command_block " ))
751751 .toList ();
752752
753753 if (!minecraftBlocks .isEmpty ()) {
You can’t perform that action at this time.
0 commit comments