Rename crafting mod to mcl_inventory
@ -1,5 +1,4 @@
|
||||
crafting = {}
|
||||
crafting.creative_inventory_size = 0
|
||||
mcl_inventory.creative_inventory_size = 0
|
||||
|
||||
-- Prepare player info table
|
||||
local players = {}
|
||||
@ -77,7 +76,7 @@ local function set_inv(filter, player)
|
||||
for _,itemstring in ipairs(creative_list) do
|
||||
inv:add_item("main", ItemStack(itemstring))
|
||||
end
|
||||
crafting.creative_inventory_size = #creative_list
|
||||
mcl_inventory.creative_inventory_size = #creative_list
|
||||
end
|
||||
|
||||
local function init(player)
|
||||
@ -186,10 +185,10 @@ local function reset_menu_item_bg()
|
||||
end
|
||||
|
||||
|
||||
crafting.set_creative_formspec = function(player, start_i, pagenum, show, page, filter)
|
||||
mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, show, page, filter)
|
||||
reset_menu_item_bg()
|
||||
pagenum = math.floor(pagenum) or 1
|
||||
local pagemax = math.floor((crafting.creative_inventory_size-1) / (9*5) + 1)
|
||||
local pagemax = math.floor((mcl_inventory.creative_inventory_size-1) / (9*5) + 1)
|
||||
local slider_height
|
||||
if pagemax == 1 then
|
||||
slider_height = 4.525
|
||||
@ -386,10 +385,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if start_i < 0 then
|
||||
start_i = start_i + 9*5
|
||||
end
|
||||
if start_i >= crafting.creative_inventory_size then
|
||||
if start_i >= mcl_inventory.creative_inventory_size then
|
||||
start_i = start_i - 9*5
|
||||
end
|
||||
if start_i < 0 or start_i >= crafting.creative_inventory_size then
|
||||
if start_i < 0 or start_i >= mcl_inventory.creative_inventory_size then
|
||||
start_i = 0
|
||||
end
|
||||
players[name].start_i = start_i
|
||||
@ -400,7 +399,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
players[name].filter = filter
|
||||
end
|
||||
|
||||
crafting.set_creative_formspec(player, start_i, start_i / (9*5) + 1, false, page, filter)
|
||||
mcl_inventory.set_creative_formspec(player, start_i, start_i / (9*5) + 1, false, page, filter)
|
||||
end)
|
||||
|
||||
|
1
mods/HUD/mcl_inventory/description.txt
Normal file
@ -0,0 +1 @@
|
||||
Adds the player inventory, creative inventory and crafting table.
|
@ -1,3 +1,5 @@
|
||||
mcl_inventory = {}
|
||||
|
||||
local show_armor = false
|
||||
if minetest.get_modpath("3d_armor") ~= nil then show_armor = true end
|
||||
|
||||
@ -37,7 +39,7 @@ end
|
||||
|
||||
local function set_inventory(player)
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
crafting.set_creative_formspec(player, 0, 1)
|
||||
mcl_inventory.set_creative_formspec(player, 0, 1)
|
||||
return
|
||||
end
|
||||
local inv = player:get_inventory()
|
||||
@ -173,7 +175,7 @@ minetest.register_on_joinplayer(function(player)
|
||||
drop_fields(player, "craft")
|
||||
end)
|
||||
|
||||
minetest.register_node("crafting:workbench", {
|
||||
minetest.register_node("mcl_inventory:workbench", {
|
||||
description = "Crafting Table",
|
||||
tiles = {"crafting_workbench_top.png", "default_wood.png", "crafting_workbench_side.png",
|
||||
"crafting_workbench_side.png", "crafting_workbench_front.png", "crafting_workbench_front.png"},
|
||||
@ -189,7 +191,7 @@ minetest.register_node("crafting:workbench", {
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "crafting:workbench",
|
||||
output = "mcl_inventory:workbench",
|
||||
recipe = {
|
||||
{"group:wood", "group:wood"},
|
||||
{"group:wood", "group:wood"}
|
||||
@ -198,11 +200,12 @@ minetest.register_craft({
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "crafting:workbench",
|
||||
recipe = "mcl_inventory:workbench",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
dofile(minetest.get_modpath("crafting").."/creative.lua")
|
||||
end
|
||||
minetest.register_alias("crafting:workbench", "mcl_inventory:workbench")
|
||||
|
||||
if minetest.setting_getbool("creative_mode") then
|
||||
dofile(minetest.get_modpath("mcl_inventory").."/creative.lua")
|
||||
end
|
1
mods/HUD/mcl_inventory/mod.conf
Normal file
@ -0,0 +1 @@
|
||||
name = mcl_inventory
|
Before Width: | Height: | Size: 374 B After Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 870 B After Width: | Height: | Size: 870 B |
Before Width: | Height: | Size: 376 B After Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 187 B |
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
0
mods/HUD/crafting/textures/crafting_hotbar.png → mods/HUD/mcl_inventory/textures/crafting_hotbar.png
Before Width: | Height: | Size: 483 B After Width: | Height: | Size: 483 B |
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 462 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/HUD/crafting/textures/crafting_slider.png → mods/HUD/mcl_inventory/textures/crafting_slider.png
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 134 B |
Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 431 B |
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 406 B |
Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 389 B |
Before Width: | Height: | Size: 455 B After Width: | Height: | Size: 455 B |
Before Width: | Height: | Size: 801 B After Width: | Height: | Size: 801 B |
Before Width: | Height: | Size: 768 B After Width: | Height: | Size: 768 B |
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 1012 B |
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 325 B |
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
Before Width: | Height: | Size: 947 B After Width: | Height: | Size: 947 B |
0
mods/HUD/crafting/textures/fnt_ender_chest.png → mods/HUD/mcl_inventory/textures/fnt_ender_chest.png
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 658 B |
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 744 B |
Before Width: | Height: | Size: 751 B After Width: | Height: | Size: 751 B |
Before Width: | Height: | Size: 859 B After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 425 B After Width: | Height: | Size: 425 B |
0
mods/HUD/crafting/textures/fnt_shulker_box.png → mods/HUD/mcl_inventory/textures/fnt_shulker_box.png
Before Width: | Height: | Size: 430 B After Width: | Height: | Size: 430 B |
Before Width: | Height: | Size: 487 B After Width: | Height: | Size: 487 B |
@ -6,6 +6,6 @@ mcl_colorblocks
|
||||
mcl_wool
|
||||
mcl_fences
|
||||
mcl_chests
|
||||
crafting
|
||||
mcl_inventory
|
||||
mesecons_pressureplates
|
||||
mcl_tnt
|
||||
|