moved 2 more entities to separate classes, no more 1.0.2

This commit is contained in:
GameHerobrine 2023-02-24 11:22:14 +03:00
parent 96bb79cdcb
commit 0946e8f3a2
9 changed files with 48 additions and 21 deletions

View file

@ -0,0 +1,22 @@
<?php
class ItemEntity extends Entity{
const TYPE = "itemSpecial";
const CLASS_TYPE = ENTITY_ITEM;
public function __construct(Level $level, $eid, $class, $type = 0, $data = array())
{
parent::__construct($level, $eid, $class, $type, $data);
if(isset($data["item"]) and ($data["item"] instanceof Item)){
$this->meta = $this->data["item"]->getMetadata();
$this->stack = $this->data["item"]->count;
} else{
$this->meta = (int) $this->data["meta"];
$this->stack = (int) $this->data["stack"];
}
$this->hasGravity = true;
$this->setHealth(5, "generic");
$this->setSize(0.25, 0.25);
$this->gravity = 0.04;
}
}