mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 03:16:41 +00:00
Moved containsFuzzy from EditSession to BaseBlock.
This commit is contained in:
@ -19,7 +19,6 @@
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Deque;
|
||||
import java.util.HashMap;
|
||||
@ -542,18 +541,6 @@ public class EditSession {
|
||||
return countBlocks(region, passOn);
|
||||
}
|
||||
|
||||
private static boolean containsFuzzy(Collection<BaseBlock> collection, Object o) {
|
||||
// allow -1 data in the searchBlocks to match any type
|
||||
for (BaseBlock b : collection) {
|
||||
if (o instanceof BaseBlock) {
|
||||
if (b.equalsFuzzy((BaseBlock) o)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the number of blocks of a list of types in a region.
|
||||
*
|
||||
@ -582,7 +569,7 @@ public class EditSession {
|
||||
Vector pt = new Vector(x, y, z);
|
||||
|
||||
BaseBlock compare = new BaseBlock(getBlockType(pt), getBlockData(pt));
|
||||
if (containsFuzzy(searchBlocks, compare)) {
|
||||
if (BaseBlock.containsFuzzy(searchBlocks, compare)) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
@ -591,7 +578,7 @@ public class EditSession {
|
||||
} else {
|
||||
for (Vector pt : region) {
|
||||
BaseBlock compare = new BaseBlock(getBlockType(pt), getBlockData(pt));
|
||||
if (containsFuzzy(searchBlocks, compare)) {
|
||||
if (BaseBlock.containsFuzzy(searchBlocks, compare)) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user