lordboosack

Thanks for being patient with me. :|

Nov 16th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. package com.chrisddie.league;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.plugin.java.JavaPlugin;
  6. import org.bukkit.Material;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.event.EventHandler;
  9. import org.bukkit.event.Listener;
  10. import org.bukkit.event.block.Action;
  11. import org.bukkit.event.player.PlayerInteractEvent;
  12. import org.bukkit.plugin.PluginDescriptionFile;
  13.  
  14. public class league extends JavaPlugin implements Listener {
  15. private final ListenerClass listener = new ListenerClass(this);
  16. public final Logger logger = Logger.getLogger("Minecraft");
  17. public static league plugin;
  18.  
  19. @Override
  20. public void onEnable() {
  21. PluginDescriptionFile pdfFile = this.getDescription();
  22. this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + " Has been enabled.");
  23. this.getServer().getPluginManager().registerEvents(this.listener, this);
  24. }
  25.  
  26. @EventHandler
  27. public void onInteract(PlayerInteractEvent e) {
  28. Player p = e.getPlayer();
  29. if(e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK) || e.getAction().equals(Action.LEFT_CLICK_AIR) || e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
  30. if(p.getItemInHand().getType().equals(Material.ANVIL)) {
  31. e.setCancelled(true);
  32. p.sendMessage("Coding is so frustrating. :(");
  33.  
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment