NostalgiaCore/src/material/block/solid/Dirt.php
2013-02-14 20:37:16 +01:00

41 lines
No EOL
872 B
PHP

<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class DirtBlock extends SolidBlock{
public function __construct(){
parent::__construct(DIRT, 0, "Dirt");
$this->isActivable = true;
}
public function onActivate(BlockAPI $level, Item $item, Player $player){
if($item->isHoe()){
$level->setBlock($this, FARMLAND, 0);
return true;
}
return false;
}
}