diff --git a/src/main/java/com/simibubi/create/content/kinetics/fan/AirCurrent.java b/src/main/java/com/simibubi/create/content/kinetics/fan/AirCurrent.java index 9daab21982..2b3af4633e 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/fan/AirCurrent.java +++ b/src/main/java/com/simibubi/create/content/kinetics/fan/AirCurrent.java @@ -257,10 +257,10 @@ public static float getFlowLimit(Level world, BlockPos start, float max, Directi } private static final double[][] DEPTH_TEST_COORDINATES = { - {0.25, 0.25}, - {0.25, 0.75}, + {0.2499, 0.2499}, + {0.2499, 0.75}, {0.5, 0.5}, - {0.75, 0.25}, + {0.75, 0.2499}, {0.75, 0.75} }; diff --git a/src/main/java/com/simibubi/create/infrastructure/gametest/tests/TestMisc.java b/src/main/java/com/simibubi/create/infrastructure/gametest/tests/TestMisc.java index 7c531165be..7d1c41b5a1 100644 --- a/src/main/java/com/simibubi/create/infrastructure/gametest/tests/TestMisc.java +++ b/src/main/java/com/simibubi/create/infrastructure/gametest/tests/TestMisc.java @@ -4,6 +4,8 @@ import com.simibubi.create.AllBlockEntityTypes; import com.simibubi.create.AllDataComponents; +import com.simibubi.create.content.kinetics.fan.AirCurrent; +import com.simibubi.create.content.kinetics.fan.EncasedFanBlockEntity; import com.simibubi.create.content.redstone.thresholdSwitch.ThresholdSwitchBlockEntity; import com.simibubi.create.content.schematics.SchematicExport; import com.simibubi.create.content.schematics.SchematicItem; @@ -14,6 +16,7 @@ import com.simibubi.create.infrastructure.gametest.GameTestGroup; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.gametest.framework.GameTest; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundSource; @@ -115,4 +118,36 @@ public static void netheriteBacktank(CreateGameTestHelper helper) { helper.assertEntityPresent(EntityType.ZOMBIE, lava); }); } + + @GameTest(template = "fan_air_current_passthrough") + public static void fanAirCurrentPassthrough(CreateGameTestHelper helper) { + BlockPos fan = new BlockPos(1, 2, 1); + + helper.succeedWhen(() -> { + EncasedFanBlockEntity fanEntity = helper.getBlockEntity( + AllBlockEntityTypes.ENCASED_FAN.get(), fan); + + AirCurrent airCurrent = fanEntity.getAirCurrent(); + + if (airCurrent.maxDistance <= 2) { + helper.fail("Air current stopped at the 1st drill block (facing up Y+)"); + } + + if (airCurrent.maxDistance <= 4) { + helper.fail("Air current stopped at the 2nd drill block (facing east X+)"); + } + + if (airCurrent.maxDistance <= 6) { + helper.fail("Air current stopped at the 3rd drill block (facing west X-)"); + } + + if (airCurrent.maxDistance <= 8) { + helper.fail("Air current stopped at the 4th drill block (facing down Y-)"); + } + + if (airCurrent.maxDistance >= 10) { + helper.fail("Air current should be blocked by drill facing towards it (Z-), but it wasn't, maxDistance: " + airCurrent.maxDistance); + } + }); + } } diff --git a/src/main/resources/data/create/structure/gametest/misc/fan_air_current_passthrough.nbt b/src/main/resources/data/create/structure/gametest/misc/fan_air_current_passthrough.nbt new file mode 100644 index 0000000000..93738bf458 Binary files /dev/null and b/src/main/resources/data/create/structure/gametest/misc/fan_air_current_passthrough.nbt differ