mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Correct placement for cakes and snow layers
This commit is contained in:
parent
0dc783f285
commit
f8d8052ec3
2 changed files with 18 additions and 0 deletions
|
|
@ -28,6 +28,15 @@ class CakeBlock extends TransparentBlock{
|
|||
$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){
|
||||
if($type === BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->getID() === AIR){ //Replace with common break method
|
||||
|
|
|
|||
|
|
@ -28,6 +28,15 @@ class SnowLayerBlock extends FlowableBlock{
|
|||
$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){
|
||||
if($type === BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->getID() === AIR){ //Replace with common break method
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue