From 09904dc5196ed2753336dcd79d15e3e7dac41e8c Mon Sep 17 00:00:00 2001 From: Dylan T Date: Mon, 25 Mar 2024 14:58:21 +0000 Subject: [PATCH] workaround for callback-validator not understanding arrow functions --- src/entity/Living.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/entity/Living.php b/src/entity/Living.php index 9a95cae07..a6902ae69 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -158,7 +158,9 @@ abstract class Living extends Entity{ } }; $this->armorInventory->getListeners()->add(new CallbackInventoryListener( - fn(Inventory $inventory, int $slot, Item $oldItem) => $playArmorSound($inventory->getItem($slot), $oldItem), + function(Inventory $inventory, int $slot, Item $oldItem) : void{ + $playArmorSound($inventory->getItem($slot), $oldItem); + }, function(Inventory $inventory, array $oldContents) use ($playArmorSound) : void{ foreach($oldContents as $slot => $oldItem){ $playArmorSound($inventory->getItem($slot), $oldItem);