Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 11:00:05 +01:00
Revert a breaking change to fuzzy item/block lookup.
Dieser Commit ist enthalten in:
Ursprung
5ed9239e14
Commit
b0a52a4cf7
@ -289,7 +289,7 @@ public final class StringUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
int minDist = Integer.MAX_VALUE;
|
||||
int minDist = -1;
|
||||
|
||||
for (Map.Entry<String, T> entry : lookup.entrySet()) {
|
||||
final String key = entry.getKey();
|
||||
@ -299,16 +299,12 @@ public final class StringUtil {
|
||||
|
||||
int dist = getLevenshteinDistance(key, testName);
|
||||
|
||||
if (dist >= minDist) {
|
||||
if ((dist < minDist || minDist == -1) && dist < 2) {
|
||||
minDist = dist;
|
||||
type = entry.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
if (minDist > 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren