mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
22 lines
No EOL
639 B
PHP
22 lines
No EOL
639 B
PHP
<?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;
|
|
}
|
|
} |