mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Item: Remove redundant Level parameter from onActivate()
there are three other sources this could be gotten from, an arbitrary level doesn't make sense.
This commit is contained in:
@ -34,14 +34,14 @@ class SpawnEgg extends Item{
|
||||
parent::__construct(self::SPAWN_EGG, $meta, "Spawn Egg");
|
||||
}
|
||||
|
||||
public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : bool{
|
||||
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : bool{
|
||||
$nbt = Entity::createBaseNBT($blockReplace->add(0.5, 0, 0.5), null, lcg_value() * 360, 0);
|
||||
|
||||
if($this->hasCustomName()){
|
||||
$nbt->setString("CustomName", $this->getCustomName());
|
||||
}
|
||||
|
||||
$entity = Entity::createEntity($this->meta, $level, $nbt);
|
||||
$entity = Entity::createEntity($this->meta, $player->getLevel(), $nbt);
|
||||
|
||||
if($entity instanceof Entity){
|
||||
--$this->count;
|
||||
|
Reference in New Issue
Block a user