mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 08:19:45 +00:00
EnderPearl: make a hack less messy
This commit is contained in:
parent
dbae667dec
commit
002f030970
@ -38,16 +38,7 @@ class EnderPearl extends Throwable{
|
||||
protected function calculateInterceptWithBlock(Block $block, Vector3 $start, Vector3 $end) : ?RayTraceResult{
|
||||
if($block->getId() !== Block::AIR and empty($block->getCollisionBoxes())){
|
||||
//TODO: remove this once block collision boxes are fixed properly
|
||||
$bb = new AxisAlignedBB(
|
||||
$block->x,
|
||||
$block->y,
|
||||
$block->z,
|
||||
$block->x + 1,
|
||||
$block->y + 1,
|
||||
$block->z + 1
|
||||
);
|
||||
|
||||
return $bb->calculateIntercept($start, $end);
|
||||
return AxisAlignedBB::one()->offset($block->x, $block->y, $block->z)->calculateIntercept($start, $end);
|
||||
}
|
||||
|
||||
return parent::calculateInterceptWithBlock($block, $start, $end);
|
||||
|
Loading…
x
Reference in New Issue
Block a user