mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 01:39:52 +00:00
Fixed Item vibration
This commit is contained in:
parent
63a5269313
commit
fb05636694
@ -103,6 +103,7 @@ class Item extends Entity{
|
|||||||
$this->motionY -= $this->gravity;
|
$this->motionY -= $this->gravity;
|
||||||
|
|
||||||
$this->checkObstruction($this->x, $this->y, $this->z);
|
$this->checkObstruction($this->x, $this->y, $this->z);
|
||||||
|
|
||||||
$this->move($this->motionX, $this->motionY, $this->motionZ);
|
$this->move($this->motionX, $this->motionY, $this->motionZ);
|
||||||
|
|
||||||
$friction = 1 - $this->drag;
|
$friction = 1 - $this->drag;
|
||||||
@ -115,12 +116,12 @@ class Item extends Entity{
|
|||||||
$this->motionY *= 1 - $this->drag;
|
$this->motionY *= 1 - $this->drag;
|
||||||
$this->motionZ *= $friction;
|
$this->motionZ *= $friction;
|
||||||
|
|
||||||
$this->updateMovement();
|
|
||||||
|
|
||||||
if($this->onGround){
|
if($this->onGround){
|
||||||
$this->motionY *= -0.5;
|
$this->motionY *= -0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->updateMovement();
|
||||||
|
|
||||||
if($this->age > 6000){
|
if($this->age > 6000){
|
||||||
$this->server->getPluginManager()->callEvent($ev = new ItemDespawnEvent($this));
|
$this->server->getPluginManager()->callEvent($ev = new ItemDespawnEvent($this));
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user