T0X1C0801

Code

Mar 21st, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. package me.T0X1C.picksell;
  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. getServer().getLogger().info("§3§lOP §b§lPrison §8- §7Picksell Enabled!");
  19. }
  20.  
  21. public void onDisable() {
  22.  
  23. }
  24.  
  25. @EventHandler
  26. public void PlayerInteract(PlayerInteractEvent e) {
  27. Player player = e.getPlayer();
  28. Shop shop = Shop.getHighestShop(player);
  29. ItemStack pick = new ItemStack(Material.DIAMOND_PICKAXE);
  30. if(shop == null) {
  31. player.sendMessage("§cShop not found!");
  32. return;
  33. } else if(e.getAction() == Action.RIGHT_CLICK_AIR && ((e.getAction() == Action.RIGHT_CLICK_BLOCK) && (e.getPlayer().getItemInHand() == pick))) {
  34. shop.sellall(player, "");
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment