mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Replace disallowed operators in src/item/
This commit is contained in:
@@ -96,7 +96,7 @@ class Armor extends Durable{
|
||||
|
||||
foreach($this->getEnchantments() as $enchantment){
|
||||
$type = $enchantment->getType();
|
||||
if($type instanceof ProtectionEnchantment and $type->isApplicable($event)){
|
||||
if($type instanceof ProtectionEnchantment && $type->isApplicable($event)){
|
||||
$epf += $type->getProtectionFactor($enchantment->getLevel());
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class Armor extends Durable{
|
||||
|
||||
$chance = 1 / ($unbreakingLevel + 1);
|
||||
for($i = 0; $i < $amount; ++$i){
|
||||
if(mt_rand(1, 100) > 60 and lcg_value() > $chance){ //unbreaking only applies to armor 40% of the time at best
|
||||
if(mt_rand(1, 100) > 60 && lcg_value() > $chance){ //unbreaking only applies to armor 40% of the time at best
|
||||
$negated++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user