Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onRemoveWire(PlayerInteractEvent e) {
- if (!e.getAction().equals(Action.LEFT_CLICK_BLOCK) || !e.getAction().equals(Action.RIGHT_CLICK_BLOCK))return;
- if (e.getPlayer().getGameMode() == GameMode.CREATIVE)return;
- if (e.getPlayer().getInventory().getItemInHand().getType().equals(Material.SHEARS)) {
- if (e.getClickedBlock().getType() == Material.WEB) {
- Location loc = e.getClickedBlock().getLocation();
- if (!canBreak.contains(loc))return;
- loc.getBlock().setType(Material.AIR);
- e.setCancelled(true);
- while (loc.getY() < 256) {
- loc.setY(loc.getY() + 1);
- if (loc.getBlock().getType().equals(Material.WEB)) {
- if (canBreak.contains(loc)) {
- loc.getBlock().setType(Material.AIR);
- }else{
- break;
- }
- }else{
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement