mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Block creating and property handling rewrite, part2
This commit is contained in:
@@ -809,7 +809,7 @@ abstract class Entity extends Location implements Metadatable{
|
||||
|
||||
$bb = $block->getBoundingBox();
|
||||
|
||||
if($bb !== null and $block->isSolid and !$block->isTransparent and $bb->intersectsWith($this->getBoundingBox())){
|
||||
if($bb !== null and $block->isSolid() and !$block->isTransparent() and $bb->intersectsWith($this->getBoundingBox())){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1053,7 +1053,7 @@ abstract class Entity extends Location implements Metadatable{
|
||||
for($v->x = $minX; $v->x <= $maxX; ++$v->x){
|
||||
for($v->y = $minY; $v->y <= $maxY; ++$v->y){
|
||||
$block = $this->level->getBlock($v);
|
||||
if($block !== null and $block->hasEntityCollision){
|
||||
if($block !== null and $block->hasEntityCollision()){
|
||||
$block->onEntityCollide($this);
|
||||
if(!($this instanceof Player)){
|
||||
$block->addVelocityToEntity($this, $vector);
|
||||
|
||||
@@ -98,7 +98,7 @@ class Item extends Entity{
|
||||
$friction = 1 - $this->drag;
|
||||
|
||||
if($this->onGround and ($this->motionX != 0 or $this->motionZ != 0)){
|
||||
$friction = $this->getLevel()->getBlock(new Vector3($this->getFloorX(), $this->getFloorY() - 1, $this->getFloorZ()))->frictionFactor * $friction;
|
||||
$friction = $this->getLevel()->getBlock(new Vector3($this->getFloorX(), $this->getFloorY() - 1, $this->getFloorZ()))->getFrictionFactor() * $friction;
|
||||
}
|
||||
|
||||
$this->motionX *= $friction;
|
||||
|
||||
Reference in New Issue
Block a user