More hasFiniteResources() usages

This commit is contained in:
Dylan K. Taylor
2019-03-31 16:51:43 +01:00
parent f8ce7797db
commit c59a2d1b93
4 changed files with 7 additions and 7 deletions

View File

@ -1527,7 +1527,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
}
public function getDrops() : array{
if(!$this->isCreative()){
if($this->hasFiniteResources()){
return parent::getDrops();
}
@ -1535,7 +1535,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
}
public function getXpDropAmount() : int{
if(!$this->isCreative()){
if($this->hasFiniteResources()){
return parent::getXpDropAmount();
}
@ -2052,7 +2052,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
}else{
$this->inventory->swap($this->inventory->getHeldItemIndex(), $existing);
}
}elseif($this->isCreative(true)){ //TODO: plugins won't know this isn't going to execute
}elseif(!$this->hasFiniteResources()){ //TODO: plugins won't know this isn't going to execute
$firstEmpty = $this->inventory->firstEmpty();
if($firstEmpty === -1){ //full inventory
$this->inventory->setItemInHand($item);