mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
Merge commit '3f2455f09'
# Conflicts: # resources/vanilla # src/pocketmine/block/SnowLayer.php
This commit is contained in:
commit
e250553670
@ -71,6 +71,10 @@ class SnowLayer extends Flowable implements Fallable{
|
|||||||
return [AxisAlignedBB::one()->trim(Facing::UP, $this->layers >= 4 ? 0.5 : 1)];
|
return [AxisAlignedBB::one()->trim(Facing::UP, $this->layers >= 4 ? 0.5 : 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function canBeSupportedBy(Block $b) : bool{
|
||||||
|
return $b->isSolid() or ($b instanceof SnowLayer and $b->isSameType($this) and $b->layers === 8);
|
||||||
|
}
|
||||||
|
|
||||||
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||||
if($blockReplace instanceof SnowLayer){
|
if($blockReplace instanceof SnowLayer){
|
||||||
if($blockReplace->layers >= 8){
|
if($blockReplace->layers >= 8){
|
||||||
@ -78,8 +82,7 @@ class SnowLayer extends Flowable implements Fallable{
|
|||||||
}
|
}
|
||||||
$this->layers = $blockReplace->layers + 1;
|
$this->layers = $blockReplace->layers + 1;
|
||||||
}
|
}
|
||||||
if($blockReplace->getSide(Facing::DOWN)->isSolid()){
|
if($this->canBeSupportedBy($blockReplace->getSide(Facing::DOWN))){
|
||||||
//TODO: fix placement
|
|
||||||
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user