mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-17 08:54:22 +00:00
Improved Arrow / Item movement
This commit is contained in:
parent
e94ddcabe0
commit
e17ecf5795
@ -141,13 +141,8 @@ class Arrow extends Projectile{
|
|||||||
$this->motionZ *= $friction;
|
$this->motionZ *= $friction;
|
||||||
|
|
||||||
if($this->onGround){
|
if($this->onGround){
|
||||||
$this->motionY *= -0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(abs($this->motionX) < 0.01){
|
|
||||||
$this->motionX = 0;
|
$this->motionX = 0;
|
||||||
}
|
$this->motionY = 0;
|
||||||
if(abs($this->motionZ) < 0.01){
|
|
||||||
$this->motionZ = 0;
|
$this->motionZ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,7 +183,7 @@ class Arrow extends Projectile{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function canCollideWith(Entity $entity){
|
public function canCollideWith(Entity $entity){
|
||||||
return $entity instanceof Living;
|
return $entity instanceof Living and !$this->onGround;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function spawnTo(Player $player){
|
public function spawnTo(Player $player){
|
||||||
|
@ -95,13 +95,6 @@ class DroppedItem extends Entity{
|
|||||||
$this->motionY *= -0.5;
|
$this->motionY *= -0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(abs($this->motionX) < 0.01){
|
|
||||||
$this->motionX = 0;
|
|
||||||
}
|
|
||||||
if(abs($this->motionZ) < 0.01){
|
|
||||||
$this->motionZ = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($this->age > 6000){
|
if($this->age > 6000){
|
||||||
$this->kill();
|
$this->kill();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user