Merge pull request #3111 from AeiouEnigma/mc1.18/dev

Fix Starlight crash when moving empty contraptions with downward-facing Mechanical Pistons
This commit is contained in:
PepperCode1 2022-07-11 14:56:56 -07:00 committed by GitHub
commit 9e10a2486c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,8 +23,10 @@ public class ContraptionWorld extends WrappedWorld {
this.contraption = contraption;
minY = nextMultipleOf16(contraption.bounds.minY);
height = nextMultipleOf16(contraption.bounds.maxY) - minY;
// Include 1 block above/below contraption height range to avoid certain edge-case Starlight crashes with
// downward-facing mechanical pistons.
minY = nextMultipleOf16(contraption.bounds.minY - 1);
height = nextMultipleOf16(contraption.bounds.maxY + 1) - minY;
}
// https://math.stackexchange.com/questions/291468