Remove redundant gamemode checks

The caller will check the player's gamemode, so there is no use for these checks.
This commit is contained in:
Dylan K. Taylor 2017-09-03 12:22:37 +01:00
parent 7483f22e8b
commit aa9fd1b4f9
2 changed files with 4 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}