Update from 22.06.2025: add MapGen mod outline, fix some require() issues
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
local Item = Mod:new()
|
||||
|
||||
Item.Class = Item.require('Item')
|
||||
|
||||
Api.addModToGlobalSpace(Item, 'Core.Item')
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
name = core__item
|
||||
depends = api__system
|
||||
|
||||
41
mods/CORE/Item/src/Item.lua
Normal file
41
mods/CORE/Item/src/Item.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
local Item = {}
|
||||
|
||||
--- @class ItemDefinition
|
||||
--- @field settings table
|
||||
local ItemDefinition = {
|
||||
settings = {
|
||||
name = '',
|
||||
title = '',
|
||||
description = '',
|
||||
visual = '', -- '3d' | 'flat'
|
||||
},
|
||||
callbacks = {
|
||||
...
|
||||
},
|
||||
}
|
||||
|
||||
--- @param itemDef ItemDefinition
|
||||
local function itemDefToLuantiDef(itemDef)
|
||||
local s = itemDef.settings
|
||||
local c = itemDef.callbacks
|
||||
local luantiDef = table.copy(c)
|
||||
|
||||
return luantiDef
|
||||
end
|
||||
|
||||
local function register3dItem(luantiDef)
|
||||
local ld = luantiDef
|
||||
core.register_node(ld.name, {
|
||||
description = ld.description
|
||||
})
|
||||
end
|
||||
|
||||
local function registerFlatItem(luantiDef)
|
||||
|
||||
end
|
||||
|
||||
function Item:new(itemDef)
|
||||
local item = {}
|
||||
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user