Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement