mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
Check for player in range for slab placement
This commit is contained in:
parent
fb9a0f2119
commit
d1610ce7a1
@ -56,7 +56,7 @@ class SlabBlock extends TransparentBlock{
|
|||||||
$level->setBlock($target, DOUBLE_SLAB, $this->meta & 0x07);
|
$level->setBlock($target, DOUBLE_SLAB, $this->meta & 0x07);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}else{
|
}elseif(!$player->entity->inBlock($block->x, $block->y, $block->z)){
|
||||||
if($block->getID() === SLAB){
|
if($block->getID() === SLAB){
|
||||||
if(($block->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
if(($block->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
||||||
$level->setBlock($block, DOUBLE_SLAB, $this->meta & 0x07);
|
$level->setBlock($block, DOUBLE_SLAB, $this->meta & 0x07);
|
||||||
@ -68,6 +68,8 @@ class SlabBlock extends TransparentBlock{
|
|||||||
$this->meta |= 0x08;
|
$this->meta |= 0x08;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
$level->setBlock($block, $this->id, $this->meta);
|
$level->setBlock($block, $this->id, $this->meta);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user