fix: preserve micro occlusion match failures

This commit is contained in:
Algent committed 2026-09-16 12:18:42 +02:00
1 parent f14668d81a
commit a995189f92
2 files changed
+9 -1

No files matched your search

@@ -158,7 +158,7 @@ public final class MicroOcclusion$ {
case 2:
return (secondBits & 4) == 0 ? 4 : 5;
default:
throw new IllegalArgumentException("Switch Falloff");
throw new MatchError(firstEdge >> 2);
}
}
@@ -22,6 +22,7 @@ import org.objectweb.asm.Type;
import codechicken.lib.vec.Cuboid6;
import codechicken.multipart.TMultiPart;
import codechicken.multipart.TileMultipart;
import scala.MatchError;
class MicroOcclusionCharacterizationTest {
@@ -196,6 +197,13 @@ class MicroOcclusionCharacterizationTest {
assertCuboid(original, alreadyInside);
}
@Test
void rejectsUnknownShrinkSidesWithScalaMatchError() {
Cuboid6 obstacle = Cuboid6.full.copy();
assertThrows(MatchError.class, () -> MicroOcclusion.shrink(Cuboid6.full.copy(), obstacle, 6));
assertThrows(MatchError.class, () -> MicroOcclusion$.MODULE$.shrink(Cuboid6.full.copy(), obstacle, 6));
}
@Test
void keepsShrinkMaskAndSlotTraversalRules() {
TestPart shrinking = new TestPart(15, 4, 0, false, Cuboid6.full);