Replace disallowed operators in src/item/

This commit is contained in:
Dylan K. Taylor
2022-01-20 19:16:50 +00:00
parent 373880e582
commit 22fb02c4e6
11 changed files with 25 additions and 25 deletions

View File

@@ -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++;
}
}