Organize a lot of utils

This commit is contained in:
Vortrex
2022-01-09 17:19:53 -06:00
parent 2684ffae7d
commit 5dfe47a3e8
16 changed files with 905 additions and 1069 deletions

View File

@@ -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;
}
// ===========================================================================