Added extra Entity metadata

This commit is contained in:
Shoghi Cervantes 2014-10-16 12:49:45 +02:00
parent 8637b7f5a3
commit c73a3e53be
3 changed files with 4 additions and 3 deletions

View File

@ -1218,7 +1218,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$entity->scheduleUpdate();
}
if($entity instanceof Arrow and $entity->onGround and $this->motionX == 0 and $this->motionY == 0 and $this->motionZ == 0){
if($entity instanceof Arrow and $entity->onGround){
if($entity->dead !== true){
$item = Item::get(Item::ARROW, 0, 1);
if($this->isSurvival() and !$this->inventory->canAddItem($item)){

View File

@ -198,7 +198,9 @@ class Arrow extends Projectile{
$flags |= $this->fireTicks > 0 ? 1 : 0;
return [
0 => ["type" => 0, "value" => $flags]
0 => ["type" => 0, "value" => $flags],
1 => ["type" => 1, "value" => $this->airTicks],
16 => ["type" => 0, "value" => 0] //Is critical
];
}

View File

@ -29,7 +29,6 @@ use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\EntityDespawnEvent;
use pocketmine\event\entity\EntityLevelChangeEvent;
use pocketmine\event\entity\EntityMotionEvent;
use pocketmine\event\entity\EntityMoveEvent;
use pocketmine\event\entity\EntityRegainHealthEvent;
use pocketmine\event\entity\EntitySpawnEvent;
use pocketmine\event\entity\EntityTeleportEvent;