Reach slope-tilted objects as far as a vertical rotation

A placement that turns towards the slope can tilt a tall object even when its configured rotation is disabled, so its reach counted only the horizontal footprint and the write and read windows cut it off at chunk seams. Count it like a vertical rotation: the tallest dimension as footprint and the full translation vector.

Upstream: 7aaf346ce b34e5e767
This commit is contained in:
piexel committed 2026-11-10 01:10:32 +01:00
1 parent 971cad0463
commit 867851366d
2 files changed
+19 -6

No files matched your search

@@ -60,6 +60,18 @@ public class PlacementReachTest {
assertEquals(53, PlacementReach.of(new ObjectSize(5, 48, 7), placement));
}
@Test
public void slopeTiltReachesAsFarAsAVerticalRotationEvenWhenTheRotationIsDisabled() {
String disabledRotation = "\"rotation\":{\"enabled\":false}";
ObjectPlacement flat = TestSettings.of(ObjectPlacement.class, "{" + disabledRotation + ",\"translate\":{\"x\":3,\"y\":4}}");
ObjectPlacement tilted = TestSettings.of(ObjectPlacement.class,
"{" + disabledRotation + ",\"rotateTowardsSlope\":true,\"translate\":{\"x\":3,\"y\":4}}");
ObjectSize tallObject = new ObjectSize(5, 48, 7);
assertEquals(10, PlacementReach.of(tallObject, flat));
assertEquals(53, PlacementReach.of(tallObject, tilted));
}
@Test
public void scaleWarpAndVacuumExpandPlacementReach() {
ObjectPlacement placement = TestSettings.of(ObjectPlacement.class,