Commit 51a1408
committed
Add getter methods to retrieve listener and inventory close listener
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.
```php
$listener = $menu->getInventoryCloseListener();
$menu->setInventoryCloseListener(function(Player $player, Inventory $inventory) use($listener) : void{
$listener($player, $inventory);
// place additional inventory close checks here
});
```1 parent 9f0f6d9 commit 51a1408
1 file changed
Lines changed: 14 additions & 0 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
95 | 109 | | |
96 | 110 | | |
97 | 111 | | |
| |||
0 commit comments