-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExamplePlugin.java
57 lines (48 loc) · 1.67 KB
/
ExamplePlugin.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.github.ExampleUser.ExamplePlugin;
import com.github.ExampleUser.ExamplePlugin.command.CommandHandler;
import com.github.ExampleUser.ExamplePlugin.config.ConfigHandler;
import com.github.ExampleUser.ExamplePlugin.db.DatabaseHandler;
import com.github.ExampleUser.ExamplePlugin.listener.ListenerHandler;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
public class ExamplePlugin extends JavaPlugin {
private static ExamplePlugin instance;
private ConfigHandler configHandler;
private DatabaseHandler DatabaseHandler;
private CommandHandler commandHandler;
private ListenerHandler listenerHandler;
public static ExamplePlugin getInstance() {
return instance;
}
public void onLoad() {
instance = this;
configHandler = new ConfigHandler(instance);
DatabaseHandler = new DatabaseHandler(instance);
commandHandler = new CommandHandler(instance);
listenerHandler = new ListenerHandler(instance);
configHandler.onLoad();
DatabaseHandler.onLoad();
commandHandler.onLoad();
listenerHandler.onLoad();
}
public void onEnable() {
configHandler.onEnable();
DatabaseHandler.onEnable();
commandHandler.onEnable();
listenerHandler.onEnable();
}
public void onDisable() {
configHandler.onDisable();
DatabaseHandler.onDisable();
commandHandler.onDisable();
listenerHandler.onDisable();
}
@NotNull
public DatabaseHandler getDataHandler() {
return DatabaseHandler;
}
@NotNull
public ConfigHandler getConfigHandler() {
return configHandler;
}
}