From d2c3b8dacb2a7d8712cf7539ab265439be056c0b Mon Sep 17 00:00:00 2001 From: kostamax27 Date: Mon, 11 Nov 2024 16:10:19 +0100 Subject: [PATCH] Fix GC cycle count increases on player disconnect (#6487) --- src/inventory/ArmorInventory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inventory/ArmorInventory.php b/src/inventory/ArmorInventory.php index 0b3ae5b7bc..8591cc65bf 100644 --- a/src/inventory/ArmorInventory.php +++ b/src/inventory/ArmorInventory.php @@ -42,7 +42,7 @@ class ArmorInventory extends SimpleInventory{ ){ parent::__construct(4); - $this->validators->add(new CallbackSlotValidator($this->validate(...))); + $this->validators->add(new CallbackSlotValidator(self::validate(...))); } public function getHolder() : Living{ @@ -81,7 +81,7 @@ class ArmorInventory extends SimpleInventory{ $this->setItem(self::SLOT_FEET, $boots); } - private function validate(Inventory $inventory, Item $item, int $slot) : ?TransactionValidationException{ + private static function validate(Inventory $inventory, Item $item, int $slot) : ?TransactionValidationException{ if($item instanceof Armor){ if($item->getArmorSlot() !== $slot){ return new TransactionValidationException("Armor item is in wrong slot");