mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-19 01:44:06 +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){
|
protected function doAirSupplyTick(int $tickDiff){
|
||||||
//TODO: allow this to apply to other mobs
|
//TODO: allow this to apply to other mobs
|
||||||
if(($ench = $this->inventory->getHelmet()->getEnchantment(Enchantment::RESPIRATION)) === null or
|
if(($respirationLevel = $this->inventory->getHelmet()->getEnchantmentLevel(Enchantment::RESPIRATION)) <= 0 or
|
||||||
lcg_value() <= (1 / ($ench->getLevel() + 1))){
|
lcg_value() <= (1 / ($respirationLevel + 1))){
|
||||||
parent::doAirSupplyTick($tickDiff);
|
parent::doAirSupplyTick($tickDiff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user