diff --git a/src/material/block/plant/Beetroot.php b/src/material/block/plant/Beetroot.php index b1c517b0..207919c4 100644 --- a/src/material/block/plant/Beetroot.php +++ b/src/material/block/plant/Beetroot.php @@ -41,7 +41,7 @@ class BeetrootBlock extends FlowableBlock{ $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ - $item->count--; + $player->removeItem(DYE,0x0F,1); } return true; } diff --git a/src/material/block/plant/Carrot.php b/src/material/block/plant/Carrot.php index dd162d14..fd1f7839 100644 --- a/src/material/block/plant/Carrot.php +++ b/src/material/block/plant/Carrot.php @@ -41,7 +41,7 @@ class CarrotBlock extends FlowableBlock{ $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ - $item->count--; + $player->removeItem(DYE,0x0F,1); } return true; } diff --git a/src/material/block/plant/MelonStem.php b/src/material/block/plant/MelonStem.php index 38bba91f..1ce0641e 100644 --- a/src/material/block/plant/MelonStem.php +++ b/src/material/block/plant/MelonStem.php @@ -72,7 +72,7 @@ class MelonStemBlock extends FlowableBlock{ $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ - $item->count--; + $player->removeItem(DYE,0x0F,1); } return true; } diff --git a/src/material/block/plant/PotatoBlock.php b/src/material/block/plant/PotatoBlock.php index 6962f5d7..f4cbc02d 100644 --- a/src/material/block/plant/PotatoBlock.php +++ b/src/material/block/plant/PotatoBlock.php @@ -41,7 +41,7 @@ class PotatoBlock extends FlowableBlock{ $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ - $item->count--; + $player->removeItem(DYE,0x0F,1); } return true; } diff --git a/src/material/block/plant/PumpkinStem.php b/src/material/block/plant/PumpkinStem.php index fa1871bd..07b799c7 100644 --- a/src/material/block/plant/PumpkinStem.php +++ b/src/material/block/plant/PumpkinStem.php @@ -72,7 +72,7 @@ class PumpkinStemBlock extends FlowableBlock{ $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ - $item->count--; + $player->removeItem(DYE,0x0F,1); } return true; } diff --git a/src/material/block/plant/Sapling.php b/src/material/block/plant/Sapling.php index c0fd8f37..5af0a24f 100644 --- a/src/material/block/plant/Sapling.php +++ b/src/material/block/plant/Sapling.php @@ -53,7 +53,7 @@ class SaplingBlock extends FlowableBlock{ if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x03); if(($player->gamemode & 0x01) === 0){ - $item->count--; + $player->removeItem(DYE,0x0F,1); } return true; } diff --git a/src/material/block/plant/Wheat.php b/src/material/block/plant/Wheat.php index 1b28ebc2..fc920bb9 100644 --- a/src/material/block/plant/Wheat.php +++ b/src/material/block/plant/Wheat.php @@ -41,7 +41,7 @@ class WheatBlock extends FlowableBlock{ $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ - $item->count--; + $player->removeItem(DYE,0x0F,1); } return true; } diff --git a/src/material/block/solid/Grass.php b/src/material/block/solid/Grass.php index 2e63efd2..8082dbcc 100644 --- a/src/material/block/solid/Grass.php +++ b/src/material/block/solid/Grass.php @@ -33,10 +33,10 @@ class GrassBlock extends SolidBlock{ public function onActivate(Item $item, Player $player){ if($item->getID() === DYE and $item->getMetadata() === 0x0F){ - if(($player->gamemode & 0x01) === 0){ - $item->count--; - } TallGrassObject::growGrass($this->level, $this, new Random(), 8, 2); + if(($player->gamemode & 0x01) === 0){ + $player->removeItem(DYE,0x0F,1); + } return true; }elseif($item->isHoe()){ if(($player->gamemode & 0x01) === 0){