mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
fixed entities falling through the ground
This commit is contained in:
parent
403eb71aa6
commit
bf1169b3f2
7 changed files with 66 additions and 38 deletions
|
|
@ -25,12 +25,12 @@ class ItemEntity extends Entity{
|
|||
$this->stepHeight = 0;
|
||||
}
|
||||
|
||||
public function counterUpdate(){
|
||||
parent::counterUpdate();
|
||||
if($this->delayBeforePickup > 0) --$this->delayBeforePickup;
|
||||
}
|
||||
|
||||
public function updateEntityMovement(){
|
||||
//TODO it is weird on client side for some reason
|
||||
if(abs($this->speedX) < self::MIN_POSSIBLE_SPEED) $this->speedX = 0;
|
||||
if(abs($this->speedZ) < self::MIN_POSSIBLE_SPEED) $this->speedZ = 0;
|
||||
if(abs($this->speedY) < self::MIN_POSSIBLE_SPEED) $this->speedY = 0;
|
||||
|
||||
$this->speedY -= 0.04;
|
||||
$this->noClip = false; //TODO pushOutofBlocks
|
||||
$this->move($this->speedX, $this->speedY, $this->speedZ);
|
||||
|
|
@ -54,8 +54,12 @@ class ItemEntity extends Entity{
|
|||
$this->speedY *= 0.98;
|
||||
$this->speedZ *= $friction;
|
||||
|
||||
//if($this->onGround) $this->speedY *= -0.5;
|
||||
if($this->onGround) $this->speedY *= -0.5;
|
||||
|
||||
//TODO ++age; despawn after age >= 6000;
|
||||
|
||||
if(abs($this->speedX) < self::MIN_POSSIBLE_SPEED) $this->speedX = 0;
|
||||
if(abs($this->speedZ) < self::MIN_POSSIBLE_SPEED) $this->speedZ = 0;
|
||||
if(abs($this->speedY) < self::MIN_POSSIBLE_SPEED) $this->speedY = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue