Check for player in range for slab placement

This commit is contained in:
Shoghi Cervantes Pueyo 2013-02-03 20:21:03 +01:00
parent fb9a0f2119
commit d1610ce7a1

View File

@ -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;