Advertisement
T0X1C0801

Untitled

Mar 22nd, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. package MAIN;
  2.  
  3. import me.mrCookieSlime.QuickSell.Shop;
  4.  
  5. import org.bukkit.Material;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.event.EventHandler;
  8. import org.bukkit.event.Listener;
  9. import org.bukkit.event.block.Action;
  10. import org.bukkit.event.player.PlayerInteractEvent;
  11. import org.bukkit.inventory.ItemStack;
  12. import org.bukkit.plugin.java.JavaPlugin;
  13.  
  14. public class MAIN extends JavaPlugin implements Listener {
  15.  
  16. public void onEnable() {
  17. getServer().getPluginManager().registerEvents(this, this);
  18. }
  19.  
  20. public void onDisable() {
  21.  
  22. }
  23.  
  24. @EventHandler
  25. public void onPlayerInteract(PlayerInteractEvent e) {
  26. Player player = e.getPlayer();
  27. Shop shop = Shop.getHighestShop(player);
  28. ItemStack pick = new ItemStack(Material.DIAMOND_PICKAXE);
  29. if(shop == null) {
  30. player.sendMessage("§cShop not found!");
  31. } else if(e.getAction() == Action.RIGHT_CLICK_AIR && ((e.getAction() == Action.RIGHT_CLICK_BLOCK) && (e.getPlayer().getItemInHand() == pick) && shop != null)) {
  32. shop.sellall(player, "");
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement