Fix redstone ore glowing immediately when placed

Do not update the block when placed
This commit is contained in:
Dylan K. Taylor 2016-09-09 10:41:35 +01:00
parent 7b8548b2b1
commit b156480550

View File

@ -24,6 +24,7 @@ namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\item\Tool;
use pocketmine\level\Level;
use pocketmine\Player;
class RedstoneOre extends Solid{
@ -41,6 +42,10 @@ class RedstoneOre extends Solid{
return 3;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
return $this->getLevel()->setBlock($this, $this, true, false);
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL or $type === Level::BLOCK_UPDATE_TOUCH){
$this->getLevel()->setBlock($this, Block::get(Item::GLOWING_REDSTONE_ORE, $this->meta));