Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int minDist = Integer.MAX_VALUE;
|
int minDist = -1;
|
||||||
|
|
||||||
for (Map.Entry<String, T> entry : lookup.entrySet()) {
|
for (Map.Entry<String, T> entry : lookup.entrySet()) {
|
||||||
final String key = entry.getKey();
|
final String key = entry.getKey();
|
||||||
@ -299,16 +299,12 @@ public final class StringUtil {
|
|||||||
|
|
||||||
int dist = getLevenshteinDistance(key, testName);
|
int dist = getLevenshteinDistance(key, testName);
|
||||||
|
|
||||||
if (dist >= minDist) {
|
if ((dist < minDist || minDist == -1) && dist < 2) {
|
||||||
minDist = dist;
|
minDist = dist;
|
||||||
type = entry.getValue();
|
type = entry.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minDist > 1) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren