Multiple changes

* Fixed hoe durability
* Fixed some blocks hitbox
* Added Creative pseudo-inventory
* Added Carrots and Carrot Crops
* Added Potatoes, Baked potatoes and Potato Crops
This commit is contained in:
Shoghi Cervantes 2013-11-24 18:38:37 +01:00
parent f8d8052ec3
commit e700179bb0
15 changed files with 355 additions and 23 deletions

View file

@ -19,7 +19,7 @@
*
*/
class CarpetBlock extends TransparentBlock{
class CarpetBlock extends FlowableBlock{
public function __construct($meta = 0){
parent::__construct(CARPET, $meta, "Carpet");
$names = array(
@ -42,7 +42,8 @@ class CarpetBlock extends TransparentBlock{
);
$this->name = $names[$this->meta];
$this->hardness = 0;
$this->isFullBlock = false;
$this->isFullBlock = false;
$this->isSolid = true;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
@ -57,6 +58,7 @@ class CarpetBlock extends TransparentBlock{
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->getID() === AIR){ //Replace with common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id, $this->meta, 1));
$this->level->setBlock($this, new AirBlock(), true, false, true);
return BLOCK_UPDATE_NORMAL;
}

View file

@ -22,6 +22,8 @@
class GlassPaneBlock extends TransparentBlock{
public function __construct(){
parent::__construct(GLASS_PANE, 0, "Glass Pane");
$this->isFullBlock = false;
$this->isSolid = false;
}
}

View file

@ -22,6 +22,8 @@
class IronBarsBlock extends TransparentBlock{
public function __construct(){
parent::__construct(IRON_BARS, 0, "Iron Bars");
$this->isFullBlock = false;
$this->isSolid = false;
}
}

View file

@ -27,6 +27,7 @@ class StoneWallBlock extends TransparentBlock{
$this->name = "Mossy Cobblestone Wall";
}
$this->isFullBlock = false;
$this->isSolid = false;
$this->hardness = 30;
}