Skip to content

Commit 593b049

Browse files
committed
Fixed #1750 cannot place slabs against blocks
1 parent 0907aed commit 593b049

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/pocketmine/block/Slab.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function place(Item $item, Block $block, Block $target, $face, $fx, $fy,
9494
return true;
9595
}
9696
//TODO: check for collision
97-
}elseif(!($player instanceof Player)){
97+
}else{
9898
if($block->getID() === self::SLAB){
9999
if(($block->getDamage() & 0x07) === ($this->meta & 0x07)){
100100
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true);
@@ -108,9 +108,8 @@ public function place(Item $item, Block $block, Block $target, $face, $fx, $fy,
108108
$this->meta |= 0x08;
109109
}
110110
}
111-
}else{
112-
return false;
113111
}
112+
114113
if($block->getID() === self::SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){
115114
return false;
116115
}

src/pocketmine/block/WoodSlab.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function place(Item $item, Block $block, Block $target, $face, $fx, $fy,
9191

9292
return true;
9393
}
94-
}elseif(!($player instanceof Player)){ //TODO: collision
94+
}else{ //TODO: collision
9595
if($block->getID() === self::WOOD_SLAB){
9696
if(($block->getDamage() & 0x07) === ($this->meta & 0x07)){
9797
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_WOOD_SLAB, $this->meta), true);
@@ -105,9 +105,8 @@ public function place(Item $item, Block $block, Block $target, $face, $fx, $fy,
105105
$this->meta |= 0x08;
106106
}
107107
}
108-
}else{
109-
return false;
110108
}
109+
111110
if($block->getID() === self::WOOD_SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){
112111
return false;
113112
}

0 commit comments

Comments
 (0)