Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
});
}
}
Binary file not shown.