Added melting for ice and snow layers

This commit is contained in:
Dylan K. Taylor
2017-04-18 18:55:01 +01:00
parent 3bd94c9da7
commit b6fe231bc1
3 changed files with 24 additions and 4 deletions

View File

@ -25,6 +25,7 @@ namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\item\Tool;
use pocketmine\level\Level;
class Ice extends Transparent{
@ -56,6 +57,17 @@ class Ice extends Transparent{
return true;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_RANDOM){
if($this->level->getHighestAdjacentBlockLight($this->x, $this->y, $this->z) >= 12){
$this->level->useBreakOn($this);
return $type;
}
}
return false;
}
public function getDrops(Item $item){
return [];
}