daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // =========== PLACAS COLOCADAS ============
  2.    
  3.     @EventHandler
  4.     public void placadesopa(SignChangeEvent e) {
  5.         if (e.getLine(0).equalsIgnoreCase("[kitp4]")) {
  6.             e.setLine(0, "§0§l▃▃▃▃▃▃▃▃");
  7.             e.setLine(1, "§9§lOlimpoSky");
  8.             e.setLine(2, "§4§lP4 §1§lFREE");
  9.             e.setLine(3, "§0§l▃▃▃▃▃▃▃▃");
  10.         }
  11.     }
  12.    
  13.    
  14.     public boolean hasAvaliableSlot(Player player){
  15.         Inventory inv = player.getInventory();
  16.         for(ItemStack it : player.getInventory().getContents())
  17.         {
  18.             if(it != null) return false;
  19.         }
  20.         return true;
  21.     }
  22.  
  23.     @EventHandler
  24.     public void signInteract(PlayerInteractEvent e) {
  25.         Player p = e.getPlayer();
  26.         Block block = e.getClickedBlock();
  27.         if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
  28.             if (block.getType() == Material.SIGN || block.getType() == Material.SIGN_POST
  29.                     || block.getType() == Material.WALL_SIGN) {
  30.                 Sign sign = (Sign) e.getClickedBlock().getState();
  31.                
  32.                 if(!hasAvaliableSlot(p)){
  33.                     p.sendMessage("§4➜ §cLimpe seu inventario para poder pegar o seu §6P4 ....");
  34.                     return;
  35.                     }
  36.                
  37.                 if (sign.getLine(0).contains("▃▃▃▃▃▃▃▃")) {
  38.                     e.getPlayer().performCommand("kit p4free");
  39.                 }
  40.             }
  41.         }
  42.     }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top