mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
Cover an object's declared size in its placement area
Boring and terrain bends cover the object's declared size, which can be larger than the bounds of its blocks, so the placement area now reaches whichever of the two is farther from the anchor.
This commit is contained in:
1 parent
f052960e2f
commit
5f30e27485
3 files changed
+29
-4
No files matched your search
+11
@@ -149,6 +149,17 @@ public class IrisObjectPlacementRegressionTest {
|
||||
assertTrue(airWrites.stream().allMatch(write -> write.z() <= -3 && write.z() >= -5));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void boreCoversTheDeclaredSizeBeyondTheObjectsBlocks() {
|
||||
RecordingPlacer placer = new RecordingPlacer(null);
|
||||
IrisObject object = new IrisObject(5, 1, 5);
|
||||
object.setUnsigned(2, 0, 2, solid);
|
||||
|
||||
assertEquals(ANCHOR_Y, object.place(0, ANCHOR_Y, 0, placer, placement().setBore(true), new RNG(2L), data));
|
||||
|
||||
assertEquals(24, placer.writesOf(keyOf(IrisObject.States.AIR)).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void collisionCheckUsesTheTransformedBounds() {
|
||||
PlacedObject forbidden = new PlacedObject(null, object("forbidden"), 1, 0, 0);
|
||||
|
||||
Reference in new issue
Block a user