Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +01:00
Lookup by id if the string passed to Block/ItemType.lookup() is an integer
Dieser Commit ist enthalten in:
Ursprung
0bea058328
Commit
2f2d3f8045
@ -234,7 +234,11 @@ public enum BlockType {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static BlockType lookup(String name, boolean fuzzy) {
|
public static BlockType lookup(String name, boolean fuzzy) {
|
||||||
return StringUtil.lookup(lookup, name, fuzzy);
|
try {
|
||||||
|
return fromID(Integer.parseInt(name));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return StringUtil.lookup(lookup, name, fuzzy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -412,7 +412,11 @@ public enum ItemType {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static ItemType lookup(String name, boolean fuzzy) {
|
public static ItemType lookup(String name, boolean fuzzy) {
|
||||||
return StringUtil.lookup(lookup, name, fuzzy);
|
try {
|
||||||
|
return fromID(Integer.parseInt(name));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return StringUtil.lookup(lookup, name, fuzzy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren