Make some more changes
This commit is contained in:
parent
e61335609f
commit
4d005e1704
4 changed files with 17 additions and 4 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -26,4 +26,5 @@ replay_pid*
|
|||
|
||||
.gradle
|
||||
|
||||
build
|
||||
build
|
||||
bin
|
6
src/main/java/dev/zontreck/eventsbus/Bus.java
Normal file
6
src/main/java/dev/zontreck/eventsbus/Bus.java
Normal file
|
@ -0,0 +1,6 @@
|
|||
package dev.zontreck.eventsbus;
|
||||
|
||||
public class Bus
|
||||
{
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package dev.zontreck.eventsbus;
|
||||
|
||||
@Priority(Level = PriorityLevel.LOWEST)
|
||||
public class Event {
|
||||
private boolean cancelled = false;
|
||||
|
||||
|
@ -17,8 +18,8 @@ public class Event {
|
|||
/**
|
||||
* Checks if the event is cancelled.
|
||||
*
|
||||
* @return False if the event cannot be cancelled, or returns the current status
|
||||
* for the event.
|
||||
* @return False if the event cannot be cancelled; or
|
||||
* The current cancellation status for the event
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
if (!IsCancellable())
|
||||
|
@ -34,4 +35,9 @@ public class Event {
|
|||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
||||
public PriorityLevel getPriorityLevel() {
|
||||
Class<?> Current = this.getClass();
|
||||
return Current.getAnnotation(Priority.class).Level();
|
||||
}
|
||||
}
|
|
@ -5,5 +5,5 @@ import java.lang.annotation.RetentionPolicy;
|
|||
|
||||
@Retention(value = RetentionPolicy.RUNTIME)
|
||||
public @interface Priority {
|
||||
public PriorityLevel Level = PriorityLevel.LOW;
|
||||
PriorityLevel Level();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue