Compare commits

...

4 Commits

Author SHA1 Message Date
Auxilor
ba315ced3c Updated to 6.35.2 2022-04-29 22:45:42 +01:00
Auxilor
f2e65174f9 Reverted to old block vein code 2022-04-29 22:45:02 +01:00
Auxilor
d5584e863b Updated to 6.35.1 2022-04-27 18:52:39 +01:00
Auxilor
d9c0e8e763 Fixed overload resolution ambiguity 2022-04-27 18:52:27 +01:00
3 changed files with 11 additions and 18 deletions

View File

@@ -23,26 +23,25 @@ public final class BlockUtils {
*/
private static final int MAX_BLOCKS = 2500;
private static Set<Block> getNearbyBlocks(@NotNull final Block origin,
private static Set<Block> getNearbyBlocks(@NotNull final Block start,
@NotNull final List<Material> allowedMaterials,
@NotNull final Set<Block> blocks,
final int limit) {
for (BlockFace face : BlockFace.values()) {
Block block = origin.getRelative(face);
if (!allowedMaterials.contains(block.getType())) {
continue;
}
Block block = start.getRelative(face);
if (blocks.contains(block)) {
continue;
}
if (blocks.size() >= limit || blocks.size() > MAX_BLOCKS) {
return blocks;
}
if (allowedMaterials.contains(block.getType())) {
blocks.add(block);
blocks.addAll(getNearbyBlocks(block, allowedMaterials, blocks, limit));
if (blocks.size() > limit || blocks.size() > MAX_BLOCKS) {
return blocks;
}
blocks.addAll(getNearbyBlocks(block, allowedMaterials, blocks, limit));
}
}
return blocks;

View File

@@ -32,12 +32,6 @@ fun CommandSender.asAudience(): Audience =
fun Player.runExempted(action: () -> Unit) =
PlayerUtils.runExempted(this, action)
/**
* @see PlayerUtils.runExempted
*/
fun Player.runExempted(action: (Player) -> Unit) =
PlayerUtils.runExempted(this, action)
/**
* @see PlayerUtils.tryAsPlayer
*/

View File

@@ -1,3 +1,3 @@
version = 6.35.0
version = 6.35.2
plugin-name = eco
kotlin.code.style = official