Improved Falling blocks physics, entity kill, chunk unserialize, fixed flat generator color, fixed nbt tags __toString(), fixed explosion offsets, fixed increased player interaction range in creative

This commit is contained in:
Shoghi Cervantes
2015-05-13 12:18:59 +02:00
parent f3bdef7513
commit b1edfd7631
14 changed files with 84 additions and 52 deletions

View File

@ -95,8 +95,10 @@ class FallingSand extends Entity{
$hasUpdate = $this->entityBaseTick($tickDiff);
if($this->isAlive()){
$pos = (new Vector3($this->x - 0.5, $this->y, $this->z - 0.5))->floor();
if($this->ticksLived === 1){
$block = $this->level->getBlock($pos = (new Vector3($this->x - 0.5, $this->y - 0.5, $this->z - 0.5))->floor());
$block = $this->level->getBlock($pos);
if($block->getId() !== $this->blockId){
$this->kill();
return true;
@ -114,7 +116,7 @@ class FallingSand extends Entity{
$this->motionY *= 1 - $this->drag;
$this->motionZ *= $friction;
$pos = (new Vector3($this->x, $this->y, $this->z))->floor();
$pos = (new Vector3($this->x - 0.5, $this->y, $this->z - 0.5))->floor();
if($this->onGround){
$this->kill();