Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onEvent(PlayerMoveEvent event) {
- for(Character character : characterList){
- Class c = character.getClass();
- for(Method method : c.getDeclaredMethods()){
- if(method.isAnnotationPresent(EventDistributor.class)){
- EnumEvent type = method.getAnnotation(EventDistributor.class).event();
- if(type == EnumEvent.MOVE) {
- try {
- method.invoke(event);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- }
- }
- }else{
- String message = Overwatch.CHAT_UTILS.getStringWithPrefix(""+characterList.size());
- Bukkit.broadcastMessage(message);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement