mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Refactored entity metadata handling into its own class, with type-safe methods (#1876)
This includes several other changes, including: - SLOT data properties now accept items directly - POS data properties now accept floored Vector3s (in future this will be block positions) or null for 0,0,0 - VECTOR3F data properties now accept Vector3s or null for 0,0,0
This commit is contained in:
@ -496,7 +496,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
protected function initEntity(){
|
||||
|
||||
$this->setPlayerFlag(self::DATA_PLAYER_FLAG_SLEEP, false);
|
||||
$this->setDataProperty(self::DATA_PLAYER_BED_POSITION, self::DATA_TYPE_POS, [0, 0, 0], false);
|
||||
$this->propertyManager->setBlockPos(self::DATA_PLAYER_BED_POSITION, null);
|
||||
|
||||
$this->inventory = new PlayerInventory($this);
|
||||
$this->enderChestInventory = new EnderChestInventory($this);
|
||||
@ -705,7 +705,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->item = $this->getInventory()->getItemInHand();
|
||||
$pk->metadata = $this->dataProperties;
|
||||
$pk->metadata = $this->propertyManager->getAll();
|
||||
$player->dataPacket($pk);
|
||||
|
||||
$this->inventory->sendArmorContents($player);
|
||||
|
Reference in New Issue
Block a user