mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-01-10 17:57:37 +00:00
Lookup by id if the string passed to Block/ItemType.lookup() is an integer
This commit is contained in:
parent
0bea058328
commit
2f2d3f8045
@ -234,8 +234,12 @@ public enum BlockType {
|
||||
* @return
|
||||
*/
|
||||
public static BlockType lookup(String name, boolean fuzzy) {
|
||||
try {
|
||||
return fromID(Integer.parseInt(name));
|
||||
} catch (NumberFormatException e) {
|
||||
return StringUtil.lookup(lookup, name, fuzzy);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get block numeric ID.
|
||||
|
@ -412,8 +412,12 @@ public enum ItemType {
|
||||
* @return
|
||||
*/
|
||||
public static ItemType lookup(String name, boolean fuzzy) {
|
||||
try {
|
||||
return fromID(Integer.parseInt(name));
|
||||
} catch (NumberFormatException e) {
|
||||
return StringUtil.lookup(lookup, name, fuzzy);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get item numeric ID.
|
||||
|
Loading…
Reference in New Issue
Block a user