diff --git a/src/pocketmine/block/Anvil.php b/src/pocketmine/block/Anvil.php index 9367017a1..603785ece 100644 --- a/src/pocketmine/block/Anvil.php +++ b/src/pocketmine/block/Anvil.php @@ -100,7 +100,7 @@ class Anvil extends Fallable{ return true; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $direction = ($player !== null ? $player->getDirection() : 0) & 0x03; $this->meta = ($this->meta & 0x0c) | $direction; return $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/Bed.php b/src/pocketmine/block/Bed.php index 451372a1f..b0f421c21 100644 --- a/src/pocketmine/block/Bed.php +++ b/src/pocketmine/block/Bed.php @@ -171,7 +171,7 @@ class Bed extends Transparent{ } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if(!$down->isTransparent()){ $meta = (($player instanceof Player ? $player->getDirection() : 0) - 1) & 0x03; diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index ff99e072f..cd19e73be 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -175,12 +175,12 @@ class Block extends Position implements BlockIds, Metadatable{ * @param Block $blockReplace * @param Block $blockClicked * @param int $face - * @param Vector3 $facePos + * @param Vector3 $clickVector * @param Player|null $player * * @return bool */ - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ return $this->getLevel()->setBlock($this, $this, true, true); } diff --git a/src/pocketmine/block/BoneBlock.php b/src/pocketmine/block/BoneBlock.php index ad82aeee0..7a14513c3 100644 --- a/src/pocketmine/block/BoneBlock.php +++ b/src/pocketmine/block/BoneBlock.php @@ -49,7 +49,7 @@ class BoneBlock extends Solid{ return Tool::TYPE_PICKAXE; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $this->meta = PillarRotationHelper::getMetaFromFace($this->meta, $face); return $this->getLevel()->setBlock($blockReplace, $this, true, true); } diff --git a/src/pocketmine/block/BurningFurnace.php b/src/pocketmine/block/BurningFurnace.php index df7bd272a..fa652b8dd 100644 --- a/src/pocketmine/block/BurningFurnace.php +++ b/src/pocketmine/block/BurningFurnace.php @@ -55,7 +55,7 @@ class BurningFurnace extends Solid{ return 13; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $faces = [ 0 => 4, 1 => 2, diff --git a/src/pocketmine/block/Button.php b/src/pocketmine/block/Button.php index 91c2eb39d..4d6993fa4 100644 --- a/src/pocketmine/block/Button.php +++ b/src/pocketmine/block/Button.php @@ -37,7 +37,7 @@ abstract class Button extends Flowable{ return 0; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ //TODO: check valid target block $this->meta = $face; diff --git a/src/pocketmine/block/Cactus.php b/src/pocketmine/block/Cactus.php index 175ca346d..694439a53 100644 --- a/src/pocketmine/block/Cactus.php +++ b/src/pocketmine/block/Cactus.php @@ -112,7 +112,7 @@ class Cactus extends Transparent{ return false; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() === self::SAND or $down->getId() === self::CACTUS){ $block0 = $this->getSide(Vector3::SIDE_NORTH); diff --git a/src/pocketmine/block/Cake.php b/src/pocketmine/block/Cake.php index 9ea60fb6b..9c4863505 100644 --- a/src/pocketmine/block/Cake.php +++ b/src/pocketmine/block/Cake.php @@ -62,7 +62,7 @@ class Cake extends Transparent implements FoodSource{ ); } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() !== self::AIR){ $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/Carpet.php b/src/pocketmine/block/Carpet.php index fdb57805d..5a52d2592 100644 --- a/src/pocketmine/block/Carpet.php +++ b/src/pocketmine/block/Carpet.php @@ -62,7 +62,7 @@ class Carpet extends Flowable{ ); } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() !== self::AIR){ $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/Chest.php b/src/pocketmine/block/Chest.php index 4f02dd77a..5aed1e979 100644 --- a/src/pocketmine/block/Chest.php +++ b/src/pocketmine/block/Chest.php @@ -63,7 +63,7 @@ class Chest extends Transparent{ ); } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $faces = [ 0 => 4, 1 => 2, diff --git a/src/pocketmine/block/Crops.php b/src/pocketmine/block/Crops.php index 216b69ea9..1eceeef48 100644 --- a/src/pocketmine/block/Crops.php +++ b/src/pocketmine/block/Crops.php @@ -32,7 +32,7 @@ use pocketmine\Server; abstract class Crops extends Flowable{ - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($blockReplace->getSide(Vector3::SIDE_DOWN)->getId() === Block::FARMLAND){ $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/Dandelion.php b/src/pocketmine/block/Dandelion.php index dd9e8b58a..aaba2ae50 100644 --- a/src/pocketmine/block/Dandelion.php +++ b/src/pocketmine/block/Dandelion.php @@ -41,7 +41,7 @@ class Dandelion extends Flowable{ } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() === Block::GRASS or $down->getId() === Block::DIRT or $down->getId() === Block::FARMLAND){ $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/Door.php b/src/pocketmine/block/Door.php index 83bd4e394..b854eaab0 100644 --- a/src/pocketmine/block/Door.php +++ b/src/pocketmine/block/Door.php @@ -216,7 +216,7 @@ abstract class Door extends Transparent{ return false; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($face === Vector3::SIDE_UP){ $blockUp = $this->getSide(Vector3::SIDE_UP); $blockDown = $this->getSide(Vector3::SIDE_DOWN); diff --git a/src/pocketmine/block/DoublePlant.php b/src/pocketmine/block/DoublePlant.php index 8ce4cae7c..6849ec67c 100644 --- a/src/pocketmine/block/DoublePlant.php +++ b/src/pocketmine/block/DoublePlant.php @@ -54,7 +54,7 @@ class DoublePlant extends Flowable{ return $names[$this->getVariant()] ?? ""; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $id = $blockReplace->getSide(Vector3::SIDE_DOWN)->getId(); if(($id === Block::GRASS or $id === Block::DIRT) and $blockReplace->getSide(Vector3::SIDE_UP)->canBeReplaced()){ $this->getLevel()->setBlock($blockReplace, $this, false, false); diff --git a/src/pocketmine/block/EnchantingTable.php b/src/pocketmine/block/EnchantingTable.php index 1f48e2b39..c991254cd 100644 --- a/src/pocketmine/block/EnchantingTable.php +++ b/src/pocketmine/block/EnchantingTable.php @@ -39,7 +39,7 @@ class EnchantingTable extends Transparent{ $this->meta = $meta; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $this->getLevel()->setBlock($blockReplace, $this, true, true); Tile::createTile(Tile::ENCHANT_TABLE, $this->getLevel(), TileEnchantTable::createNBT($this, $face, $item, $player)); diff --git a/src/pocketmine/block/EndRod.php b/src/pocketmine/block/EndRod.php index 8544f9789..67b71bcfa 100644 --- a/src/pocketmine/block/EndRod.php +++ b/src/pocketmine/block/EndRod.php @@ -40,7 +40,7 @@ class EndRod extends Flowable{ return "End Rod"; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($face === Vector3::SIDE_UP or $face === Vector3::SIDE_DOWN){ $this->meta = $face; }else{ diff --git a/src/pocketmine/block/FenceGate.php b/src/pocketmine/block/FenceGate.php index 9403b0e6b..e401faa21 100644 --- a/src/pocketmine/block/FenceGate.php +++ b/src/pocketmine/block/FenceGate.php @@ -69,7 +69,7 @@ class FenceGate extends Transparent{ } } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $this->meta = ($player instanceof Player ? ($player->getDirection() - 1) & 0x03 : 0); $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/Flower.php b/src/pocketmine/block/Flower.php index ae69eadea..2af9b69a5 100644 --- a/src/pocketmine/block/Flower.php +++ b/src/pocketmine/block/Flower.php @@ -60,7 +60,7 @@ class Flower extends Flowable{ return $names[$this->meta] ?? "Unknown"; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() === Block::GRASS or $down->getId() === Block::DIRT or $down->getId() === Block::FARMLAND){ $this->getLevel()->setBlock($blockReplace, $this, true); diff --git a/src/pocketmine/block/FlowerPot.php b/src/pocketmine/block/FlowerPot.php index 98824e29c..4be11ff9b 100644 --- a/src/pocketmine/block/FlowerPot.php +++ b/src/pocketmine/block/FlowerPot.php @@ -58,7 +58,7 @@ class FlowerPot extends Flowable{ ); } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($this->getSide(Vector3::SIDE_DOWN)->isTransparent()){ return false; } diff --git a/src/pocketmine/block/GlazedTerracotta.php b/src/pocketmine/block/GlazedTerracotta.php index 36ab5aa46..9365a5941 100644 --- a/src/pocketmine/block/GlazedTerracotta.php +++ b/src/pocketmine/block/GlazedTerracotta.php @@ -39,7 +39,7 @@ class GlazedTerracotta extends Solid{ return Tool::TYPE_PICKAXE; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($player !== null){ $faces = [ 0 => 4, diff --git a/src/pocketmine/block/HayBale.php b/src/pocketmine/block/HayBale.php index 4681f60de..816c50c28 100644 --- a/src/pocketmine/block/HayBale.php +++ b/src/pocketmine/block/HayBale.php @@ -44,7 +44,7 @@ class HayBale extends Solid{ return 0.5; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $this->meta = PillarRotationHelper::getMetaFromFace($this->meta, $face); $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/ItemFrame.php b/src/pocketmine/block/ItemFrame.php index 41179f1fd..470d2c051 100644 --- a/src/pocketmine/block/ItemFrame.php +++ b/src/pocketmine/block/ItemFrame.php @@ -85,7 +85,7 @@ class ItemFrame extends Flowable{ return false; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($face === Vector3::SIDE_DOWN or $face === Vector3::SIDE_UP){ return false; } diff --git a/src/pocketmine/block/Ladder.php b/src/pocketmine/block/Ladder.php index 03fe07523..7917adf6f 100644 --- a/src/pocketmine/block/Ladder.php +++ b/src/pocketmine/block/Ladder.php @@ -91,7 +91,7 @@ class Ladder extends Transparent{ } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($blockClicked->isTransparent() === false){ $faces = [ 2 => 2, diff --git a/src/pocketmine/block/Lava.php b/src/pocketmine/block/Lava.php index 76d51e37b..03406b806 100644 --- a/src/pocketmine/block/Lava.php +++ b/src/pocketmine/block/Lava.php @@ -63,7 +63,7 @@ class Lava extends Liquid{ $entity->resetFallDistance(); } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $ret = $this->getLevel()->setBlock($this, $this, true, false); $this->getLevel()->scheduleDelayedBlockUpdate($this, $this->tickRate()); diff --git a/src/pocketmine/block/Leaves.php b/src/pocketmine/block/Leaves.php index 5f16962db..589cacf0f 100644 --- a/src/pocketmine/block/Leaves.php +++ b/src/pocketmine/block/Leaves.php @@ -164,7 +164,7 @@ class Leaves extends Transparent{ return false; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $this->meta |= 0x04; return $this->getLevel()->setBlock($this, $this, true); } diff --git a/src/pocketmine/block/NetherWartPlant.php b/src/pocketmine/block/NetherWartPlant.php index 646da453d..abfba7dd8 100644 --- a/src/pocketmine/block/NetherWartPlant.php +++ b/src/pocketmine/block/NetherWartPlant.php @@ -48,7 +48,7 @@ class NetherWartPlant extends Flowable{ return true; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() === Block::SOUL_SAND){ $this->getLevel()->setBlock($blockReplace, $this, false, true); diff --git a/src/pocketmine/block/Pumpkin.php b/src/pocketmine/block/Pumpkin.php index 0bd5ae1aa..b9d77b3ee 100644 --- a/src/pocketmine/block/Pumpkin.php +++ b/src/pocketmine/block/Pumpkin.php @@ -48,7 +48,7 @@ class Pumpkin extends Solid{ return "Pumpkin"; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($player instanceof Player){ $this->meta = ((int) $player->getDirection() + 1) % 4; } diff --git a/src/pocketmine/block/Quartz.php b/src/pocketmine/block/Quartz.php index 675d0a0b5..be185303a 100644 --- a/src/pocketmine/block/Quartz.php +++ b/src/pocketmine/block/Quartz.php @@ -54,7 +54,7 @@ class Quartz extends Solid{ return $names[$this->getVariant()] ?? "Unknown"; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($this->meta !== self::NORMAL){ $this->meta = PillarRotationHelper::getMetaFromFace($this->meta, $face); } diff --git a/src/pocketmine/block/Rail.php b/src/pocketmine/block/Rail.php index 723a9d20c..bd46412b1 100644 --- a/src/pocketmine/block/Rail.php +++ b/src/pocketmine/block/Rail.php @@ -55,7 +55,7 @@ class Rail extends Flowable{ return 0.7; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if(!$blockReplace->getSide(Vector3::SIDE_DOWN)->isTransparent()){ return $this->getLevel()->setBlock($blockReplace, $this, true, true); } diff --git a/src/pocketmine/block/RedMushroom.php b/src/pocketmine/block/RedMushroom.php index 0af15d796..f5481b0d2 100644 --- a/src/pocketmine/block/RedMushroom.php +++ b/src/pocketmine/block/RedMushroom.php @@ -56,7 +56,7 @@ class RedMushroom extends Flowable{ return false; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->isTransparent() === false){ $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/RedstoneOre.php b/src/pocketmine/block/RedstoneOre.php index 719afa6a1..a56c231a1 100644 --- a/src/pocketmine/block/RedstoneOre.php +++ b/src/pocketmine/block/RedstoneOre.php @@ -46,7 +46,7 @@ class RedstoneOre extends Solid{ return 3; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ return $this->getLevel()->setBlock($this, $this, true, false); } diff --git a/src/pocketmine/block/Sapling.php b/src/pocketmine/block/Sapling.php index f6e774c93..4fbbe3a87 100644 --- a/src/pocketmine/block/Sapling.php +++ b/src/pocketmine/block/Sapling.php @@ -60,7 +60,7 @@ class Sapling extends Flowable{ return true; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() === self::GRASS or $down->getId() === self::DIRT or $down->getId() === self::FARMLAND){ $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/SignPost.php b/src/pocketmine/block/SignPost.php index 2c94f101a..63225b879 100644 --- a/src/pocketmine/block/SignPost.php +++ b/src/pocketmine/block/SignPost.php @@ -59,7 +59,7 @@ class SignPost extends Transparent{ } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($face !== Vector3::SIDE_DOWN){ if($face === Vector3::SIDE_UP){ diff --git a/src/pocketmine/block/Skull.php b/src/pocketmine/block/Skull.php index 033f1311a..34c13a46d 100644 --- a/src/pocketmine/block/Skull.php +++ b/src/pocketmine/block/Skull.php @@ -59,7 +59,7 @@ class Skull extends Flowable{ ); } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($face === Vector3::SIDE_DOWN){ return false; } diff --git a/src/pocketmine/block/Slab.php b/src/pocketmine/block/Slab.php index 08d97ab19..7046cf121 100644 --- a/src/pocketmine/block/Slab.php +++ b/src/pocketmine/block/Slab.php @@ -52,7 +52,7 @@ abstract class Slab extends Transparent{ return false; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $this->meta &= 0x07; if($face === Vector3::SIDE_DOWN){ if($blockClicked->getId() === $this->id and ($blockClicked->getDamage() & 0x08) === 0x08 and $blockClicked->getVariant() === $this->getVariant()){ @@ -86,7 +86,7 @@ abstract class Slab extends Transparent{ return false; }else{ - if($facePos->y > 0.5){ + if($clickVector->y > 0.5){ $this->meta |= 0x08; } } diff --git a/src/pocketmine/block/SnowLayer.php b/src/pocketmine/block/SnowLayer.php index a9163f8af..b618b8875 100644 --- a/src/pocketmine/block/SnowLayer.php +++ b/src/pocketmine/block/SnowLayer.php @@ -58,7 +58,7 @@ class SnowLayer extends Flowable{ return true; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($blockReplace->getSide(Vector3::SIDE_DOWN)->isSolid()){ //TODO: fix placement $this->getLevel()->setBlock($blockReplace, $this, true); diff --git a/src/pocketmine/block/Stair.php b/src/pocketmine/block/Stair.php index a65f07230..a4427d1bb 100644 --- a/src/pocketmine/block/Stair.php +++ b/src/pocketmine/block/Stair.php @@ -83,7 +83,7 @@ abstract class Stair extends Transparent{ return $bbs; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $faces = [ 0 => 0, 1 => 2, @@ -91,7 +91,7 @@ abstract class Stair extends Transparent{ 3 => 3 ]; $this->meta = $faces[$player->getDirection()] & 0x03; - if(($facePos->y > 0.5 and $face !== Vector3::SIDE_UP) or $face === Vector3::SIDE_DOWN){ + if(($clickVector->y > 0.5 and $face !== Vector3::SIDE_UP) or $face === Vector3::SIDE_DOWN){ $this->meta |= 0x04; //Upside-down stairs } $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/Sugarcane.php b/src/pocketmine/block/Sugarcane.php index b1d803a6f..f61179342 100644 --- a/src/pocketmine/block/Sugarcane.php +++ b/src/pocketmine/block/Sugarcane.php @@ -105,7 +105,7 @@ class Sugarcane extends Flowable{ return false; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() === self::SUGARCANE_BLOCK){ $this->getLevel()->setBlock($blockReplace, BlockFactory::get(Block::SUGARCANE_BLOCK), true); diff --git a/src/pocketmine/block/TallGrass.php b/src/pocketmine/block/TallGrass.php index c23fab27e..b8efda2f3 100644 --- a/src/pocketmine/block/TallGrass.php +++ b/src/pocketmine/block/TallGrass.php @@ -50,7 +50,7 @@ class TallGrass extends Flowable{ return $names[$this->getVariant()] ?? "Unknown"; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $down = $this->getSide(Vector3::SIDE_DOWN); if($down->getId() === self::GRASS){ $this->getLevel()->setBlock($blockReplace, $this, true); diff --git a/src/pocketmine/block/Torch.php b/src/pocketmine/block/Torch.php index 39247a5cd..b2b25f247 100644 --- a/src/pocketmine/block/Torch.php +++ b/src/pocketmine/block/Torch.php @@ -68,7 +68,7 @@ class Torch extends Flowable{ return false; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $below = $this->getSide(Vector3::SIDE_DOWN); if($blockClicked->isTransparent() === false and $face !== Vector3::SIDE_DOWN){ diff --git a/src/pocketmine/block/Trapdoor.php b/src/pocketmine/block/Trapdoor.php index 3657f4a5b..f73b2f1d1 100644 --- a/src/pocketmine/block/Trapdoor.php +++ b/src/pocketmine/block/Trapdoor.php @@ -124,7 +124,7 @@ class Trapdoor extends Transparent{ return $bb; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $directions = [ 0 => 1, 1 => 3, @@ -134,7 +134,7 @@ class Trapdoor extends Transparent{ if($player !== null){ $this->meta = $directions[$player->getDirection() & 0x03]; } - if(($facePos->y > 0.5 and $face !== self::SIDE_UP) or $face === self::SIDE_DOWN){ + if(($clickVector->y > 0.5 and $face !== self::SIDE_UP) or $face === self::SIDE_DOWN){ $this->meta |= self::MASK_UPPER; //top half of block } $this->getLevel()->setBlock($blockReplace, $this, true, true); diff --git a/src/pocketmine/block/Vine.php b/src/pocketmine/block/Vine.php index e3b1689ae..9bd46697d 100644 --- a/src/pocketmine/block/Vine.php +++ b/src/pocketmine/block/Vine.php @@ -137,7 +137,7 @@ class Vine extends Flowable{ ); } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if(!$blockClicked->isSolid() or $face === Vector3::SIDE_UP or $face === Vector3::SIDE_DOWN){ return false; } diff --git a/src/pocketmine/block/Water.php b/src/pocketmine/block/Water.php index a1174ba3b..00766a9db 100644 --- a/src/pocketmine/block/Water.php +++ b/src/pocketmine/block/Water.php @@ -53,7 +53,7 @@ class Water extends Liquid{ $entity->resetFallDistance(); } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $ret = $this->getLevel()->setBlock($this, $this, true, false); $this->getLevel()->scheduleDelayedBlockUpdate($this, $this->tickRate()); diff --git a/src/pocketmine/block/WaterLily.php b/src/pocketmine/block/WaterLily.php index 7b9f3c58c..fe4f8a751 100644 --- a/src/pocketmine/block/WaterLily.php +++ b/src/pocketmine/block/WaterLily.php @@ -57,7 +57,7 @@ class WaterLily extends Flowable{ } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ if($blockClicked instanceof Water){ $up = $blockClicked->getSide(Vector3::SIDE_UP); if($up->getId() === Block::AIR){ diff --git a/src/pocketmine/block/Wood.php b/src/pocketmine/block/Wood.php index 7603201d3..02d3a0e00 100644 --- a/src/pocketmine/block/Wood.php +++ b/src/pocketmine/block/Wood.php @@ -55,7 +55,7 @@ class Wood extends Solid{ return $names[$this->getVariant()] ?? "Unknown"; } - public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{ + public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $this->meta = PillarRotationHelper::getMetaFromFace($this->meta, $face); return $this->getLevel()->setBlock($blockReplace, $this, true, true); } diff --git a/src/pocketmine/item/Bucket.php b/src/pocketmine/item/Bucket.php index e7bbc7a67..fc3c7dda9 100644 --- a/src/pocketmine/item/Bucket.php +++ b/src/pocketmine/item/Bucket.php @@ -50,7 +50,7 @@ class Bucket extends Item{ return 0; } - public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos) : bool{ + public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : bool{ $resultBlock = BlockFactory::get($this->meta); if($resultBlock instanceof Air){ diff --git a/src/pocketmine/item/FlintSteel.php b/src/pocketmine/item/FlintSteel.php index 009676ba6..4f4e35fb9 100644 --- a/src/pocketmine/item/FlintSteel.php +++ b/src/pocketmine/item/FlintSteel.php @@ -36,7 +36,7 @@ class FlintSteel extends Tool{ parent::__construct(self::FLINT_STEEL, $meta, "Flint and Steel"); } - public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos) : bool{ + public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : bool{ if($blockReplace->getId() === self::AIR and ($blockClicked instanceof Solid)){ $level->setBlock($blockReplace, BlockFactory::get(Block::FIRE), true); $level->broadcastLevelSoundEvent($blockReplace->add(0.5, 0.5, 0.5), LevelSoundEventPacket::SOUND_IGNITE); diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 48c06e379..7c9b24e73 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -788,11 +788,11 @@ class Item implements ItemIds, \JsonSerializable{ * @param Block $blockReplace * @param Block $blockClicked * @param int $face - * @param Vector3 $facePos + * @param Vector3 $clickVector * * @return bool */ - public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos) : bool{ + public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : bool{ return false; } diff --git a/src/pocketmine/item/Painting.php b/src/pocketmine/item/Painting.php index cb1fa8d7b..bd6075fe3 100644 --- a/src/pocketmine/item/Painting.php +++ b/src/pocketmine/item/Painting.php @@ -33,7 +33,7 @@ class Painting extends Item{ parent::__construct(self::PAINTING, $meta, "Painting"); } - public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos) : bool{ + public function onActivate(Level $level, Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : bool{ if($blockClicked->isTransparent() === false and $face > 1 and $blockReplace->isSolid() === false){ $faces = [ 2 => 1, diff --git a/src/pocketmine/item/SpawnEgg.php b/src/pocketmine/item/SpawnEgg.php index 094ee9d12..481f747b4 100644 --- a/src/pocketmine/item/SpawnEgg.php +++ b/src/pocketmine/item/SpawnEgg.php @@ -34,7 +34,7 @@ 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 $facePos) : bool{ + public function onActivate(Level $level, 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()){ diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 14c35cf4a..1db236ca1 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -1722,18 +1722,18 @@ class Level implements ChunkManager, Metadatable{ * @param Vector3 $vector * @param Item $item * @param int $face - * @param Vector3|null $facePos + * @param Vector3|null $clickVector * @param Player|null $player default null * @param bool $playSound Whether to play a block-place sound if the block was placed successfully. * * @return bool */ - public function useItemOn(Vector3 $vector, Item &$item, int $face, Vector3 $facePos = null, Player $player = null, bool $playSound = false) : bool{ + public function useItemOn(Vector3 $vector, Item &$item, int $face, Vector3 $clickVector = null, Player $player = null, bool $playSound = false) : bool{ $blockClicked = $this->getBlock($vector); $blockReplace = $blockClicked->getSide($face); - if($facePos === null){ - $facePos = new Vector3(0.0, 0.0, 0.0); + if($clickVector === null){ + $clickVector = new Vector3(0.0, 0.0, 0.0); } if($blockReplace->y >= $this->provider->getWorldHeight() or $blockReplace->y < 0){ @@ -1746,7 +1746,7 @@ class Level implements ChunkManager, Metadatable{ } if($player !== null){ - $ev = new PlayerInteractEvent($player, $item, $blockClicked, $facePos, $face, $blockClicked->getId() === 0 ? PlayerInteractEvent::RIGHT_CLICK_AIR : PlayerInteractEvent::RIGHT_CLICK_BLOCK); + $ev = new PlayerInteractEvent($player, $item, $blockClicked, $clickVector, $face, $blockClicked->getId() === 0 ? PlayerInteractEvent::RIGHT_CLICK_AIR : PlayerInteractEvent::RIGHT_CLICK_BLOCK); if($this->checkSpawnProtection($player, $blockClicked)){ $ev->setCancelled(); //set it to cancelled so plugins can bypass this } @@ -1776,7 +1776,7 @@ class Level implements ChunkManager, Metadatable{ return true; } - if(!$player->isSneaking() and $item->onActivate($this, $player, $blockReplace, $blockClicked, $face, $facePos)){ + if(!$player->isSneaking() and $item->onActivate($this, $player, $blockReplace, $blockClicked, $face, $clickVector)){ return true; } }else{ @@ -1793,10 +1793,10 @@ class Level implements ChunkManager, Metadatable{ return false; } - if($hand->canBePlacedAt($blockClicked, $facePos, $face, true)){ + if($hand->canBePlacedAt($blockClicked, $clickVector, $face, true)){ $blockReplace = $blockClicked; $hand->position($blockReplace); - }elseif(!$hand->canBePlacedAt($blockReplace, $facePos, $face, false)){ + }elseif(!$hand->canBePlacedAt($blockReplace, $clickVector, $face, false)){ return false; } @@ -1835,7 +1835,7 @@ class Level implements ChunkManager, Metadatable{ } } - if(!$hand->place($item, $blockReplace, $blockClicked, $face, $facePos, $player)){ + if(!$hand->place($item, $blockReplace, $blockClicked, $face, $clickVector, $player)){ return false; }