mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 08:49:42 +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{
|
protected function calculateInterceptWithBlock(Block $block, Vector3 $start, Vector3 $end) : ?RayTraceResult{
|
||||||
if($block->getId() !== Block::AIR and empty($block->getCollisionBoxes())){
|
if($block->getId() !== Block::AIR and empty($block->getCollisionBoxes())){
|
||||||
//TODO: remove this once block collision boxes are fixed properly
|
//TODO: remove this once block collision boxes are fixed properly
|
||||||
$bb = new AxisAlignedBB(
|
return AxisAlignedBB::one()->offset($block->x, $block->y, $block->z)->calculateIntercept($start, $end);
|
||||||
$block->x,
|
|
||||||
$block->y,
|
|
||||||
$block->z,
|
|
||||||
$block->x + 1,
|
|
||||||
$block->y + 1,
|
|
||||||
$block->z + 1
|
|
||||||
);
|
|
||||||
|
|
||||||
return $bb->calculateIntercept($start, $end);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::calculateInterceptWithBlock($block, $start, $end);
|
return parent::calculateInterceptWithBlock($block, $start, $end);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user