From 6a0aba34632df6d608a1f5c95e240c95f2c81fba Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 3 Jun 2017 02:09:56 +0200 Subject: [PATCH] =?UTF-8?q?Crafting=20table=20=E2=86=92=20mcl=5Fcrafting?= =?UTF-8?q?=5Ftable=20(fix=20dig=20fail)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mods/HUD/mcl_inventory/README.txt | 9 +-- mods/HUD/mcl_inventory/description.txt | 2 +- mods/HUD/mcl_inventory/init.lua | 55 ------------------ mods/ITEMS/mcl_crafting_table/depends.txt | 2 + mods/ITEMS/mcl_crafting_table/description.txt | 1 + mods/ITEMS/mcl_crafting_table/init.lua | 50 ++++++++++++++++ mods/ITEMS/mcl_crafting_table/mod.conf | 1 + .../textures/crafting_inventory_workbench.png | Bin .../textures/crafting_workbench_front.png | Bin .../textures/crafting_workbench_side.png | Bin .../textures/crafting_workbench_top.png | Bin 11 files changed, 57 insertions(+), 63 deletions(-) create mode 100644 mods/ITEMS/mcl_crafting_table/depends.txt create mode 100644 mods/ITEMS/mcl_crafting_table/description.txt create mode 100644 mods/ITEMS/mcl_crafting_table/init.lua create mode 100644 mods/ITEMS/mcl_crafting_table/mod.conf rename mods/{HUD/mcl_inventory => ITEMS/mcl_crafting_table}/textures/crafting_inventory_workbench.png (100%) rename mods/{HUD/mcl_inventory => ITEMS/mcl_crafting_table}/textures/crafting_workbench_front.png (100%) rename mods/{HUD/mcl_inventory => ITEMS/mcl_crafting_table}/textures/crafting_workbench_side.png (100%) rename mods/{HUD/mcl_inventory => ITEMS/mcl_crafting_table}/textures/crafting_workbench_top.png (100%) diff --git a/mods/HUD/mcl_inventory/README.txt b/mods/HUD/mcl_inventory/README.txt index 5b45bc8f5c..7dd80f1a4b 100644 --- a/mods/HUD/mcl_inventory/README.txt +++ b/mods/HUD/mcl_inventory/README.txt @@ -23,12 +23,7 @@ inventory and a support for stu's 3d armor mod (To use the armor and a preview o Left items in the crafting slots are dropped infront of you. -Workbench +Crafting table _________ -With following recipe you craft a workbench (aka crafting table): - -wood wood -wood wood - -The workbench has a 3x3 crafting grid, that allows to use all recipes. \ No newline at end of file +Has been moved to mcl_crafting_table diff --git a/mods/HUD/mcl_inventory/description.txt b/mods/HUD/mcl_inventory/description.txt index c74d0012c8..207a3fa5e0 100644 --- a/mods/HUD/mcl_inventory/description.txt +++ b/mods/HUD/mcl_inventory/description.txt @@ -1 +1 @@ -Adds the player inventory, creative inventory and crafting table. +Adds the player inventory and creative inventory. diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index a61341796d..1c4931dfea 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -108,26 +108,6 @@ local function set_inventory(player, armor_change_only) player:set_inventory_formspec(form) end -local function set_workbench(player) - player:get_inventory():set_width("craft", 3) - player:get_inventory():set_size("craft", 9) - - local form = "size[9,8.75]".. - "background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory_workbench.png]".. - mcl_vars.inventory_header.. - "list[current_player;main;0,4.5;9,3;9]".. - "list[current_player;main;0,7.74;9,1;]".. - "list[current_player;craft;1.75,0.5;3,3;]".. - "list[current_player;craftpreview;6.1,1.5;1,1;]".. - "image_button[8,0;1,1;craftguide_book.png;__mcl_craftguide;]".. - "tooltip[__mcl_craftguide;Show crafting recipes]".. - "listring[current_player;main]".. - "listring[current_player;craft]" - - --player:set_inventory_formspec(form) - minetest.show_formspec(player:get_player_name(), "main", form) -end - -- Drop items in craft grid and reset inventory on closing minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.quit then @@ -181,41 +161,6 @@ minetest.register_on_joinplayer(function(player) drop_fields(player, "craft") end) -minetest.register_node("mcl_inventory:workbench", { - description = "Crafting Table", - _doc_items_longdesc = "A crafting table is a block which grants you access to a 3×3 crafting grid which allows you to perform advanced crafts.", - _doc_items_usagehelp = "Rightclick the crafting table to access the 3×3 crafting grid.", - _doc_items_hidden = false, - is_ground_content = false, - tiles = {"crafting_workbench_top.png", "default_wood.png", "crafting_workbench_side.png", - "crafting_workbench_side.png", "crafting_workbench_front.png", "crafting_workbench_front.png"}, - paramtype2 = "facedir", - paramtype = "light", - groups = {handy=1,axey=1, deco_block=1, material_wood=1}, - on_rightclick = function(pos, node, clicker, itemstack) - set_workbench(clicker) - end, - sounds = mcl_sounds.node_sound_wood_defaults(), - _mcl_blast_resistance = 12.5, - _mcl_hardness = 2.5, -}) - -minetest.register_craft({ - output = "mcl_inventory:workbench", - recipe = { - {"group:wood", "group:wood"}, - {"group:wood", "group:wood"} - } -}) - -minetest.register_craft({ - type = "fuel", - recipe = "mcl_inventory:workbench", - burntime = 15, -}) - -minetest.register_alias("crafting:workbench", "mcl_inventory:workbench") - if minetest.setting_getbool("creative_mode") then dofile(minetest.get_modpath("mcl_inventory").."/creative.lua") end diff --git a/mods/ITEMS/mcl_crafting_table/depends.txt b/mods/ITEMS/mcl_crafting_table/depends.txt new file mode 100644 index 0000000000..e3b8528c2d --- /dev/null +++ b/mods/ITEMS/mcl_crafting_table/depends.txt @@ -0,0 +1,2 @@ +mcl_init +mcl_sounds diff --git a/mods/ITEMS/mcl_crafting_table/description.txt b/mods/ITEMS/mcl_crafting_table/description.txt new file mode 100644 index 0000000000..5f2a79786c --- /dev/null +++ b/mods/ITEMS/mcl_crafting_table/description.txt @@ -0,0 +1 @@ +Adds a crafting table. diff --git a/mods/ITEMS/mcl_crafting_table/init.lua b/mods/ITEMS/mcl_crafting_table/init.lua new file mode 100644 index 0000000000..c9f6101d78 --- /dev/null +++ b/mods/ITEMS/mcl_crafting_table/init.lua @@ -0,0 +1,50 @@ +minetest.register_node("mcl_crafting_table:crafting_table", { + description = "Crafting Table", + _doc_items_longdesc = "A crafting table is a block which grants you access to a 3×3 crafting grid which allows you to perform advanced crafts.", + _doc_items_usagehelp = "Rightclick the crafting table to access the 3×3 crafting grid.", + _doc_items_hidden = false, + is_ground_content = false, + tiles = {"crafting_workbench_top.png", "default_wood.png", "crafting_workbench_side.png", + "crafting_workbench_side.png", "crafting_workbench_front.png", "crafting_workbench_front.png"}, + paramtype2 = "facedir", + paramtype = "light", + groups = {handy=1,axey=1, deco_block=1, material_wood=1}, + on_rightclick = function(pos, node, player, itemstack) + player:get_inventory():set_width("craft", 3) + player:get_inventory():set_size("craft", 9) + + local form = "size[9,8.75]".. + "background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory_workbench.png]".. + mcl_vars.inventory_header.. + "list[current_player;main;0,4.5;9,3;9]".. + "list[current_player;main;0,7.74;9,1;]".. + "list[current_player;craft;1.75,0.5;3,3;]".. + "list[current_player;craftpreview;6.1,1.5;1,1;]".. + "image_button[8,0;1,1;craftguide_book.png;__mcl_craftguide;]".. + "tooltip[__mcl_craftguide;Show crafting recipes]".. + "listring[current_player;main]".. + "listring[current_player;craft]" + + minetest.show_formspec(player:get_player_name(), "main", form) + end, + sounds = mcl_sounds.node_sound_wood_defaults(), + _mcl_blast_resistance = 12.5, + _mcl_hardness = 2.5, +}) + +minetest.register_craft({ + output = "mcl_crafting_table:crafting_table", + recipe = { + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"} + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "mcl_crafting_table:crafting_table", + burntime = 15, +}) + +minetest.register_alias("crafting:workbench", "mcl_crafting_table:crafting_table") +minetest.register_alias("mcl_inventory:workbench", "mcl_crafting_table:crafting_table") diff --git a/mods/ITEMS/mcl_crafting_table/mod.conf b/mods/ITEMS/mcl_crafting_table/mod.conf new file mode 100644 index 0000000000..db5ab14a1a --- /dev/null +++ b/mods/ITEMS/mcl_crafting_table/mod.conf @@ -0,0 +1 @@ +name = mcl_crafting_table diff --git a/mods/HUD/mcl_inventory/textures/crafting_inventory_workbench.png b/mods/ITEMS/mcl_crafting_table/textures/crafting_inventory_workbench.png similarity index 100% rename from mods/HUD/mcl_inventory/textures/crafting_inventory_workbench.png rename to mods/ITEMS/mcl_crafting_table/textures/crafting_inventory_workbench.png diff --git a/mods/HUD/mcl_inventory/textures/crafting_workbench_front.png b/mods/ITEMS/mcl_crafting_table/textures/crafting_workbench_front.png similarity index 100% rename from mods/HUD/mcl_inventory/textures/crafting_workbench_front.png rename to mods/ITEMS/mcl_crafting_table/textures/crafting_workbench_front.png diff --git a/mods/HUD/mcl_inventory/textures/crafting_workbench_side.png b/mods/ITEMS/mcl_crafting_table/textures/crafting_workbench_side.png similarity index 100% rename from mods/HUD/mcl_inventory/textures/crafting_workbench_side.png rename to mods/ITEMS/mcl_crafting_table/textures/crafting_workbench_side.png diff --git a/mods/HUD/mcl_inventory/textures/crafting_workbench_top.png b/mods/ITEMS/mcl_crafting_table/textures/crafting_workbench_top.png similarity index 100% rename from mods/HUD/mcl_inventory/textures/crafting_workbench_top.png rename to mods/ITEMS/mcl_crafting_table/textures/crafting_workbench_top.png