本文整理汇总了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);
}