Use -1 for anydamage and empty string for null NBT, closes #146

This commit is contained in:
Dylan K. Taylor
2016-12-21 14:45:34 +00:00
parent 300a3d5ccd
commit 5443b10257
7 changed files with 40 additions and 36 deletions

View File

@ -32,9 +32,9 @@ class ItemBlock extends Item{
parent::__construct($block->getId(), $block->getDamage(), $count, $block->getName());
}
public function setDamage($meta){
$this->meta = $meta !== null ? $meta & 0xf : null;
$this->block->setDamage($this->meta);
public function setDamage(int $meta){
$this->meta = $meta !== -1 ? $meta & 0xf : -1;
$this->block->setDamage($this->meta !== -1 ? $this->meta : 0);
}
public function __clone(){