Improved Player flight detection after setMotion(), other method improvement

This commit is contained in:
Shoghi Cervantes
2015-05-03 13:42:54 +02:00
parent 0ead3ec781
commit 9ec609d025
7 changed files with 52 additions and 38 deletions

View File

@ -96,13 +96,12 @@ class FallingSand extends Entity{
if(!$this->dead){
if($this->ticksLived === 1){
$block = $this->level->getBlock($pos = (new Vector3($this->x, $this->y, $this->z))->floor());
if($block->getId() != $this->blockId){
$block = $this->level->getBlock($pos = (new Vector3($this->x - 0.5, $this->y - 0.5, $this->z - 0.5))->floor());
if($block->getId() !== $this->blockId){
$this->kill();
return true;
}
$this->level->setBlock($pos, Block::get(0), true);
}
$this->motionY -= $this->gravity;