From cbe069269695aa2c5adcc1795ed5f4ff54387005 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sun, 9 Jun 2013 15:14:30 +0200 Subject: [PATCH] Players can put out fires --- src/API/BlockAPI.php | 3 +++ src/Player.php | 4 ++-- src/material/block/misc/Fire.php | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index cba00ef614..82cacce962 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -327,6 +327,9 @@ class BlockAPI{ if($item->isPlaceable()){ $hand = $item->getBlock(); $hand->position($block); + }elseif($block->getID() === FIRE){ + $player->level->setBlock($block, new AirBlock()); + return false; }else{ return $this->cancelAction($block, $player, false); } diff --git a/src/Player.php b/src/Player.php index 4e87092fa6..39acca79b8 100644 --- a/src/Player.php +++ b/src/Player.php @@ -1084,9 +1084,9 @@ class Player{ "eid" => 0, )); if(($this->gamemode & 0x01) === 0x01){ - $this->slot = 7; + $this->slot = -1;//7 }else{ - $this->slot = 0; + $this->slot = -1;//0 } $this->entity = $this->server->api->entity->add($this->level, ENTITY_PLAYER, 0, array("player" => $this)); $this->eid = $this->entity->eid; diff --git a/src/material/block/misc/Fire.php b/src/material/block/misc/Fire.php index de59fd45b1..4d6fbd7e38 100644 --- a/src/material/block/misc/Fire.php +++ b/src/material/block/misc/Fire.php @@ -29,6 +29,7 @@ class FireBlock extends FlowableBlock{ public function __construct($meta = 0){ parent::__construct(FIRE, $meta, "Fire"); $this->isReplaceable = true; + $this->breakable = false; $this->isFullBlock = true; }