MenuOpenEvent
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/3/17 16:29
10
*/
11
class MenuOpenEvent(val player: Player, val menu: Menu, val page: Int, val reason: Reason, var result: Result) : EventCancellable<MenuOpenEvent>() {
12
13
fun isOpenedByBindings() = reason == Reason.BINDING_COMMANDS || reason == Reason.BINDING_ITEMS || reason == Reason.BINDING_SHORTCUT
14
15
enum class Result {
16
17
/**
18
* Unknow page etc.
19
*/
20
ERROR_PAGE,
21
22
SUCCESSED,
23
24
DENIED,
25
26
UNKNOWN
27
28
}
29
30
enum class Reason {
31
32
RELOAD,
33
34
PLAYER_COMMAND,
35
36
CONSOLE,
37
38
SWITCH_PAGE,
39
40
BINDING_COMMANDS,
41
42
BINDING_ITEMS,
43
44
BINDING_SHORTCUT,
45
46
UNKNOWN
47
48
}
49
50
}
Copied!
Last modified 1yr ago
Copy link