mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Separate facing/bearing handling from Vector3, deobfusticate a ton of @shoghicp old code
This commit is contained in:
@ -25,6 +25,7 @@ namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Facing;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\Player;
|
||||
|
||||
@ -51,7 +52,7 @@ class WaterLily extends Flowable{
|
||||
|
||||
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);
|
||||
$up = $blockClicked->getSide(Facing::UP);
|
||||
if($up->getId() === Block::AIR){
|
||||
$this->getLevel()->setBlock($up, $this, true, true);
|
||||
return true;
|
||||
@ -62,7 +63,7 @@ class WaterLily extends Flowable{
|
||||
}
|
||||
|
||||
public function onNearbyBlockChange() : void{
|
||||
if(!($this->getSide(Vector3::SIDE_DOWN) instanceof Water)){
|
||||
if(!($this->getSide(Facing::DOWN) instanceof Water)){
|
||||
$this->getLevel()->useBreakOn($this);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user