EnderPearl: make a hack less messy

This commit is contained in:
Dylan K. Taylor 2019-02-02 11:54:25 +00:00
parent dbae667dec
commit 002f030970

View File

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