mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-09 15:29:47 +00:00
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:
parent
90e6073202
commit
db4dac6d45
@ -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
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user