@Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { World world = (World) clicked.getExtent(); BlockVector3 origin = clicked.toVector().toBlockPoint(); BlockType initialType = world.getBlock(origin).getBlockType(); if (initialType.getMaterial().isAir()) { return true; } if (initialType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; } try (EditSession editSession = session.createEditSession(player)) { try { recurse(editSession, origin, origin, range, initialType, new HashSet<>()); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { session.remember(editSession); } } return true; }
@Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { World world = (World) clicked.getExtent(); BlockVector3 origin = clicked.toVector().toBlockPoint(); BlockType initialType = world.getBlock(origin).getBlockType(); if (initialType.getMaterial().isAir()) { return true; } if (initialType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; } try (EditSession editSession = session.createEditSession(player)) { editSession.getSurvivalExtent().setToolUse(config.superPickaxeManyDrop); try { recurse(server, editSession, world, clicked.toVector().toBlockPoint(), clicked.toVector().toBlockPoint(), range, initialType, new HashSet<>()); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } finally { session.remember(editSession); } } return true; }
@Override public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) { World world = (World) clicked.getExtent(); BlockVector3 blockPoint = clicked.toVector().toBlockPoint(); final BlockType blockType = world.getBlock(blockPoint).getBlockType(); if (blockType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true; } try (EditSession editSession = session.createEditSession(player)) { editSession.getSurvivalExtent().setToolUse(config.superPickaxeDrop); editSession.setBlock(blockPoint, BlockTypes.AIR.getDefaultState()); } catch (MaxChangedBlocksException e) { player.printError("Max blocks change limit reached."); } world.playEffect(clicked.toVector(), 2001, blockType.getLegacyId()); return true; }
if (initialType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) { return true;