Fixed #1750 cannot place slabs against blocks

This commit is contained in:
Shoghi Cervantes 2014-09-22 11:58:15 +02:00
parent 0907aedcef
commit 593b0497b0
2 changed files with 4 additions and 6 deletions

View File

@ -94,7 +94,7 @@ class Slab extends Transparent{
return true; return true;
} }
//TODO: check for collision //TODO: check for collision
}elseif(!($player instanceof Player)){ }else{
if($block->getID() === self::SLAB){ if($block->getID() === self::SLAB){
if(($block->getDamage() & 0x07) === ($this->meta & 0x07)){ if(($block->getDamage() & 0x07) === ($this->meta & 0x07)){
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true); $this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true);
@ -108,9 +108,8 @@ class Slab extends Transparent{
$this->meta |= 0x08; $this->meta |= 0x08;
} }
} }
}else{
return false;
} }
if($block->getID() === self::SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){ if($block->getID() === self::SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){
return false; return false;
} }

View File

@ -91,7 +91,7 @@ class WoodSlab extends Transparent{
return true; return true;
} }
}elseif(!($player instanceof Player)){ //TODO: collision }else{ //TODO: collision
if($block->getID() === self::WOOD_SLAB){ if($block->getID() === self::WOOD_SLAB){
if(($block->getDamage() & 0x07) === ($this->meta & 0x07)){ if(($block->getDamage() & 0x07) === ($this->meta & 0x07)){
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_WOOD_SLAB, $this->meta), true); $this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_WOOD_SLAB, $this->meta), true);
@ -105,9 +105,8 @@ class WoodSlab extends Transparent{
$this->meta |= 0x08; $this->meta |= 0x08;
} }
} }
}else{
return false;
} }
if($block->getID() === self::WOOD_SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){ if($block->getID() === self::WOOD_SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){
return false; return false;
} }