Added code via upload

master
Alithea 2018-10-31 11:55:21 +08:00 committed by GitHub
commit 07ea496d7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 54 additions and 0 deletions

2
depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
farming

1
description.txt Normal file
View File

@ -0,0 +1 @@
Adds health-increasing sweets and dessert (not desert) blocks to Minetest.

7
init.lua Normal file
View File

@ -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

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = sweet_nodes
description = Adds edible and decorative nodes to Minetest
depends = farming, default

11
sugar.lua Normal file
View File

@ -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",
})

15
tart.lua Normal file
View File

@ -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', ''},
{'', '', ''},
}
})

15
tart_node.lua Normal file
View File

@ -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', ''},
{'', '', ''},
}
})

BIN
textures/sn_pop_tart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
textures/sn_pop_tartIC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
textures/sn_sugar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B