storages: create storages mod, move case wood -> storages, create draft chest

This commit is contained in:
Van
2026-03-05 19:47:27 +03:00
parent 2eede05436
commit 17413df9c4
7 changed files with 245 additions and 43 deletions

View File

@@ -0,0 +1,99 @@
local Node, TileSheet = Smc.requireNode(), Smc.requireTileSheet()
local defaultStorage = Node:getExtended({
settings = {
name = '',
groups = {
dig_immediate = 2,
storage = 1
},
paramtype = 'light',
paramtype2 = 'facedir',
}
})
local storageFactory = defaultStorage:getFactory()
---@type TileSheet
local caseTileSheet = TileSheet:new('cases_sheet.png', 16, 16)
local function getCaseTiles(x, y)
return {
caseTileSheet:t(x, y),
caseTileSheet:t(x, y),
caseTileSheet:t(x, y+1),
}
end
local t = getCaseTiles
storageFactory:registerItems({
---@type Node.NodeDefinition
{
settings = {
name = 'case_closed',
_title = 'Case',
--description = '',
tiles = t(0,0)
},
},
---@type Node.NodeDefinition
{
settings = {
name = 'case_open',
_title = 'Case',
--description = '',
tiles = t(1,0);
drawtype = 'nodebox';
node_box = {
type = 'fixed',
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5 - 1/16*2, 0.5},
}
}
},
},
---@type Node.NodeDefinition
{
settings = {
drawtype = 'mesh',
name = 'chest_close',
tiles = {'storage_chest.png'},
mesh = 'storage_chest_close.obj',
node_box = {
type = 'fixed',
fixed = {
{-7/16, -0.5, -7/16, 23/16, 6/16, 7/16},
}
},
selection_box = {
type = 'fixed',
fixed = {
{-7/16, -0.5, -7/16, 23/16, 6/16, 7/16},
}
}
},
},
---@type Node.NodeDefinition
{
settings = {
drawtype = 'mesh',
name = 'chest_open',
tiles = {'storage_chest.png'},
mesh = 'storage_chest_open.obj',
node_box = {
type = 'fixed',
fixed = {
{-7/16, -0.5, -7/16, 23/16, 6/16, 7/16},
}
},
selection_box = {
type = 'fixed',
fixed = {
{-7/16, -0.5, -7/16, 23/16, 6/16, 7/16},
}
}
},
},
})

View File

@@ -0,0 +1,2 @@
name = smc__game__items__storages
depends = smc__core__node, smc__core__tilesheet

View File

@@ -0,0 +1,49 @@
# Made in Blockbench 4.12.5
mtllib storage_chest_close.mtl
o chest_close
v 0.4375 0.375 0.4375
v 0.4375 0.375 -0.4375
v 0.4375 -0.5 0.4375
v 0.4375 -0.5 -0.4375
v -1.4375 0.375 -0.4375
v -1.4375 0.375 0.4375
v -1.4375 -0.5 -0.4375
v -1.4375 -0.5 0.4375
vt 0.109375 0.890625
vt 0.34375 0.890625
vt 0.34375 0.78125
vt 0.109375 0.78125
vt 0 0.890625
vt 0.109375 0.890625
vt 0.109375 0.78125
vt 0 0.78125
vt 0.453125 0.890625
vt 0.6875 0.890625
vt 0.6875 0.78125
vt 0.453125 0.78125
vt 0.34375 0.890625
vt 0.453125 0.890625
vt 0.453125 0.78125
vt 0.34375 0.78125
vt 0.34375 0.890625
vt 0.109375 0.890625
vt 0.109375 1
vt 0.34375 1
vt 0.578125 1
vt 0.34375 1
vt 0.34375 0.890625
vt 0.578125 0.890625
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_79b8a0d4-4f5c-1950-bda6-ec259f602f6d
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6

View File

