mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
fix collision detection not detecting fence & fence-gate, fixed nether-brick fence gate AABB, close #1299
This commit is contained in:
@ -1094,12 +1094,13 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @return Block[]
|
||||
*/
|
||||
public function getCollisionBlocks(AxisAlignedBB $bb, bool $targetFirst = false) : array{
|
||||
$minX = Math::floorFloat($bb->minX);
|
||||
$minY = Math::floorFloat($bb->minY);
|
||||
$minZ = Math::floorFloat($bb->minZ);
|
||||
$maxX = Math::ceilFloat($bb->maxX);
|
||||
$maxY = Math::ceilFloat($bb->maxY);
|
||||
$maxZ = Math::ceilFloat($bb->maxZ);
|
||||
$bbPlusOne = $bb->grow(1, 1, 1);
|
||||
$minX = Math::floorFloat($bbPlusOne->minX);
|
||||
$minY = Math::floorFloat($bbPlusOne->minY);
|
||||
$minZ = Math::floorFloat($bbPlusOne->minZ);
|
||||
$maxX = Math::ceilFloat($bbPlusOne->maxX);
|
||||
$maxY = Math::ceilFloat($bbPlusOne->maxY);
|
||||
$maxZ = Math::ceilFloat($bbPlusOne->maxZ);
|
||||
|
||||
$collides = [];
|
||||
|
||||
@ -1157,12 +1158,13 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @return AxisAlignedBB[]
|
||||
*/
|
||||
public function getCollisionCubes(Entity $entity, AxisAlignedBB $bb, bool $entities = true) : array{
|
||||
$minX = Math::floorFloat($bb->minX);
|
||||
$minY = Math::floorFloat($bb->minY);
|
||||
$minZ = Math::floorFloat($bb->minZ);
|
||||
$maxX = Math::ceilFloat($bb->maxX);
|
||||
$maxY = Math::ceilFloat($bb->maxY);
|
||||
$maxZ = Math::ceilFloat($bb->maxZ);
|
||||
$bbPlusOne = $bb->grow(1, 1, 1);
|
||||
$minX = Math::floorFloat($bbPlusOne->minX);
|
||||
$minY = Math::floorFloat($bbPlusOne->minY);
|
||||
$minZ = Math::floorFloat($bbPlusOne->minZ);
|
||||
$maxX = Math::ceilFloat($bbPlusOne->maxX);
|
||||
$maxY = Math::ceilFloat($bbPlusOne->maxY);
|
||||
$maxZ = Math::ceilFloat($bbPlusOne->maxZ);
|
||||
|
||||
$collides = [];
|
||||
|
||||
|
Reference in New Issue
Block a user