Improved Arrow / Item movement

This commit is contained in:
Shoghi Cervantes 2014-09-03 10:55:14 +02:00
parent e94ddcabe0
commit e17ecf5795
2 changed files with 2 additions and 14 deletions

View File

@ -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){

View File

@ -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();
} }