Compare commits

...

5 Commits

Author SHA1 Message Date
Glenn Engelbart 9bffac2894 change youngtree branch texture to match trunk 2013-11-09 10:47:28 -06:00
4Evergreen4 1f663b7700 Merge pull request #7 from VanessaE/master
use pilzadam's clone-node method to modify trunks
2013-11-07 09:44:35 -08:00
Vanessa Ezekowitz a76117a208 use pilzadam's clone-node method to modify trunks 2013-11-07 12:35:43 -05:00
Mossmanikin a8bafd455e Mole hills 2013-11-01 21:42:30 +01:00
Glenn Engelbart f47c32e4e5 much better bamboo texture 2013-10-26 08:41:12 -05:00
11 changed files with 137 additions and 25 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 714 B

After

Width:  |  Height:  |  Size: 712 B

2
molehills/depends.txt Normal file
View File

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

110
molehills/init.lua Normal file
View File

@ -0,0 +1,110 @@
-----------------------------------------------------------------------------------------------
local title = "Mole Hills"
local version = "0.0.3"
local mname = "molehills"
-----------------------------------------------------------------------------------------------
-- Idea by Sokomine
-- Code & textures by Mossmanikin
abstract_molehills = {}
dofile(minetest.get_modpath("molehills").."/molehills_settings.txt")
-----------------------------------------------------------------------------------------------
-- NoDe
-----------------------------------------------------------------------------------------------
minetest.register_node("molehills:molehill",{
drawtype = "nodebox",
description = "Mole Hill",
inventory_image = "molehills_side.png",
tiles = {
"molehills_dirt.png",--"molehill_top.png",
"molehills_dirt.png",--"molehill_top.png",
"molehills_dirt.png"--"molehill_side.png"
},
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
-- { left, bottom, front, right, top, back}
{-2/16, -3/16, -1/16, 2/16, -2/16, 1/16},
{-1/16, -3/16, -2/16, 1/16, -2/16, 2/16},
-- { left, bottom, front, right, top, back}
{-4/16, -4/16, -2/16, 4/16, -3/16, 2/16},
{-2/16, -4/16, -4/16, 2/16, -3/16, 4/16},
{-3/16, -4/16, -3/16, 3/16, -3/16, 3/16},
-- { left, bottom, front, right, top, back}
{-5/16, -5/16, -2/16, 5/16, -4/16, 2/16},
{-2/16, -5/16, -5/16, 2/16, -4/16, 5/16},
{-4/16, -5/16, -4/16, 4/16, -4/16, 4/16},
-- { left, bottom, front, right, top, back}
{-6/16, -6/16, -2/16, 6/16, -5/16, 2/16},
{-2/16, -6/16, -6/16, 2/16, -5/16, 6/16},
{-5/16, -6/16, -4/16, 5/16, -5/16, 4/16},
{-4/16, -6/16, -5/16, 4/16, -5/16, 5/16},
-- { left, bottom, front, right, top, back}
{-7/16, -7/16, -3/16, 7/16, -6/16, 3/16},
{-3/16, -7/16, -7/16, 3/16, -6/16, 7/16},
{-6/16, -7/16, -4/16, 6/16, -6/16, 4/16},
{-4/16, -7/16, -6/16, 4/16, -6/16, 6/16},
{-5/16, -7/16, -5/16, 5/16, -6/16, 5/16},
-- { left, bottom, front, right, top, back}
--[[b]] {-1/2 , -1/2 , -3/16, 1/2 , -7/16, 3/16}, -- left to right
--[[o]] {-3/16, -1/2 , -1/2 , 3/16, -7/16, 1/2 }, -- front to back
--[[t]] {-7/16, -1/2 , -5/16, 7/16, -7/16, 5/16},
--[[t]] {-5/16, -1/2 , -7/16, 5/16, -7/16, 7/16},
--[[m]] {-6/16, -1/2 , -6/16, 6/16, -7/16, 6/16}, -- mid
},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 2/16, 1/2},
},
groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults(),
})
-----------------------------------------------------------------------------------------------
-- 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)
local right_here = {x=pos.x , y=pos.y+1, z=pos.z }
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
minetest.add_node(right_here, {name="molehills:molehill"})
end
end
plantslib:register_generate_plant({
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,
},
"abstract_molehills.place_molehill"
)
-----------------------------------------------------------------------------------------------
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
-----------------------------------------------------------------------------------------------

View File

@ -0,0 +1,6 @@
-- Settings for generation of stuff (at map-generation time)
Molehills_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
Molehills_Rarity = 87 -- larger values make molehills more rare (100 means chance of 0 %)

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

View File

@ -1,7 +1,18 @@
-- Code by Mossmanikin & Neuromancer
-- Code by Mossmanikin, Neuromancer, and others
local function clone_node(name)
node2={}
node=minetest.registered_nodes[name]
for k,v in pairs(node) do
node2[k]=v
end
return node2
end
-----------------------------------------------------------------------------------------------
-- TWiGS
-----------------------------------------------------------------------------------------------
abstract_trunks.place_twig = function(pos)
local twig_size = math.random(1,27)
@ -217,32 +228,15 @@ for i in pairs(TRuNKS) do
local NR = TRuNKS[i][3]
if minetest.get_modpath(MoD) ~= nil
and NR < 6 then -- moretrees trunks allready have facedir
local des = minetest.registered_nodes[MoD..":"..TRuNK].description
local par = minetest.registered_nodes[MoD..":"..TRuNK].paramtype
local tls = minetest.registered_nodes[MoD..":"..TRuNK].tiles
local tli = minetest.registered_nodes[MoD..":"..TRuNK].tile_images
-- local igc = minetest.registered_nodes[MoD..":"..TRuNK].is_ground_content
local grp = minetest.registered_nodes[MoD..":"..TRuNK].groups
-- local drp = minetest.registered_nodes[MoD..":"..TRuNK].drop
local snd = minetest.registered_nodes[MoD..":"..TRuNK].sounds
minetest.register_node(":"..MoD..":"..TRuNK, {
description = des,
paramtype = par,
paramtype2 = "facedir", -- main change for lying trunks
tiles = tls,
tile_images = tli,
-- is_ground_content = igc,
groups = grp,
-- drop = drp,
sounds = snd,
})
trunkname = MoD..":"..TRuNK
temptrunk = clone_node(trunkname)
temptrunk.paramtype2 = "facedir"
minetest.register_node(":"..trunkname, temptrunk)
end
end
end
abstract_trunks.place_trunk = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
@ -558,4 +552,4 @@ plantslib:register_generate_plant({
"abstract_trunks.grow_roots"
)
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 214 B