Skip to content

v4.6.5

Latest
Compare
Choose a tag to compare
@Muqsit Muqsit released this 14 Aug 07:12
· 1 commit to pm5 since this release
  • Added getter methods to retrieve menu listener and menu inventory close listener
    Added InvMenu::getListener(), InvMenu::getInventoryCloseListener().
    This allows developers to retrieve the current listener, extend its behavior, and then re-set it.
    This provides more flexibility in chaining or extending listener functionalities without losing the original behavior.
    $listener = $menu->getInventoryCloseListener();
    $menu->setInventoryCloseListener(function(Player $player, Inventory $inventory) use($listener) : void{
    	$listener($player, $inventory);
    	// place additional inventory close checks here
    });