Merge pull request #3978 from PEMapModder/attr

Implemented attributes
This commit is contained in:
PEMapModder
2016-03-07 18:15:15 +08:00
54 changed files with 1344 additions and 350 deletions

View File

@ -296,7 +296,6 @@ class Item{
const STONECUTTER = 245;
const GLOWING_OBSIDIAN = 246;
//Normal Item IDs
const IRON_SHOVEL = 256;
const IRON_PICKAXE = 257;
@ -408,7 +407,6 @@ class Item{
const CAKE = 354;
const BED = 355;
const COOKIE = 357;
const SHEARS = 359;
@ -472,7 +470,6 @@ class Item{
const BEETROOT_SEED = 458;
const BEETROOT_SOUP = 459;
/** @var \SplFixedArray */
public static $list = null;
protected $block;
@ -1049,6 +1046,17 @@ class Item{
return $this->block !== null and $this->block->canBePlaced();
}
public function canBeConsumed() : bool{
return false;
}
public function canBeConsumedBy(Entity $entity) : bool{
return $this->canBeConsumed();
}
public function onConsume(Entity $entity){
}
public function getBlock() : Block{
if($this->block instanceof Block){
return clone $this->block;