mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
Avoid collision shapes outside world border in findFreePosition
This is to correctly adhere to Vanilla behavior.
This commit is contained in:
parent
084923b9ac
commit
e08de25a2a
1 changed files with 10 additions and 0 deletions
|
@ -31633,6 +31633,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ null
|
||||
+ );
|
||||
+
|
||||
+ final WorldBorder worldBorder = this.getWorldBorder();
|
||||
+ if (worldBorder != null) {
|
||||
+ aabbs.removeIf((final AABB aabb) -> {
|
||||
+ return !worldBorder.isWithinBounds(aabb);
|
||||
+ });
|
||||
+ voxels.removeIf((final VoxelShape shape) -> {
|
||||
+ return !worldBorder.isWithinBounds(shape.bounds());
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ // push voxels into aabbs
|
||||
+ for (int i = 0, len = voxels.size(); i < len; ++i) {
|
||||
+ aabbs.addAll(voxels.get(i).toAabbs());
|
||||
|
|
Loading…
Add table
Reference in a new issue