Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler(priority=EventPriority.HIGHEST)
- public void onFarmerPlace(BlockPlaceEvent e)
- {
- Player p = e.getPlayer();
- Block b = e.getBlock();
- ItemStack is = e.getItemInHand();
- if (e.isCancelled()) {
- return;
- }
- if ((is == null) || (is.getItemMeta() == null) || (is.getItemMeta().getDisplayName() == null)) {
- return;
- }
- if (is.isSimilar(BoyManager.getObs().build()))
- {
- BoyUtil.farm(b.getLocation(), Material.OBSIDIAN);
- ChatUtil.sendMessage(p, Config.BOYFARMERPLACEMESSAGE.replaceAll("&", "§"));
- }
- else if (is.isSimilar(BoyManager.getSand().build()))
- {
- BoyUtil.farm(b.getLocation(), Material.SAND);
- ChatUtil.sendMessage(p, Config.SANDFARMERPLACEMESSAGE.replaceAll("&", "§"));
- }
- else if (is.isSimilar(BoyManager.getAir().build()))
- {
- BoyUtil.farmer1(b.getLocation(), Material.AIR);
- ChatUtil.sendMessage(p, Config.KOPACZFOSYPLACEMESSAGE.replaceAll("&", "§"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement