Make some more changes
This commit is contained in:
parent
e61335609f
commit
4d005e1704
4 changed files with 17 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -27,3 +27,4 @@ replay_pid*
|
||||||
.gradle
|
.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;
|
package dev.zontreck.eventsbus;
|
||||||
|
|
||||||
|
@Priority(Level = PriorityLevel.LOWEST)
|
||||||
public class Event {
|
public class Event {
|
||||||
private boolean cancelled = false;
|
private boolean cancelled = false;
|
||||||
|
|
||||||
|
@ -17,8 +18,8 @@ public class Event {
|
||||||
/**
|
/**
|
||||||
* Checks if the event is cancelled.
|
* Checks if the event is cancelled.
|
||||||
*
|
*
|
||||||
* @return False if the event cannot be cancelled, or returns the current status
|
* @return False if the event cannot be cancelled; or
|
||||||
* for the event.
|
* The current cancellation status for the event
|
||||||
*/
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
if (!IsCancellable())
|
if (!IsCancellable())
|
||||||
|
@ -34,4 +35,9 @@ public class Event {
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
cancelled = 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)
|
@Retention(value = RetentionPolicy.RUNTIME)
|
||||||
public @interface Priority {
|
public @interface Priority {
|
||||||
public PriorityLevel Level = PriorityLevel.LOW;
|
PriorityLevel Level();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue