本文整理匯總了PHP中pocketmine\math\Vector3::removeEntity方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vector3::removeEntity方法的具體用法?PHP Vector3::removeEntity怎麽用?PHP Vector3::removeEntity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pocketmine\math\Vector3
的用法示例。
在下文中一共展示了Vector3::removeEntity方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* @param Vector3 $v
* @param mixed $data
* @param int $id
* @param FullChunk $chunk
*/
public function __construct($v, $data, $id = -2, $chunk = null)
{
$this->data = $data;
if (!$v instanceof Vector3) {
if ($v instanceof FullChunk) {
$v->removeEntity($this);
}
throw new \RuntimeException("BadConstructCustomHuman");
}
$nbt = new Compound();
$nbt->Pos = new Enum("Motion", [new Double(0, $v->x), new Double(1, $v->y), new Double(2, $v->z)]);
$nbt->Motion = new Enum("Motion", [new Double(0, 0), new Double(1, 0), new Double(2, 0)]);
$nbt->Rotation = new Enum("Rotation", [new Float(0, $this->getDefaultYaw()), new Float(1, $this->getDefaultPitch())]);
$nbt->FallDistance = new Float("FallDistance", 0);
$nbt->Fire = new Short("Fire", 0);
$nbt->Air = new Short("Air", 0);
$nbt->OnGround = new Byte("OnGround", 1);
$nbt->Invulnerable = new Byte("Invulnerable", 1);
$nbt->Health = new Short("Health", 20);
$nbt->NameTag = $this->getDefaultName();
$nbt->Inventory = new Enum("Inventory", []);
$nbt->Inventory->setTagType(NBT::TAG_Compound);
$this->inventory = new PlayerInventory($this);
$this->setSkin($this->getDefaultSkin());
parent::__construct($chunk, $nbt);
}