From aa9fd1b4f95c1bc8b4d3b174f63b058d57963205 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 3 Sep 2017 12:22:37 +0100 Subject: [PATCH] Remove redundant gamemode checks The caller will check the player's gamemode, so there is no use for these checks. --- src/pocketmine/block/Sapling.php | 5 ++--- src/pocketmine/block/Sugarcane.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pocketmine/block/Sapling.php b/src/pocketmine/block/Sapling.php index 9597a6d96..e29faebbb 100644 --- a/src/pocketmine/block/Sapling.php +++ b/src/pocketmine/block/Sapling.php @@ -76,9 +76,8 @@ class Sapling extends Flowable{ if($item->getId() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal //TODO: change log type Tree::growTree($this->getLevel(), $this->x, $this->y, $this->z, new Random(mt_rand()), $this->meta & 0x07); - if(($player->gamemode & 0x01) === 0){ - $item->count--; - } + + $item->count--; return true; } diff --git a/src/pocketmine/block/Sugarcane.php b/src/pocketmine/block/Sugarcane.php index 6512fbd4a..09280ce3c 100644 --- a/src/pocketmine/block/Sugarcane.php +++ b/src/pocketmine/block/Sugarcane.php @@ -64,9 +64,8 @@ class Sugarcane extends Flowable{ $this->meta = 0; $this->getLevel()->setBlock($this, $this, true); } - if(($player->gamemode & 0x01) === 0){ - $item->count--; - } + + $item->count--; return true; }