Skins, protocol changes, handle split packets

This commit is contained in:
Shoghi Cervantes
2015-04-08 13:00:15 +02:00
parent c9adc336ee
commit 141c0a297e
26 changed files with 292 additions and 507 deletions

View File

@ -28,17 +28,30 @@ use pocketmine\event\entity\EntityDamageByEntityEvent;
use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\EntityRegainHealthEvent;
use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\level\format\FullChunk;
use pocketmine\level\MovingObjectPosition;
use pocketmine\math\Vector3;
use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Short;
abstract class Projectile extends Entity{
const DATA_SHOOTER_ID = 17;
/** @var Entity */
public $shootingEntity = null;
protected $damage = 0;
public $hadCollision = false;
public function __construct(FullChunk $chunk, Compound $nbt, Entity $shootingEntity = null){
$this->shootingEntity = $shootingEntity;
if($shootingEntity !== null){
$this->setDataProperty(self::DATA_SHOOTER_ID, self::DATA_TYPE_LONG, $shootingEntity->getId());
}
parent::__construct($chunk, $nbt);
}
public function attack($damage, EntityDamageEvent $source){