Advertisement
Guest User

DDD

a guest
Jan 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. @EventHandler
  2. public void onRemoveWire(PlayerInteractEvent e) {
  3. if (!e.getAction().equals(Action.LEFT_CLICK_BLOCK) || !e.getAction().equals(Action.RIGHT_CLICK_BLOCK))return;
  4. if (e.getPlayer().getGameMode() == GameMode.CREATIVE)return;
  5. if (e.getPlayer().getInventory().getItemInHand().getType().equals(Material.SHEARS)) {
  6. if (e.getClickedBlock().getType() == Material.WEB) {
  7. Location loc = e.getClickedBlock().getLocation();
  8. if (!canBreak.contains(loc))return;
  9. loc.getBlock().setType(Material.AIR);
  10. e.setCancelled(true);
  11. while (loc.getY() < 256) {
  12. loc.setY(loc.getY() + 1);
  13. if (loc.getBlock().getType().equals(Material.WEB)) {
  14. if (canBreak.contains(loc)) {
  15. loc.getBlock().setType(Material.AIR);
  16. }else{
  17. break;
  18. }
  19. }else{
  20. break;
  21. }
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement