From 31b4ee2c3261493baa9bce6c9e06751d9991c831 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 29 Mar 2023 15:45:01 +0700 Subject: [PATCH] root.itemTags --- src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt index ba6dbe36..59f74b02 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/Starbound.kt @@ -453,6 +453,12 @@ class Starbound : ISBFileLocator { 1 } + state.setTableFunction("itemTags", this) { args -> + val name = args.getString() + args.lua.pushStrings(items[name]?.value?.itemTags ?: throw NoSuchElementException("No such item $name")) + 1 + } + state.pop() state.load(polyfill, "@starbound.jar!/scripts/polyfill.lua")