mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
workaround for callback-validator not understanding arrow functions
This commit is contained in:
parent
f799cfaba6
commit
09904dc519
@ -158,7 +158,9 @@ abstract class Living extends Entity{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
$this->armorInventory->getListeners()->add(new CallbackInventoryListener(
|
$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{
|
function(Inventory $inventory, array $oldContents) use ($playArmorSound) : void{
|
||||||
foreach($oldContents as $slot => $oldItem){
|
foreach($oldContents as $slot => $oldItem){
|
||||||
$playArmorSound($inventory->getItem($slot), $oldItem);
|
$playArmorSound($inventory->getItem($slot), $oldItem);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user