2020-10-26 17:38:53 +01:00
|
|
|
-- Idea by Sokomine
|
|
|
|
-- Code & textures by Mossmanikin
|
|
|
|
|
|
|
|
-- support for i18n
|
|
|
|
local S = minetest.get_translator("molehills")
|
|
|
|
|
2024-12-19 12:55:40 +01:00
|
|
|
local molehill_rarity = minetest.settings:get("molehills.molehill_rarity") or 0.002
|
|
|
|
|
|
|
|
-- Node
|
2020-10-26 17:38:53 +01:00
|
|
|
local mh_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
|
|
|
}
|
|
|
|
|
|
|
|
minetest.register_node("molehills:molehill",{
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "molehill_molehill.obj",
|
|
|
|
description = S("Mole Hill"),
|
|
|
|
inventory_image = "molehills_side.png",
|
|
|
|
tiles = { "molehills_dirt.png" },
|
2024-12-19 12:55:40 +01:00
|
|
|
use_texture_alpha = "clip",
|
2020-10-26 17:38:53 +01:00
|
|
|
paramtype = "light",
|
|
|
|
selection_box = mh_cbox,
|
|
|
|
collision_box = mh_cbox,
|
|
|
|
groups = {crumbly=3},
|
|
|
|
sounds = default.node_sound_dirt_defaults(),
|
|
|
|
})
|
|
|
|
|
2024-12-19 12:55:40 +01:00
|
|
|
-- Crafting
|
2020-10-26 17:38:53 +01:00
|
|
|
minetest.register_craft({ -- molehills --> dirt
|
|
|
|
output = "default:dirt",
|
|
|
|
recipe = {
|
|
|
|
{"molehills:molehill","molehills:molehill"},
|
|
|
|
{"molehills:molehill","molehills:molehill"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2024-12-19 12:55:40 +01:00
|
|
|
-- Generating
|
|
|
|
minetest.register_decoration({
|
|
|
|
decoration = {
|
|
|
|
"molehills:molehill"
|
|
|
|
},
|
|
|
|
fill_ratio = molehill_rarity,
|
|
|
|
y_min = 1,
|
|
|
|
y_max = 40,
|
|
|
|
place_on = {
|
|
|
|
"default:dirt_with_grass"
|
2021-12-27 15:08:16 +01:00
|
|
|
},
|
2024-12-19 12:55:40 +01:00
|
|
|
spawn_by = "air",
|
|
|
|
num_spawn_by = 3,
|
|
|
|
deco_type = "simple",
|
|
|
|
flags = "all_floors",
|
|
|
|
})
|