SHARE
TWEET

Untitled

a guest May 23rd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   @EventHandler(priority=EventPriority.HIGHEST)
  2.   public void onFarmerPlace(BlockPlaceEvent e)
  3.   {
  4.     Player p = e.getPlayer();
  5.     Block b = e.getBlock();
  6.     ItemStack is = e.getItemInHand();
  7.     if (e.isCancelled()) {
  8.       return;
  9.     }
  10.     if ((is == null) || (is.getItemMeta() == null) || (is.getItemMeta().getDisplayName() == null)) {
  11.       return;
  12.     }
  13.     if (is.isSimilar(BoyManager.getObs().build()))
  14.     {
  15.       BoyUtil.farm(b.getLocation(), Material.OBSIDIAN);
  16.       ChatUtil.sendMessage(p, Config.BOYFARMERPLACEMESSAGE.replaceAll("&", "§"));
  17.     }
  18.     else if (is.isSimilar(BoyManager.getSand().build()))
  19.     {
  20.       BoyUtil.farm(b.getLocation(), Material.SAND);
  21.       ChatUtil.sendMessage(p, Config.SANDFARMERPLACEMESSAGE.replaceAll("&", "§"));
  22.     }
  23.     else if (is.isSimilar(BoyManager.getAir().build()))
  24.     {
  25.       BoyUtil.farmer1(b.getLocation(), Material.AIR);
  26.       ChatUtil.sendMessage(p, Config.KOPACZFOSYPLACEMESSAGE.replaceAll("&", "§"));
  27.     }
  28.   }
  29. }
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