@@ -0,0 +1,95 @@
# Made in Blockbench 4.12.5
mtllib storage_chest_open.mtl
o сундук
v 0.4375 0.25 0.4375
v 0.4375 0.25 -0.4375
v 0.4375 -0.5 0.4375
v 0.4375 -0.5 -0.4375
v -1.4375 0.25 -0.4375
v -1.4375 0.25 0.4375
v -1.4375 -0.5 -0.4375
v -1.4375 -0.5 0.4375
vt 0.109375 0.875
vt 0.34375 0.875
vt 0.34375 0.78125
vt 0.109375 0.78125
vt 0 0.875
vt 0.109375 0.875
vt 0.109375 0.78125
vt 0 0.78125
vt 0.453125 0.875
vt 0.6875 0.875
vt 0.6875 0.78125
vt 0.453125 0.78125
vt 0.34375 0.875
vt 0.453125 0.875
vt 0.453125 0.78125
vt 0.34375 0.78125
vt 0.8125 0.890625
vt 0.578125 0.890625
vt 0.578125 1
vt 0.8125 1
vt 0.578125 1
vt 0.34375 1
vt 0.34375 0.890625
vt 0.578125 0.890625
vn 0 0 -1
vn 1 0 0
vn 0 0 1
vn -1 0 0
vn 0 1 0
vn 0 -1 0
usemtl m_79b8a0d4-4f5c-1950-bda6-ec259f602f6d
f 4/4/1 7/3/1 5/2/1 2/1/1
f 3/8/2 4/7/2 2/6/2 1/5/2
f 8/12/3 3/11/3 1/10/3 6/9/3
f 7/16/4 8/15/4 6/14/4 5/13/4
f 6/20/5 1/19/5 2/18/5 5/17/5
f 7/24/6 4/23/6 3/22/6 8/21/6
o крышка
v 0.4375 0.33838834764831843 0.46338834764831843
v 0.4375 0.9571067811865475 -0.15533008588991049
v 0.4375 0.25 0.375
v 0.4375 0.8687184335382291 -0.24371843353822897
v -1.4375 0.9571067811865475 -0.15533008588991049
v -1.4375 0.33838834764831843 0.46338834764831843
v -1.4375 0.8687184335382291 -0.24371843353822897
v -1.4375 0.25 0.375
vt 0.109375 0.890625
vt 0.34375 0.890625
vt 0.34375 0.875
vt 0.109375 0.875
vt 0 0.890625
vt 0.109375 0.890625
vt 0.109375 0.875
vt 0 0.875
vt 0.453125 0.890625
vt 0.6875 0.890625
vt 0.6875 0.875
vt 0.453125 0.875
vt 0.34375 0.890625
vt 0.453125 0.890625
vt 0.453125 0.875
vt 0.34375 0.875
vt 0.34375 0.890625
vt 0.109375 0.890625
vt 0.109375 1
vt 0.34375 1
vt 0.578125 1
vt 0.34375 1
vt 0.34375 0.890625
vt 0.578125 0.890625
vn 0 0.7071067811865476 -0.7071067811865475
vn 1 0 0
vn 0 -0.7071067811865476 0.7071067811865475
vn -1 0 0
vn 0 0.7071067811865475 0.7071067811865476
vn 0 -0.7071067811865475 -0.7071067811865476
usemtl m_79b8a0d4-4f5c-1950-bda6-ec259f602f6d
f 12/28/7 15/27/7 13/26/7 10/25/7
f 11/32/8 12/31/8 10/30/8 9/29/8
f 16/36/9 11/35/9 9/34/9 14/33/9
f 15/40/10 16/39/10 14/38/10 13/37/10
f 14/44/11 9/43/11 10/42/11 13/41/11
f 15/48/12 12/47/12 11/46/12 16/45/12

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -184,46 +184,3 @@ registerWood('tammoy', 3)
registerWood('gi', 4) registerWood('gi', 4)
registerWood('dallalia', 5) registerWood('dallalia', 5)
registerWood('zuph', 6) registerWood('zuph', 6)
-- сундучки
---@type TileSheet
local caseTileSheet = TileSheet:new('cases_sheet.png', 16, 16)
local function getCaseTiles(x, y)
return {
caseTileSheet:t(x, y),
caseTileSheet:t(x, y),
caseTileSheet:t(x, y+1),
}
end
local t = getCaseTiles
planksFactory:registerItems({
---@type Node.NodeDefinition
{
settings = {
name = 'case_closed',
_title = 'Case',
--description = '',
tiles = t(0,0)
},
},
---@type Node.NodeDefinition
{
settings = {
name = 'case_open',
_title = 'Case',
--description = '',
tiles = t(1,0);
drawtype = 'nodebox';
node_box = {
type = 'fixed',
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5 - 1/16*2, 0.5},
}
}
},
},
})