commit 07ea496d7d25a66e85fa3e5fe1f2622a06367526 Author: Alithea <35825023+coolcodee2007@users.noreply.github.com> Date: Wed Oct 31 11:55:21 2018 +0800 Added code via upload diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..2ced593 --- /dev/null +++ b/depends.txt @@ -0,0 +1,2 @@ +default +farming \ No newline at end of file diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..863bf6b --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +Adds health-increasing sweets and dessert (not desert) blocks to Minetest. \ No newline at end of file diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..038e72d --- /dev/null +++ b/init.lua @@ -0,0 +1,7 @@ + +local path = minetest.get_modpath("sweet_nodes") +dofile(path .. "/sugar.lua") -- Sugar (very important! Do not remove or else other blocks will suffer) +dofile(path .. "/tart.lua") -- Pop Tart +dofile(path .. "/tart_node.lua") -- Pop Tart Block + + diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..6eff8a7 --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = sweet_nodes +description = Adds edible and decorative nodes to Minetest +depends = farming, default \ No newline at end of file diff --git a/sugar.lua b/sugar.lua new file mode 100644 index 0000000..519f66b --- /dev/null +++ b/sugar.lua @@ -0,0 +1,11 @@ +minetest.register_craftitem("sweet_nodes:sugar", { + description = "Sugar", + inventory_image = "sn_sugar.png", + groups = {food_sugar = 1, flammable = 3}, +}) +minetest.register_craft({ + type = "cooking", + cooktime = 3, + output = "sweet_nodes:sugar 2", + recipe = "default:papyrus", +}) \ No newline at end of file diff --git a/tart.lua b/tart.lua new file mode 100644 index 0000000..7ba2c53 --- /dev/null +++ b/tart.lua @@ -0,0 +1,15 @@ +minetest.register_craftitem("sweet_nodes:tart", { + description = "Pop Tart", + inventory_image = "sn_pop_tart.png", + on_use = minetest.item_eat(10), + groups = {food_bread = 1, flammable = 2}, +}) +minetest.register_craft({ + output = 'sweet_nodes:tart', + recipe = { + {'sweet_nodes:sugar', 'sweet_nodes:sugar', ''}, + {'farming:bread', 'farming:bread', ''}, + {'', '', ''}, + } +}) + diff --git a/tart_node.lua b/tart_node.lua new file mode 100644 index 0000000..72eaa92 --- /dev/null +++ b/tart_node.lua @@ -0,0 +1,15 @@ + +minetest.register_node("sweet_nodes:tart_node", { + description = "Pop Tart Block", + tiles = {"sn_pop_tart.png"}, + is_ground_content = false, + groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, +}) +minetest.register_craft({ + output = 'sweet_nodes:tart_node 4', + recipe = { + {'sweet_nodes:tart', 'sweet_nodes:tart', ''}, + {'group:wood', 'group:wood', ''}, + {'', '', ''}, + } +}) diff --git a/textures/sn_pop_tart.png b/textures/sn_pop_tart.png new file mode 100644 index 0000000..5be5618 Binary files /dev/null and b/textures/sn_pop_tart.png differ diff --git a/textures/sn_pop_tartIC.png b/textures/sn_pop_tartIC.png new file mode 100644 index 0000000..c804e7f Binary files /dev/null and b/textures/sn_pop_tartIC.png differ diff --git a/textures/sn_sugar.png b/textures/sn_sugar.png new file mode 100644 index 0000000..c2d5dfc Binary files /dev/null and b/textures/sn_sugar.png differ