From 2f7e5688e2a4efbc661808b146ae536a38abb10f Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Wed, 27 Nov 2013 15:28:10 +0100 Subject: [PATCH] Fixed #418 Placing blocks on top of Snow replaces it now --- src/API/BlockAPI.php | 6 ++++++ src/material/block/plant/DeadBush.php | 2 +- src/material/block/plant/TallGrass.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 95ab612d3..73368a469 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -419,6 +419,12 @@ class BlockAPI{ return $this->cancelAction($block, $player, false); } + if($target->isReplaceable === true){ + $block = $target; + $hand->position($block); + $face = -1; + } + if($hand->isSolid === true and $player->entity->inBlock($block)){ return $this->cancelAction($block, $player, false); //Entity in block } diff --git a/src/material/block/plant/DeadBush.php b/src/material/block/plant/DeadBush.php index 643ad211a..d4736980d 100644 --- a/src/material/block/plant/DeadBush.php +++ b/src/material/block/plant/DeadBush.php @@ -22,7 +22,7 @@ class DeadBushBlock extends FlowableBlock{ public function __construct(){ parent::__construct(DEAD_BUSH, 0, "Dead Bush"); - $this->isReplaceable = true; + //$this->isReplaceable = true; $this->hardness = 0; } diff --git a/src/material/block/plant/TallGrass.php b/src/material/block/plant/TallGrass.php index afe385289..ec0068e50 100644 --- a/src/material/block/plant/TallGrass.php +++ b/src/material/block/plant/TallGrass.php @@ -22,7 +22,7 @@ class TallGrassBlock extends FlowableBlock{ public function __construct($meta = 1){ parent::__construct(TALL_GRASS, $meta, "Tall Grass"); - $this->isReplaceable = true; + //$this->isReplaceable = true; $names = array( 0 => "Dead Shrub", 1 => "Tall Grass",