Create Plant class

This commit is contained in:
Van
2025-12-29 19:51:28 +03:00
parent 96b51caaaf
commit 475b199ddb
6 changed files with 55 additions and 23 deletions

View File

@@ -1,23 +1,13 @@
core.register_node(":plants:plants", {
description = 'Plant',
drawtype = "plantlike",
tiles = { "test_plant.png" },
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "meshoptions",
place_param2 = 3,
waving = 1,
walkable = false,
buildable_to = true,
groups = {dig_immediate = 2},
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
local modInfo = Mod.getInfo('smc__core__plant')
---@type Plant
local Plant = modInfo.require('Plant')
Plant:new({
settings = {
name = 'plants:plants',
description = 'Plant',
tiles = { "test_plant.png" },
place_param2 = 3,
},
on_construct = function(pos)
local node = core.get_node(pos)
node.param2 = 3
end,
})
})