root.itemHasTag

This commit is contained in:
DBotThePony 2023-03-29 15:47:13 +07:00
parent 31b4ee2c32
commit eaa0ce58bf
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -459,6 +459,13 @@ class Starbound : ISBFileLocator {
1
}
state.setTableFunction("itemHasTag", this) { args ->
val name = args.getString()
val tag = args.getString()
args.lua.push((items[name]?.value?.itemTags ?: throw NoSuchElementException("No such item $name")).contains(tag))
1
}
state.pop()
state.load(polyfill, "@starbound.jar!/scripts/polyfill.lua")