2021-04-19 18:39:09 +00:00
|
|
|
minetest.register_craftitem("mcl_sweet_berry:sweet_berry", {
|
2021-04-19 18:20:44 +00:00
|
|
|
description = "Sweet Berry",
|
|
|
|
inventory_image = "sweet_berry.png",
|
|
|
|
on_use = minetest.item_eat(2)
|
|
|
|
})
|
2021-04-19 18:39:09 +00:00
|
|
|
minetest.register_node("mcl_sweet_berry:sweet_berry_bush_0", {
|
2021-04-19 18:20:44 +00:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"sweet_berry_bush_0.png"},
|
|
|
|
damage_per_second = 1,
|
2021-04-19 18:32:47 +00:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
|
|
|
},
|
2021-04-19 18:20:44 +00:00
|
|
|
drop = ""
|
|
|
|
})
|
2021-04-19 18:39:09 +00:00
|
|
|
minetest.register_node("mcl_sweet_berry:sweet_berry_bush_1", {
|
2021-04-19 18:20:44 +00:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"sweet_berry_bush_1.png"},
|
|
|
|
damage_per_second = 1,
|
2021-04-19 18:32:47 +00:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
|
|
|
},
|
2021-04-19 18:20:44 +00:00
|
|
|
drop = ""
|
|
|
|
})
|
2021-04-19 18:39:09 +00:00
|
|
|
minetest.register_node("mcl_sweet_berry:sweet_berry_bush_2", {
|
2021-04-19 18:20:44 +00:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"sweet_berry_bush_2.png"},
|
|
|
|
damage_per_second = 2,
|
2021-04-19 18:32:47 +00:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
|
|
|
},
|
2021-04-19 18:20:44 +00:00
|
|
|
drop = "mc:sweet_berry 2"
|
|
|
|
})
|
2021-04-19 18:39:09 +00:00
|
|
|
minetest.register_node("mcl_sweet_berry:sweet_berry_bush_3", {
|
2021-04-19 18:20:44 +00:00
|
|
|
drawtype = "plantlike",
|
|
|
|
tiles = {"sweet_berry_bush_3.png"},
|
|
|
|
damage_per_second = 2,
|
2021-04-19 18:32:47 +00:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
|
|
|
|
},
|
2021-04-19 18:20:44 +00:00
|
|
|
drop = "mc:sweet_berry 3"
|
|
|
|
})
|
|
|
|
minetest.register_decoration({
|
|
|
|
deco_type = "simple",
|
|
|
|
place_on = {"mcl_core:dirt_with_grass"},
|
|
|
|
sidelen = 16,
|
|
|
|
fill_ratio = 0.1,
|
|
|
|
biomes = {"Taiga","Forest"},
|
|
|
|
y_max = mcl_vars.mg_overworld_max,
|
|
|
|
y_min = mcl_vars.mg_overworld_min,
|
2021-04-19 18:39:09 +00:00
|
|
|
decoration = "mcl_sweet_berry:sweet_berry_bush_2"
|
2021-04-19 18:20:44 +00:00
|
|
|
})
|
|
|
|
minetest.register_abm({
|
2021-04-19 18:39:09 +00:00
|
|
|
nodenames = {"mcl_sweet_berry:sweet_berry_bush_0"},
|
2021-04-19 18:20:44 +00:00
|
|
|
interval = 10.0,
|
|
|
|
chance = 16,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
2021-04-19 18:39:09 +00:00
|
|
|
minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_1"})
|
2021-04-19 18:20:44 +00:00
|
|
|
end
|
|
|
|
})
|
|
|
|
minetest.register_abm({
|
2021-04-19 18:39:09 +00:00
|
|
|
nodenames = {"mcl_sweet_berry:sweet_berry_bush_1"},
|
2021-04-19 18:20:44 +00:00
|
|
|
interval = 10.0,
|
|
|
|
chance = 16,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
2021-04-19 18:39:09 +00:00
|
|
|
minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_2"})
|
2021-04-19 18:20:44 +00:00
|
|
|
end
|
|
|
|
})
|
|
|
|
minetest.register_abm({
|
2021-04-19 18:39:09 +00:00
|
|
|
nodenames = {"mcl_sweet_berry:sweet_berry_bush_2"},
|
2021-04-19 18:20:44 +00:00
|
|
|
interval = 10.0,
|
|
|
|
chance = 16,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
2021-04-19 18:39:09 +00:00
|
|
|
minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_3"})
|
2021-04-19 18:20:44 +00:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
--taken from mc modpack by TechDude/TechDudie
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|