Cleaned up and added API for entity air supply, fixed oxygen being used in creative/spectator

this commit also includes respiration checks because it's cherry-picked
from api3/blocks, but respiration won't work until it's registered.
This commit is contained in:
Dylan K. Taylor
2017-07-05 12:40:28 +01:00
parent bdfd9c95dd
commit 2601e35990
4 changed files with 117 additions and 28 deletions

View File

@ -1713,6 +1713,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
return 0.0;
}
public function canBreathe() : bool{
return $this->isCreative() or parent::canBreathe();
}
public function checkNetwork(){
if(!$this->isOnline()){
return;