mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +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;
|
||||
|
||||
if($this->onGround){
|
||||
$this->motionY *= -0.5;
|
||||
}
|
||||
|
||||
if(abs($this->motionX) < 0.01){
|
||||
$this->motionX = 0;
|
||||
}
|
||||
if(abs($this->motionZ) < 0.01){
|
||||
$this->motionY = 0;
|
||||
$this->motionZ = 0;
|
||||
}
|
||||
|
||||
@ -188,7 +183,7 @@ class Arrow extends Projectile{
|
||||
}
|
||||
|
||||
public function canCollideWith(Entity $entity){
|
||||
return $entity instanceof Living;
|
||||
return $entity instanceof Living and !$this->onGround;
|
||||
}
|
||||
|
||||
public function spawnTo(Player $player){
|
||||
|
@ -95,13 +95,6 @@ class DroppedItem extends Entity{
|
||||
$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){
|
||||
$this->kill();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user