2014-08-12 21:08:11 +02:00
|
|
|
-----------------------------------------------------------------------------------------------
|
|
|
|
local title = "Mole Hills"
|
2018-02-18 01:28:43 +01:00
|
|
|
local version = "0.0.3"
|
2014-08-12 21:08:11 +02:00
|
|
|
local mname = "molehills"
|
|
|
|
-----------------------------------------------------------------------------------------------
|
|
|
|
-- Idea by Sokomine
|
|
|
|
-- Code & textures by Mossmanikin
|
|
|
|
|
|
|
|
abstract_molehills = {}
|
|
|
|
|
|
|
|
dofile(minetest.get_modpath("molehills").."/molehills_settings.txt")
|
|
|
|
|
2017-08-03 15:02:56 +02:00
|
|
|
-- support for i18n
|
|
|
|
local S = plantlife_i18n.gettext
|
2014-08-12 21:08:11 +02:00
|
|
|
-----------------------------------------------------------------------------------------------
|
|
|
|
-- NoDe
|
|
|
|
-----------------------------------------------------------------------------------------------
|
2015-08-14 20:50:31 +02:00
|
|
|
|
|
|
|
local mh_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
|
|
|
}
|
|
|
|
|
2014-08-12 21:08:11 +02:00
|
|
|
minetest.register_node("molehills:molehill",{
|
2015-08-14 20:50:31 +02:00
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "molehill_molehill.obj",
|
2017-08-03 15:02:56 +02:00
|
|
|
description = S("Mole Hill"),
|
2014-08-12 21:08:11 +02:00
|
|
|
inventory_image = "molehills_side.png",
|
2015-08-14 20:50:31 +02:00
|
|
|
tiles = { "molehills_dirt.png" },
|
|
|
|
paramtype = "light",
|
|
|
|
selection_box = mh_cbox,
|
|
|
|
collision_box = mh_cbox,
|
2014-08-12 21:08:11 +02:00
|
|
|
groups = {crumbly=3},
|
2015-08-14 20:50:31 +02:00
|
|
|
sounds = default.node_sound_dirt_defaults(),
|
2014-08-12 21:08:11 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------------------------
|
|
|
|
-- CRaFTiNG
|
|
|
|
-----------------------------------------------------------------------------------------------
|
|
|
|
minetest.register_craft({ -- molehills --> dirt
|
|
|
|
output = "default:dirt",
|
|
|
|
recipe = {
|
|
|
|
{"molehills:molehill","molehills:molehill"},
|
|
|
|
{"molehills:molehill","molehills:molehill"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------------------------
|
|
|
|
-- GeNeRaTiNG
|
|
|
|
-----------------------------------------------------------------------------------------------
|
|
|
|
abstract_molehills.place_molehill = function(pos)
|
2018-02-18 01:28:43 +01:00
|
|
|
local right_here = {x=pos.x , y=pos.y+1, z=pos.z }
|
2014-08-12 21:08:11 +02:00
|
|
|
if minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z }).name ~= "air"
|
|
|
|
and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z }).name ~= "air"
|
|
|
|
and minetest.get_node({x=pos.x , y=pos.y, z=pos.z+1}).name ~= "air"
|
|
|
|
and minetest.get_node({x=pos.x , y=pos.y, z=pos.z-1}).name ~= "air"
|
|
|
|
and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z+1}).name ~= "air"
|
|
|
|
and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z-1}).name ~= "air"
|
|
|
|
and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z+1}).name ~= "air"
|
|
|
|
and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z-1}).name ~= "air" then
|
2014-08-16 01:34:15 +02:00
|
|
|
minetest.set_node(right_here, {name="molehills:molehill"})
|
2014-08-12 21:08:11 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-08-09 16:11:30 +02:00
|
|
|
biome_lib:register_generate_plant({
|
2014-08-12 21:08:11 +02:00
|
|
|
surface = {"default:dirt_with_grass"},
|
|
|
|
max_count = Molehills_Max_Count,
|
|
|
|
rarity = Molehills_Rarity,
|
|
|
|
min_elevation = 1,
|
|
|
|
max_elevation = 40,
|
|
|
|
avoid_nodes = {"group:tree","group:liquid","group:stone","group:falling_node"--[[,"air"]]},
|
|
|
|
avoid_radius = 4,
|
|
|
|
plantlife_limit = -0.3,
|
|
|
|
},
|
2014-08-15 16:09:01 +02:00
|
|
|
abstract_molehills.place_molehill
|
2014-08-12 21:08:11 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------------------------
|
2017-08-03 15:02:56 +02:00
|
|
|
print("[Mod] "..title.." ["..version.."] ["..mname.."]"..S("Loaded..."))
|
2014-08-15 16:09:01 +02:00
|
|
|
-----------------------------------------------------------------------------------------------
|