diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt index 59f74b02..b1bd2003 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt @@ -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")