Advertisement
Guest User

Event Handler

a guest
Apr 18th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. public class EventHandling
  2. {
  3.  
  4.  
  5. public enum EventPriority
  6. { //I borrowed this from Jabelar's tutorials might not need this, but I don't know yet.
  7. /*Priority of event listeners, listeners will be sorted with respect to this priority level.
  8. *
  9. * Note:
  10. * Due to using a ArrayList in the ListenerList,
  11. * these need to stay in a contiguous index starting at 0. {Default ordinal}
  12. */
  13. HIGHEST, //First to execute
  14. HIGH,
  15. NORMAL,
  16. LOW,
  17. LOWEST //Last to execute
  18. }
  19.  
  20. @SubscribeEvent
  21. public void input(InputEvent event)
  22. /* Not sure if I'm going to need anything inside this, it seemed like it would be useful
  23. *
  24. */
  25. {
  26.  
  27. }
  28.  
  29.  
  30. @SubscribeEvent
  31. public void mouse(MouseInputEvent event)
  32. /* when something is clicked I presume, this is going to be a bit complex
  33. *
  34. */
  35. {
  36.  
  37. }
  38.  
  39.  
  40. @SubscribeEvent
  41. public void onKey(KeyInputEvent event)
  42. /* this will have some effect when a player pushes a key, perhaps not needed?
  43. *
  44. */
  45.  
  46. {
  47. Minecraft mc = Minecraft.getMinecraft();
  48.  
  49. if(SkillCraftKeyBinding.SkillGui.isPressed())
  50. {
  51. mc.displayGuiScreen(new Gui1());
  52. }
  53.  
  54. }
  55.  
  56.  
  57.  
  58.  
  59. @SubscribeEvent
  60. public void EntityConstruction(EntityEvent.EntityConstructing event)
  61. /* this is going to have an effect, for swaping dimensions so everything stays syncronized
  62. * or..logging into the game world I'm and idiot
  63. *
  64. */
  65. {
  66. if(event.entity instanceof EntityPlayer && ExtendedPlayer.get((EntityPlayer) event.entity) == null)
  67. ExtendedPlayer.register((EntityPlayer)event.entity);
  68. }
  69.  
  70. @SubscribeEvent
  71. public void MobDeath(LivingDeathEvent event)
  72. /*this is going to have something happen when a player, or Mob dies, like..drop held item
  73. *
  74. */
  75. {
  76.  
  77. }
  78.  
  79. @SubscribeEvent
  80. public void PlayerJoins(EntityJoinWorldEvent event)
  81. /* this is going to do something when a player Joins the world, IE give a book?
  82. *
  83. */
  84. {
  85.  
  86. }
  87.  
  88.  
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement