MenuCloseEvent
1
package me.arasple.mc.trmenu.api.events
2
3
import io.izzel.taboolib.module.event.EventCancellable
4
import me.arasple.mc.trmenu.display.Menu
5
import org.bukkit.entity.Player
6
7
/**
8
* @author Arasple
9
* @date 2020/7/7 9:31
10
*/
11
class MenuCloseEvent(val player: Player, val menu: Menu, val page: Int, val reason: Reason, val silent: Boolean) : EventCancellable<MenuCloseEvent>() {
12
13
enum class Reason {
14
15
CONSOLE,
16
17
OP,
18
19
PLAYER,
20
21
MENU_RELOAD,
22
23
SWITCH_MENU,
24
25
SWITCH_BUKKIT_INVENTORY,
26
27
SWITCH_PAGE,
28
29
ERROR;
30
31
fun isSwitch() = this == SWITCH_MENU || this == SWITCH_PAGE || this == MENU_RELOAD
32
33
}
34
35
}
Copied!
Last modified 1yr ago
Copy link