13
0
geforkt von Mirrors/Paper

Avoid collision shapes outside world border in findFreePosition

This is to correctly adhere to Vanilla behavior.
Dieser Commit ist enthalten in:
Spottedleaf 2024-07-15 09:56:17 -07:00
Ursprung 084923b9ac
Commit e08de25a2a

Datei anzeigen

@ -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());