mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-30 11:53:52 -07:00
Use the type of the eventhandler method's parameter as type rather than specificing it. Thanks zml2008.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package org.bukkit.event;
|
||||
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* Handles all custom events
|
||||
*/
|
||||
|
@@ -1,15 +1,22 @@
|
||||
package org.bukkit.event;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* An annotation to mark methods as being event handler methods
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface EventHandler {
|
||||
|
||||
Class<? extends Event> event();
|
||||
/**
|
||||
* This field is now fetched from the event handler method's parameter
|
||||
* @return
|
||||
*/
|
||||
@Deprecated Class<? extends Event> event() default Event.class;
|
||||
|
||||
EventPriority priority() default EventPriority.NORMAL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user