Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. @EventHandler
  2. public void onEvent(PlayerMoveEvent event) {
  3. for(Character character : characterList){
  4. Class c = character.getClass();
  5. for(Method method : c.getDeclaredMethods()){
  6. if(method.isAnnotationPresent(EventDistributor.class)){
  7. EnumEvent type = method.getAnnotation(EventDistributor.class).event();
  8. if(type == EnumEvent.MOVE) {
  9. try {
  10. method.invoke(event);
  11. } catch (IllegalAccessException e) {
  12. e.printStackTrace();
  13. } catch (InvocationTargetException e) {
  14. e.printStackTrace();
  15. }
  16. }
  17. }else{
  18. String message = Overwatch.CHAT_UTILS.getStringWithPrefix(""+characterList.size());
  19. Bukkit.broadcastMessage(message);
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement