Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in or
create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision |
Your text |
| Line 99: |
Line 99: |
|
| |
|
| return p._main(args) | | return p._main(args) |
| end
| |
|
| |
| local function getDataByName(dataType, dataTable, name)
| |
| local data = dataTable[name]
| |
|
| |
| if data then
| |
| return data
| |
| end
| |
|
| |
| local normalizedType = tostring(dataType or ''):lower()
| |
| if normalizedType == 'neighbor' or normalizedType == 'neighbors' then
| |
| return nil
| |
| end
| |
|
| |
| for quality, names in pairs(dataTable) do
| |
| if type(names) == 'table' then
| |
| for _, itemName in ipairs(names) do
| |
| if itemName == name then
| |
| return {
| |
| quality = quality
| |
| }
| |
| end
| |
| end
| |
| end
| |
| end
| |
|
| |
| return nil
| |
| end | | end |
|
| |
|
| Line 137: |
Line 110: |
|
| |
|
| if lib.isEmpty(requestedType) or dataType == requestedType then | | if lib.isEmpty(requestedType) or dataType == requestedType then |
| local data = getDataByName(dataType, dataTable, name) | | local data = dataTable[name] |
|
| |
|
| if data then | | if data then |