File tree Expand file tree Collapse file tree 5 files changed +49
-18
lines changed
src/main/java/space/debian/WrapAPI Expand file tree Collapse file tree 5 files changed +49
-18
lines changed Original file line number Diff line number Diff line change 1515 </repository >
1616 </repositories >
1717
18+ <dependencies >
19+ <dependency >
20+ <groupId >org.github.paperspigot</groupId >
21+ <artifactId >paperspigot-api</artifactId >
22+ <version >1.8.8-R0.1-SNAPSHOT</version >
23+ </dependency >
24+ <dependency >
25+ <groupId >org.apache.maven.plugins</groupId >
26+ <artifactId >maven-javadoc-plugin</artifactId >
27+ <version >3.2.0</version >
28+ </dependency >
29+ </dependencies >
30+
1831 <build >
1932 <finalName >${project.artifactId} -${project.version} </finalName >
2033 <sourceDirectory >src/main/java</sourceDirectory >
2740 </resource >
2841 </resources >
2942 <plugins >
43+ <plugin >
44+ <groupId >org.apache.maven.plugins</groupId >
45+ <artifactId >maven-javadoc-plugin</artifactId >
46+ <version >3.2.0</version >
47+ </plugin >
3048 <plugin >
3149 <groupId >org.apache.maven.plugins</groupId >
3250 <artifactId >maven-compiler-plugin</artifactId >
4462 <maven .compiler.target>1.8</maven .compiler.target>
4563 </properties >
4664
47- <dependencies >
48- <dependency >
49- <groupId >org.github.paperspigot</groupId >
50- <artifactId >paperspigot-api</artifactId >
51- <version >1.8.8-R0.1-SNAPSHOT</version >
52- </dependency >
53- </dependencies >
54-
5565</project >
Original file line number Diff line number Diff line change 11package space .debian .WrapAPI ;
22
33import org .bukkit .plugin .java .JavaPlugin ;
4+ import space .debian .WrapAPI .managers .CommandManager ;
45import space .debian .WrapAPI .managers .ListenerManager ;
56import space .debian .WrapAPI .tools .logging .WrapLogger ;
67
78public abstract class WrapAPI extends JavaPlugin {
89
910 private static WrapAPI instance ;
1011
11- @ Override
12- public void onEnable () {
12+ public void preEnable () {
1313 instance = this ;
1414
1515 new WrapLogger (this );
16+
1617 new ListenerManager ();
18+ new CommandManager ();
19+ }
20+
21+ @ Override
22+ public void onEnable () {
23+
24+ preEnable ();
25+
26+ postEnable ();
27+ }
28+
29+ public void postEnable () {
30+
31+ ListenerManager .get ().initListeners ();
32+
33+ WrapLogger .get ().spacer ();
34+
35+ CommandManager .get ().initCommands ();
1736 }
1837
1938 public static WrapAPI get () {
Original file line number Diff line number Diff line change 11package space .debian .WrapAPI .managers ;
22
33import org .bukkit .Bukkit ;
4- import org .bukkit .command .CommandExecutor ;
5- import org .bukkit .event .Listener ;
6- import space .debian .WrapAPI .WrapAPI ;
74import space .debian .WrapAPI .objects .ICommand ;
85import space .debian .WrapAPI .tools .logging .WrapLogger ;
96
@@ -30,10 +27,10 @@ public void initCommands() {
3027 ICommand commandInstance = command .newInstance ();
3128 Bukkit .getServer ().getPluginCommand (commandInstance .getName ()).setExecutor (commandInstance );
3229
33- WrapLogger .get ().info (command .getSimpleName () + " command instantiated." );
30+ WrapLogger .get ().info (" " + command .getSimpleName () + " command instantiated." );
3431 } catch (InstantiationException | IllegalAccessException e ) {
3532
36- WrapLogger .get ().severe ("An error occured while instancing the " + command .getSimpleName () + " command." );
33+ WrapLogger .get ().severe (" An error occured while instancing the " + command .getSimpleName () + " command." );
3734 WrapLogger .get ().severe (e .getMessage ());
3835 }
3936 });
Original file line number Diff line number Diff line change @@ -27,10 +27,10 @@ public void initListeners() {
2727
2828 Bukkit .getServer ().getPluginManager ().registerEvents (listener .newInstance (), WrapAPI .get ());
2929
30- WrapLogger .get ().info (listener .getSimpleName () + " listener instantiated." );
30+ WrapLogger .get ().info (" " + listener .getSimpleName () + " listener instantiated." );
3131 } catch (InstantiationException | IllegalAccessException e ) {
3232
33- WrapLogger .get ().severe ("An error occured while instancing " + listener .getSimpleName () + " listener." );
33+ WrapLogger .get ().severe (" An error occured while instancing " + listener .getSimpleName () + " listener." );
3434 WrapLogger .get ().severe (e .getMessage ());
3535 }
3636 });
Original file line number Diff line number Diff line change 44
55public abstract class ICommand implements CommandExecutor {
66
7- public String name ;
7+ private String name ;
8+
9+ public ICommand (String name ) {
10+
11+ this .name = name ;
12+ }
813
914 public String getName () {
1015 return name ;
You can’t perform that action at this time.
0 commit comments