2
2
## ⚠️ UNDER DEVELOPMENT ⚠️
3
3
4
4
Welcome to EventLib, your user-friendly Java event library using sockets for seamless communication between various applications.
5
-
6
5
## ** Quick Start** 🚀
7
6
8
7
### Maven
@@ -41,7 +40,7 @@ Then, include the dependency:
41
40
``` groovy
42
41
implementation("at.jkvn.eventlib:EventLib:LATEST")
43
42
```
44
-
43
+ ---
45
44
## Integration 🛠️
46
45
47
46
Integrating EventLib into your project is straightforward:
@@ -97,9 +96,12 @@ class StartupEvent extends Event {}
97
96
``` java
98
97
EventLib . call(new StartupEvent ());
99
98
```
99
+ ---
100
+ ## Extras & Features 🎉
100
101
101
- ## Priorities
102
-
102
+ ### Priorities
103
+ You can set the priority of an event with our built-in @Priority annotation.
104
+ This tells you that the event with the HIGHEST priority is executed first and then the next and the next
103
105
EventLib supports the following event priorities:
104
106
105
107
- ` EventPriority.LOWEST `
@@ -108,8 +110,27 @@ EventLib supports the following event priorities:
108
110
- ` EventPriority.HIGH `
109
111
- ` EventPriority.HIGHEST `
110
112
111
- ## Extras & Features
113
+ ```` java
114
+ @EventHandler
115
+ @Priority (EventPriority . HIGHEST )
116
+ public void onListenYourFavoriteEvent(YourFavoriteEvent event) {
117
+ System . out. print(" This event is executed first" );
118
+ }
112
119
120
+ @EventHandler
121
+ @Priority (EventPriority . HIGH )
122
+ public void onListenYourFavoriteEvent(YourFavoriteEvent event) {
123
+ System . out. print(" This event is executed after the HIGHEST event" );
124
+ }
125
+
126
+ @EventHandler
127
+ @Priority (EventPriority . NORMAL )
128
+ public void onListenYourFavoriteEvent(YourFavoriteEvent event) {
129
+ System . out. print(" This event is executed after the HIGH event" );
130
+ }
131
+ ````
132
+ ---
133
+ ### Cancellation
113
134
EventLib provides additional features such as event cancellation and resumption:
114
135
115
136
``` java
@@ -140,6 +161,7 @@ public void onListenYourFavoriteEvent(YourFavoriteEvent event) {
140
161
}
141
162
```
142
163
164
+
143
165
## Future Plans 🛌
144
166
145
167
- [ ] Asynchronous events
@@ -149,3 +171,6 @@ public void onListenYourFavoriteEvent(YourFavoriteEvent event) {
149
171
- [x] Event listener priority
150
172
- [ ] Socket connection
151
173
- [ ] Socket authentication (password, private key, etc.)
174
+
175
+ ## License 📜
176
+ The contents of this repository are licensed under the [ Apache License, version 2.0] ( http://www.apache.org/licenses/LICENSE-2.0 ) .
0 commit comments