mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 18:17:38 +01:00
Added EventHandlerMethod wrapper for Listener and Method
This commit is contained in:
parent
0f06b2c4e0
commit
53a6bb1dee
@ -0,0 +1,25 @@
|
||||
package net.md_5.bungee.event;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author daboross
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public class EventHandlerMethod
|
||||
{
|
||||
|
||||
@Getter
|
||||
private final Object listener;
|
||||
@Getter
|
||||
private final Method method;
|
||||
|
||||
public void invoke(Object event) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
|
||||
{
|
||||
method.invoke( listener, event );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user