mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 16:49:53 +00:00
Correct placement for cakes and snow layers
This commit is contained in:
parent
0dc783f285
commit
f8d8052ec3
@ -28,6 +28,15 @@ class CakeBlock extends TransparentBlock{
|
|||||||
$this->hardness = 2.5;
|
$this->hardness = 2.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
|
$down = $this->getSide(0);
|
||||||
|
if($down->getID() !== AIR){
|
||||||
|
$this->level->setBlock($block, $this, true, false, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
if($type === BLOCK_UPDATE_NORMAL){
|
if($type === BLOCK_UPDATE_NORMAL){
|
||||||
if($this->getSide(0)->getID() === AIR){ //Replace with common break method
|
if($this->getSide(0)->getID() === AIR){ //Replace with common break method
|
||||||
|
@ -28,6 +28,15 @@ class SnowLayerBlock extends FlowableBlock{
|
|||||||
$this->hardness = 0.5;
|
$this->hardness = 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
|
$down = $this->getSide(0);
|
||||||
|
if($down instanceof SolidBlock){
|
||||||
|
$this->level->setBlock($block, $this, true, false, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
if($type === BLOCK_UPDATE_NORMAL){
|
if($type === BLOCK_UPDATE_NORMAL){
|
||||||
if($this->getSide(0)->getID() === AIR){ //Replace with common break method
|
if($this->getSide(0)->getID() === AIR){ //Replace with common break method
|
||||||
|
Loading…
x
Reference in New Issue
Block a user