World: Remove incorrect isSolid() check for placement collision check

isSolid() != can be collided with. That's decided by the collision boxes provided, if any.
This commit is contained in:
Dylan K. Taylor 2019-05-12 16:00:38 +01:00
parent 90e6073202
commit db4dac6d45

View File

@ -1813,18 +1813,16 @@ class World implements ChunkManager, Metadatable{
return false; return false;
} }
if($hand->isSolid()){ foreach($hand->getCollisionBoxes() as $collisionBox){
foreach($hand->getCollisionBoxes() as $collisionBox){ if(!empty($this->getCollidingEntities($collisionBox))){
if(!empty($this->getCollidingEntities($collisionBox))){ return false; //Entity in block
return false; //Entity in block }
}
if($player !== null){ if($player !== null){
if(($diff = $player->getNextPosition()->subtract($player->getPosition())) and $diff->lengthSquared() > 0.00001){ if(($diff = $player->getNextPosition()->subtract($player->getPosition())) and $diff->lengthSquared() > 0.00001){
$bb = $player->getBoundingBox()->offsetCopy($diff->x, $diff->y, $diff->z); $bb = $player->getBoundingBox()->offsetCopy($diff->x, $diff->y, $diff->z);
if($collisionBox->intersectsWith($bb)){ if($collisionBox->intersectsWith($bb)){
return false; //Inside player BB return false; //Inside player BB
}
} }
} }
} }