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:
Bukkit/Spigot
2012-01-19 08:13:49 +01:00
parent 0c50b9eeb1
commit 84372f7cd5
5 changed files with 16 additions and 7 deletions

View File

@@ -1,7 +1,5 @@
package org.bukkit.event;
import org.bukkit.event.Listener;
/**
* Handles all custom events
*/

View File

@@ -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;
}