mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Improved Item property handling
This commit is contained in:
@ -33,11 +33,13 @@ use pocketmine\Player;
|
||||
|
||||
class SpawnEgg extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(self::SPAWN_EGG, 0, $count, "Spawn Egg");
|
||||
$this->meta = $meta;
|
||||
$this->isActivable = true;
|
||||
parent::__construct(self::SPAWN_EGG, $meta, $count, "Spawn Egg");
|
||||
}
|
||||
|
||||
public function canBeActivated(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
$entity = null;
|
||||
$chunk = $level->getChunk($block->getX() >> 4, $block->getZ() >> 4);
|
||||
|
Reference in New Issue
Block a user