Organize a lot of utils
This commit is contained in:
@@ -2020,4 +2020,23 @@ function createGroundPlant(itemId) {
|
||||
groundPlantCache.push(itemId);
|
||||
groundItemCache.push(itemId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function getItemTypeFromParams(params) {
|
||||
if(isNaN(params)) {
|
||||
for(let i in getServerData().itemTypes) {
|
||||
if(toLowerCase(getServerData().itemTypes[i].name).indexOf(toLowerCase(params)) != -1) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(typeof getServerData().itemTypes[params] != "undefined") {
|
||||
return toInteger(params);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user