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,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