Items migration starting

This commit is contained in:
JoseDouglas26 2024-06-12 08:49:09 -03:00
parent ea44d5cb3c
commit 9bee6afd0c
43 changed files with 40 additions and 3 deletions

View File

@ -76,10 +76,10 @@ local function set_groups(definitions)
end
end
local function set_images(mod_name, identifier, definitions)
local function set_images(mod_name, identifier, definitions, is_item)
local base_image_name = mod_name.."_"..identifier..".png"
if definitions.drawtype and definitions.drawtype:find("plantlike") then
if (definitions.drawtype and definitions.drawtype:find("plantlike")) or is_item then
if not definitions.inventory_image then
definitions.inventory_image = base_image_name
end
@ -142,8 +142,25 @@ function voxelibre.register_block(identifier, definitions)
set_description(mod_name, identifier, definitions)
set_groups(definitions)
set_images(mod_name, identifier, definitions)
set_images(mod_name, identifier, definitions, false)
set_tiles(mod_name, identifier, definitions)
minetest.register_node(":blocks:"..identifier, definitions)
end
function voxelibre.register_item(identifier, definitions)
local mod_name = minetest.get_current_modname()
if not mod_name then
return
end
if not definitions.stack_max then
definitions.stack_max = 64
end
set_description(mod_name, identifier, definitions)
set_images(mod_name, identifier, definitions, true)
minetest.register_craftitem(":items:"..identifier, definitions)
end

1
mods/ITEMS/food/init.lua Normal file
View File

@ -0,0 +1 @@
voxelibre.load_mod_files()

2
mods/ITEMS/food/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = food
depends = voxelibre

View File

@ -0,0 +1,17 @@
local items = {
["apple"] = {},
["baked_potato"] = {},
["beetroot"] = {},
["carrot"] = {},
["chorus_fruit"] = {},
["glow_berries"] = {},
["melon_slice"] = {},
["sweet_berries"] = {},
["poisonous_potato"] = {},
["potato"] = {},
["spider_eye"] = {}
}
for identifier, definitions in pairs(items) do
voxelibre.register_item(identifier, definitions)
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

BIN
textures/food/food_beef.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
textures/food/food_cod.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB