mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Human: Use Item->getEnchantmentLevel() for Respiration check
This commit is contained in:
parent
a6c1e02847
commit
98eba11da5
@ -611,8 +611,8 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
|
||||
protected function doAirSupplyTick(int $tickDiff){
|
||||
//TODO: allow this to apply to other mobs
|
||||
if(($ench = $this->inventory->getHelmet()->getEnchantment(Enchantment::RESPIRATION)) === null or
|
||||
lcg_value() <= (1 / ($ench->getLevel() + 1))){
|
||||
if(($respirationLevel = $this->inventory->getHelmet()->getEnchantmentLevel(Enchantment::RESPIRATION)) <= 0 or
|
||||
lcg_value() <= (1 / ($respirationLevel + 1))){
|
||||
parent::doAirSupplyTick($tickDiff);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user