mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Updated to receive new optimizations
This commit is contained in:
@@ -776,7 +776,8 @@ abstract class Entity extends Location implements Metadatable{
|
||||
}
|
||||
|
||||
public function isInsideOfWater(){
|
||||
$block = $this->level->getBlock(Vector3::createVector($this->x, $y = ($this->y + $this->getEyeHeight()), $this->z)->floor());
|
||||
$pos = Vector3::createVector($this->x, $y = ($this->y + $this->getEyeHeight()), $this->z);
|
||||
$block = $this->level->getBlock($pos->floor());
|
||||
|
||||
if($block instanceof Water){
|
||||
$f = ($block->y + 1) - ($block->getFluidHeightPercent() - 0.1111111);
|
||||
@@ -787,7 +788,8 @@ abstract class Entity extends Location implements Metadatable{
|
||||
}
|
||||
|
||||
public function isInsideOfSolid(){
|
||||
$block = $this->level->getBlock(Vector3::createVector($this->x, $y = ($this->y + $this->getEyeHeight()), $this->z)->floor());
|
||||
$pos = Vector3::createVector($this->x, $y = ($this->y + $this->getEyeHeight()), $this->z);
|
||||
$block = $this->level->getBlock($pos->floor());
|
||||
|
||||
$bb = $block->getBoundingBox();
|
||||
|
||||
|
@@ -90,7 +90,8 @@ class FallingSand extends Entity{
|
||||
|
||||
if(!$this->dead){
|
||||
if($this->ticksLived === 1){
|
||||
$block = $this->level->getBlock($pos = Vector3::cloneVector($this)->floor());
|
||||
$pos = Vector3::cloneVector($this);
|
||||
$block = $this->level->getBlock($pos->floor());
|
||||
if($block->getID() != $this->blockId){
|
||||
$this->kill();
|
||||
return true;
|
||||
@@ -109,7 +110,8 @@ class FallingSand extends Entity{
|
||||
$this->motionY *= 1 - $this->drag;
|
||||
$this->motionZ *= $friction;
|
||||
|
||||
$pos = Vector3::cloneVector($this)->floor();
|
||||
$pos = Vector3::cloneVector($this);
|
||||
$pos = $pos->floor();
|
||||
|
||||
if($this->onGround){
|
||||
$this->kill();
|
||||
|
Reference in New Issue
Block a user