mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-16 08:25:29 +00:00
Fix GC cycle count increases on player disconnect (#6487)
This commit is contained in:
parent
2ff6470792
commit
d2c3b8dacb
@ -42,7 +42,7 @@ class ArmorInventory extends SimpleInventory{
|
|||||||
){
|
){
|
||||||
parent::__construct(4);
|
parent::__construct(4);
|
||||||
|
|
||||||
$this->validators->add(new CallbackSlotValidator($this->validate(...)));
|
$this->validators->add(new CallbackSlotValidator(self::validate(...)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHolder() : Living{
|
public function getHolder() : Living{
|
||||||
@ -81,7 +81,7 @@ class ArmorInventory extends SimpleInventory{
|
|||||||
$this->setItem(self::SLOT_FEET, $boots);
|
$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 instanceof Armor){
|
||||||
if($item->getArmorSlot() !== $slot){
|
if($item->getArmorSlot() !== $slot){
|
||||||
return new TransactionValidationException("Armor item is in wrong slot");
|
return new TransactionValidationException("Armor item is in wrong slot");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user