mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 07:39:42 +00:00
Replace disallowed operators in src/item/
This commit is contained in:
@@ -62,7 +62,7 @@ abstract class Durable extends Item{
|
||||
* @return bool if any damage was applied to the item
|
||||
*/
|
||||
public function applyDamage(int $amount) : bool{
|
||||
if($this->isUnbreakable() or $this->isBroken()){
|
||||
if($this->isUnbreakable() || $this->isBroken()){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ abstract class Durable extends Item{
|
||||
}
|
||||
|
||||
public function setDamage(int $damage) : Item{
|
||||
if($damage < 0 or $damage > $this->getMaxDurability()){
|
||||
if($damage < 0 || $damage > $this->getMaxDurability()){
|
||||
throw new \InvalidArgumentException("Damage must be in range 0 - " . $this->getMaxDurability());
|
||||
}
|
||||
$this->damage = $damage;
|
||||
|
Reference in New Issue
Block a user