remove event annotations

This commit is contained in:
dfsek
2021-07-21 22:06:20 -07:00
parent 8eddffb0a6
commit b630ab6531
3 changed files with 2 additions and 59 deletions

View File

@@ -1,17 +0,0 @@
package com.dfsek.terra.api.event.annotations;
import com.dfsek.terra.api.event.events.PackEvent;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Specifies that an event handler is to handle all {@link PackEvent}s, regardless of whether the pack
* depends on the com.dfsek.terra.addon's listener.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Global {
}

View File

@@ -1,39 +0,0 @@
package com.dfsek.terra.api.event.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotated listener methods will have a specific priority set.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Priority {
/**
* Highest possible priority. Listeners with this priority will always be invoked last.
*/
int HIGHEST = Integer.MAX_VALUE;
/**
* Lowest possible priority. Listeners with this priority will always be invoked first.
*/
int LOWEST = Integer.MIN_VALUE;
/**
* Default priority.
*/
int NORMAL = 0;
/**
* High priority.
*/
int HIGH = 1;
/**
* Low Priority.
*/
int LOW = -1;
/**
* @return Priority of this event. Events are executed from lowest to highest priorities.
*/
int value();
}

View File

@@ -1,13 +1,12 @@
package com.dfsek.terra.api.event.events;
import com.dfsek.terra.api.config.ConfigPack;
import com.dfsek.terra.api.event.annotations.Global;
/**
* An event with functionality directly linked to a {@link ConfigPack}.
* <p>
* PackEvents are only invoked when the pack specifies the com.dfsek.terra.addon in its
* {@code com.dfsek.terra.addon} key (or when the listener is annotated {@link Global}).
* PackEvents are only invoked when the pack specifies the addon in its
* {@code addon} key (or when the listener is global).
*/
@SuppressWarnings("InterfaceMayBeAnnotatedFunctional")
public interface PackEvent extends Event {