mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
fixed item motion on client side
This commit is contained in:
parent
bf1169b3f2
commit
b7f9d3f1c5
2 changed files with 3 additions and 7 deletions
|
|
@ -540,7 +540,7 @@ class Entity extends Position
|
|||
for($y = $y0; $y <= $y1; ++$y){
|
||||
for($z = $z0; $z <= $z1; ++$z){
|
||||
$b = $this->level->level->getBlockID($x, $y, $z);
|
||||
if($b != 0){ //TODO might be better to use other method
|
||||
if($b != 0){
|
||||
$blockBounds = Block::$class[$b]::getCollisionBoundingBoxes($this->level, $x, $y, $z, $this);
|
||||
foreach($blockBounds as $blockBound){
|
||||
$dy = $blockBound->calculateYOffset($this->boundingBox, $dy);
|
||||
|
|
@ -1110,8 +1110,8 @@ class Entity extends Position
|
|||
public function updateAABB()
|
||||
{
|
||||
$this->boundingBox->setBounds(
|
||||
$this->x - $this->radius, $this->y, $this->z - $this->radius,
|
||||
$this->x + $this->radius, $this->y + $this->height, $this->z + $this->radius
|
||||
$this->x - $this->radius, $this->y - $this->yOffset, $this->z - $this->radius,
|
||||
$this->x + $this->radius, $this->y + $this->height - $this->yOffset, $this->z + $this->radius
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,9 +57,5 @@ class ItemEntity extends Entity{
|
|||
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