mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Refactor confusing parameter names for Item->onActivate()
next: refactor the function itself
This commit is contained in:
@ -39,12 +39,12 @@ class SpawnEgg extends Item{
|
||||
parent::__construct(self::SPAWN_EGG, $meta, "Spawn Egg");
|
||||
}
|
||||
|
||||
public function onActivate(Level $level, Player $player, Block $block, Block $target, int $face, Vector3 $facePos) : bool{
|
||||
public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos) : bool{
|
||||
$nbt = new CompoundTag("", [
|
||||
new ListTag("Pos", [
|
||||
new DoubleTag("", $block->getX() + 0.5),
|
||||
new DoubleTag("", $block->getY()),
|
||||
new DoubleTag("", $block->getZ() + 0.5)
|
||||
new DoubleTag("", $blockReplace->getX() + 0.5),
|
||||
new DoubleTag("", $blockReplace->getY()),
|
||||
new DoubleTag("", $blockReplace->getZ() + 0.5)
|
||||
]),
|
||||
new ListTag("Motion", [
|
||||
new DoubleTag("", 0),
|
||||
|
Reference in New Issue
Block a user