Stay here

This commit is contained in:
TechDudie 2021-05-03 16:49:09 +00:00
parent 4e112b0340
commit d95dde6ebc
1 changed files with 130 additions and 0 deletions

View File

@ -0,0 +1,130 @@
minetest.register_craftitem("mcl_sweet_berry:sweet_berry", {
description = "Sweet Berry",
inventory_image = "sweet_berry.png",
on_use = minetest.item_eat(2)
})
for i=1, 4 do
local texture = "sweet_berry_bush_"..i..".png"
local height = 0.5
if i == 1 then
height = 0
end
local create, name, longdesc
if i == 1 then
create = true
name = "Premature Berry Bush"
longdesc = S("Berry Bushes are bushes which grow on any type of dirt and have 4 stages of growth. They can be harvested at any time but will only yield a profit when in its 3rd or 4th growth stage.")
else
create = false
end
minetest.register_node("mcl_sweet_berry:sweet_berry_bush_"..i, {
description = "Premature Berry Bush (Stage "..i..")"
_doc_items_create_entry = create,
_doc_items_entry_name = name,
_doc_items_longdesc = longdesc,
paramtype = "light",
sunlight_propagates = true,
paramtype2 = "meshoptions",
place_param2 = 3,
walkable = false,
drawtype = "plantlike",
drop = "mcl_sweet_berry:sweet_berry",
tiles = {texture},
inventory_image = texture,
wield_image = texture,
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, height, 0.5}
},
},
groups = {dig_immediate=3, not_in_creative_inventory=1,plant=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1},
sounds = mcl_sounds.node_sound_leaves_defaults(),
_mcl_blast_resistance = 0,
})
end
[[--
minetest.register_node("mcl_sweet_berry:sweet_berry_bush_0", {
drawtype = "plantlike",
tiles = {"sweet_berry_bush_0.png"},
damage_per_second = 1,
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
drop = ""
})
minetest.register_node("mcl_sweet_berry:sweet_berry_bush_1", {
drawtype = "plantlike",
tiles = {"sweet_berry_bush_1.png"},
damage_per_second = 1,
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
drop = ""
})
minetest.register_node("mcl_sweet_berry:sweet_berry_bush_2", {
drawtype = "plantlike",
tiles = {"sweet_berry_bush_2.png"},
damage_per_second = 2,
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
drop = "mc:sweet_berry 2"
})
minetest.register_node("mcl_sweet_berry:sweet_berry_bush_3", {
drawtype = "plantlike",
tiles = {"sweet_berry_bush_3.png"},
damage_per_second = 2,
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
},
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,
decoration = "mcl_sweet_berry:sweet_berry_bush_2"
})
minetest.register_abm({
nodenames = {"mcl_sweet_berry:sweet_berry_bush_0"},
interval = 10.0,
chance = 16,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_1"})
end
})
minetest.register_abm({
nodenames = {"mcl_sweet_berry:sweet_berry_bush_1"},
interval = 10.0,
chance = 16,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_2"})
end
})
minetest.register_abm({
nodenames = {"mcl_sweet_berry:sweet_berry_bush_2"},
interval = 10.0,
chance = 16,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.set_node(pos, {name = "mcl_sweet_berry:sweet_berry_bush_3"})
end
})
--taken from mc modpack by TechDude/TechDudie