Fixed #784 Slabs replacing other slabs

This commit is contained in:
Shoghi Cervantes 2013-09-08 10:45:36 +02:00
parent c4a5a9c849
commit 8aef462a68

View File

@ -46,6 +46,9 @@ class SlabBlock extends TransparentBlock{
if($target->getID() === SLAB and ($target->getMetadata() & 0x08) === 0x08 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){
$this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta), true, false, true);
return true;
}elseif($block->getID() === SLAB and ($block->getMetadata() & 0x07) === ($this->meta & 0x07)){
$this->level->setBlock($block, BlockAPI::get(DOUBLE_SLAB, $this->meta), true, false, true);
return true;
}else{
$this->meta |= 0x08;
}
@ -53,6 +56,9 @@ class SlabBlock extends TransparentBlock{
if($target->getID() === SLAB and ($target->getMetadata() & 0x08) === 0 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){
$this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta), true, false, true);
return true;
}elseif($block->getID() === SLAB and ($block->getMetadata() & 0x07) === ($this->meta & 0x07)){
$this->level->setBlock($block, BlockAPI::get(DOUBLE_SLAB, $this->meta), true, false, true);
return true;
}
}elseif(!$player->entity->inBlock($block)){
if($block->getID() === SLAB){