File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
src/main/java/me/flame/menus/menu Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 3
3
import org .bukkit .Bukkit ;
4
4
import org .bukkit .plugin .Plugin ;
5
5
import me .flame .menus .listeners .*;
6
+ import org .bukkit .plugin .java .JavaPlugin ;
6
7
import org .jetbrains .annotations .Contract ;
7
8
import org .jetbrains .annotations .NotNull ;
8
9
9
10
@ SuppressWarnings ("unused" )
10
11
public final class Menus {
11
- private static final MenuFactory menuFactory = new MenuFactory ( );
12
+ public static final Plugin PLUGIN = JavaPlugin . getProvidingPlugin ( Menus . class );
12
13
13
- /**
14
- * Register the events required for Click events AND Modifier Checking
15
- * <p>
16
- * This includes: Checking if Placing/Removing/Swapping/Cloning items is allowed
17
- * <p>
18
- * or any click/drag/open/close event that happens, it's pretty important unless you have some sort of dummy inventory.
19
- */
20
- public static void installMenus (Plugin plugin ) {
21
- Bukkit .getPluginManager ().registerEvents (new MenuListeners (), plugin );
14
+ static {
15
+ Bukkit .getPluginManager ().registerEvents (new MenuListeners (), PLUGIN );
22
16
}
23
17
18
+ private static final MenuFactory menuFactory = new MenuFactory ();
19
+
24
20
@ Contract (value = " -> new" , pure = true )
25
21
public static @ NotNull SimpleBuilder menu () {
26
22
return new SimpleBuilder ();
You can’t perform that action at this time.
0 commit comments