Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package MAIN;
- import me.mrCookieSlime.QuickSell.Shop;
- import org.bukkit.Material;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.Action;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.plugin.java.JavaPlugin;
- public class MAIN extends JavaPlugin implements Listener {
- public void onEnable() {
- getServer().getPluginManager().registerEvents(this, this);
- }
- public void onDisable() {
- }
- @EventHandler
- public void onPlayerInteract(PlayerInteractEvent e) {
- Player player = e.getPlayer();
- Shop shop = Shop.getHighestShop(player);
- ItemStack pick = new ItemStack(Material.DIAMOND_PICKAXE);
- if(shop == null) {
- player.sendMessage("§cShop not found!");
- } else if(e.getAction() == Action.RIGHT_CLICK_AIR && ((e.getAction() == Action.RIGHT_CLICK_BLOCK) && (e.getPlayer().getItemInHand() == pick) && shop != null)) {
- shop.sellall(player, "");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement