Guest User

Untitled

a guest
May 1st, 2014
264
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package noah.plugins.maxymenu;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.Material;
  5. import org.bukkit.event.EventHandler;
  6. import org.bukkit.event.Listener;
  7. import org.bukkit.event.block.Action;
  8. import org.bukkit.event.player.PlayerInteractEvent;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11. public class MaxyMenu extends JavaPlugin implements Listener {
  12.  
  13. private Menu menu;
  14. private ShopMenuInv shopmenuinv;
  15.  
  16. public void onEnable() {
  17. menu = new Menu(this);
  18. shopmenuinv = new ShopMenuInv(this);
  19.  
  20. Bukkit.getServer().getPluginManager().registerEvents(this, this);
  21.  
  22. }
  23.  
  24. @EventHandler
  25. public void onPlayerInteract(PlayerInteractEvent e) {
  26. if (e.getPlayer().getItemInHand().getType() == Material.COAL) {
  27. if (e.getPlayer().hasPermission("MaxyMenu.gmmenu")) {
  28. if (!(e.getAction() == Action.RIGHT_CLICK_AIR)) return;
  29. menu.show(e.getPlayer());
  30. }
  31. }
  32. }
  33.  
  34. @EventHandler
  35. public void onPlayerInteract1(PlayerInteractEvent e) {
  36. if (e.getPlayer().getItemInHand().getType() == Material.APPLE) {
  37. if (e.getPlayer().hasPermission("MaxyMenu.buyitem")) {
  38. if (!(e.getAction() == Action.RIGHT_CLICK_AIR)) return;
  39. shopmenuinv.show(e.getPlayer());
  40. }
  41. }
  42. }
  43.  
  44. }
RAW Paste Data