Merge remote-tracking branch 'upstream/master'

This commit is contained in:
2023-11-25 15:30:28 +01:00
130 changed files with 1214 additions and 1926 deletions

View File

@ -29,10 +29,6 @@ abstract_trunks.place_twig = function(pos)
if twig_size <= 16 then
minetest.swap_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)})
end
-- big twigs
if Big_Twigs == true then
local n1, n2
local r1, r2
-- big twig 1
if twig_size == 17 then
if not (check_node_buildable_to({x=pos.x+1,y=pos.y,z=pos.z+1})
@ -233,14 +229,12 @@ abstract_trunks.place_twig = function(pos)
elseif twig_size <= 25 then
minetest.swap_node(right_here, {name="trunks:twig_"..math.random(12,13), param2=math.random(0,3)})
end
end
end
if Twigs_on_ground == true then
biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"},
max_count = Twigs_on_ground_Max_Count,
rarity = Twigs_on_ground_Rarity,
max_count = 640,
rarity = 66,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"group:tree","ferns:fern_03","ferns:fern_02","ferns:fern_01"},
@ -251,13 +245,11 @@ biome_lib.register_on_generate({
},
abstract_trunks.place_twig
)
end
if Twigs_on_water == true then
biome_lib.register_on_generate({
surface = {"default:water_source"},
max_count = Twigs_on_water_Max_Count,
rarity = Twigs_on_water_Rarity,
max_count = 320,
rarity = 33,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"group:tree"},
@ -268,7 +260,6 @@ biome_lib.register_on_generate({
},
abstract_trunks.place_twig
)
end
-----------------------------------------------------------------------------------------------
-- TRuNKS
@ -296,7 +287,6 @@ local TRuNKS = {
{"moretrees", "willow_trunk", 17},
}
if Horizontal_Trunks == true then -- see settings.txt
for i in pairs(TRuNKS) do
local MoD = TRuNKS[i][1]
local TRuNK = TRuNKS[i][2]
@ -310,7 +300,6 @@ for i in pairs(TRuNKS) do
minetest.register_node(":"..trunkname, temptrunk)
end
end
end
abstract_trunks.place_trunk = function(pos)
@ -339,7 +328,7 @@ abstract_trunks.place_trunk = function(pos)
else
minetest.swap_node(right_here, {name="default:tree"})
end
elseif trunk_type == 2 and Horizontal_Trunks == true then
elseif trunk_type == 2 then
if minetest.get_modpath(MoD) ~= nil then
if check_node_buildable_to(north) then
minetest.swap_node(north, {name=MoD..":"..TRuNK, param2=4})
@ -371,7 +360,7 @@ abstract_trunks.place_trunk = function(pos)
minetest.swap_node(south2, {name="default:tree", param2=4})
end
end
elseif trunk_type == 3 and Horizontal_Trunks == true then
elseif trunk_type == 3 then
if minetest.get_modpath(MoD) ~= nil then
if check_node_buildable_to(west) then
minetest.swap_node(west, {name=MoD..":"..TRuNK, param2=12})
@ -409,8 +398,8 @@ end
biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"},
max_count = Trunks_Max_Count, -- 320,
rarity = Trunks_Rarity, -- 99,
max_count = 320, -- 320,
rarity = 99, -- 99,
min_elevation = 1,
max_elevation = 40,
avoid_nodes = {"group:tree"},
@ -427,7 +416,6 @@ biome_lib.register_on_generate({
-----------------------------------------------------------------------------------------------
-- MoSS & FuNGuS -- on ground
-----------------------------------------------------------------------------------------------
if Moss_on_ground == true then
abstract_trunks.grow_moss_on_ground = function(pos)
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
local moss_type = math.random(1,21)
@ -443,8 +431,8 @@ end
biome_lib.register_on_generate({
surface = {"default:dirt_with_grass"},
max_count = Moss_on_ground_Max_Count,
rarity = Moss_on_ground_Rarity,
max_count = 400,
rarity = 79,
min_elevation = 1,
max_elevation = 40,
near_nodes = {
@ -460,12 +448,10 @@ biome_lib.register_on_generate({
},
abstract_trunks.grow_moss_on_ground
)
end
-----------------------------------------------------------------------------------------------
-- MoSS & FuNGuS -- on trunks
-----------------------------------------------------------------------------------------------
if Moss_on_trunk == true then
abstract_trunks.grow_moss_on_trunk = function(pos)
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
local at_side_n = {x=pos.x, y=pos.y, z=pos.z+1}
@ -543,8 +529,8 @@ biome_lib.register_on_generate({
"moretrees:willow_trunk",
"default:mossycobble"
},
max_count = Moss_on_trunk_Max_Count,
rarity = Moss_on_trunk_Rarity,
max_count = 640,
rarity = 24,
min_elevation = 1,
max_elevation = 40,
plantlife_limit = -0.9,
@ -552,16 +538,11 @@ biome_lib.register_on_generate({
},
"abstract_trunks.grow_moss_on_trunk"
)
end
-----------------------------------------------------------------------------------------------
-- RooTS
-----------------------------------------------------------------------------------------------
if Roots == true then -- see settings.txt
abstract_trunks.grow_roots = function(pos)
local twig_size = math.random(1,27)
local right_here = {x=pos.x , y=pos.y , z=pos.z }
local below = {x=pos.x , y=pos.y-1, z=pos.z }
local north = {x=pos.x , y=pos.y , z=pos.z+1}
@ -610,5 +591,3 @@ biome_lib.register_on_generate({
},
"abstract_trunks.grow_roots"
)
end

View File

@ -1,20 +1,9 @@
-----------------------------------------------------------------------------------------------
local title = "Trunks"
local version = "0.1.4"
local mname = "trunks"
-----------------------------------------------------------------------------------------------
-- Code by Mossmanikin & Neuromancer
abstract_trunks = {}
-- support for i18n
local S = minetest.get_translator("trunks")
dofile(minetest.get_modpath("trunks").."/trunks_settings.txt")
dofile(minetest.get_modpath("trunks").."/generating.lua")
dofile(minetest.get_modpath("trunks").."/nodes.lua")
dofile(minetest.get_modpath("trunks").."/crafting.lua")
-----------------------------------------------------------------------------------------------
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
-----------------------------------------------------------------------------------------------
abstract_trunks.loaded = true

View File

@ -1,11 +1,4 @@
# textdomain: trunks
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
Twig=
Moss=
Moss with Fungus=

View File

@ -1,16 +1,9 @@
# textdomain: trunks
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# reusityback, 2022.
#
Twig=Zweig
Moss=Moos
Moss with Fungus=Moos mit Pilz
Twigs Block=Zweigblock
Twigs Slab=Zweigstufe
Twigs Slab=Zweigplatte
Twigs Roof=Zweigdach
Twigs Roof Corner 1=Zweigdachwinkel 1
Twigs Roof Corner 2=Zweigdachwinkel 2

View File

@ -1,11 +1,4 @@
# textdomain: trunks
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Jolesh, 2022.
#
Twig=Branĉeto
Moss=Musko
Moss with Fungus=Musko kun Fungo

View File

@ -1,11 +1,4 @@
# textdomain: trunks
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# fat115 <fat115@framasoft.org>, 2017.
#
Twig=Brindille
Moss=Mousse
Moss with Fungus=Mousse et champignons

View File

@ -48,7 +48,7 @@ for i in pairs(NoDe) do
if not placer then return end
local playername = placer:get_player_name()
if minetest.is_protected(pt.above, playername) then
if minetest.is_protected(pt.above, playername) then
minetest.record_protection_violation(pt.above, playername)
return
end
@ -56,7 +56,7 @@ for i in pairs(NoDe) do
local direction = minetest.dir_to_facedir(placer:get_look_dir())
if minetest.get_node(pt.above).name=="air" then
minetest.swap_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction})
if not minetest.setting_getbool("creative_mode") then
if not minetest.is_creative_enabled(playername) then
itemstack:take_item()
end
return itemstack
@ -126,7 +126,7 @@ for r = 0, 3 do
})
end
minetest.register_alias("trunks:moss_plain", "trunks:moss_plain_0")
minetest.register_alias("trunks:moss_plain", "trunks:moss_plain_0")
minetest.register_alias("trunks:moss_with_fungus", "trunks:moss_with_fungus_0")
-----------------------------------------------------------------------------------------------
@ -187,7 +187,7 @@ minetest.register_node("trunks:twigs_roof", {
-----------------------------------------------------------------------------------------------
-- TWiGS RooF CoRNeR
-----------------------------------------------------------------------------------------------
minetest.register_alias("woodstuff:twigs_roof_corner", "trunks:twigs_roof_corner")
minetest.register_alias("woodstuff:twigs_roof_corner", "trunks:twigs_roof_corner")
minetest.register_node("trunks:twigs_roof_corner", {
description = S("Twigs Roof Corner 1"),
@ -215,7 +215,7 @@ minetest.register_node("trunks:twigs_roof_corner", {
-----------------------------------------------------------------------------------------------
-- TWiGS RooF CoRNeR 2
-----------------------------------------------------------------------------------------------
minetest.register_alias("woodstuff:twigs_roof_corner_2", "trunks:twigs_roof_corner_2")
minetest.register_alias("woodstuff:twigs_roof_corner_2", "trunks:twigs_roof_corner_2")
minetest.register_node("trunks:twigs_roof_corner_2", {
description = S("Twigs Roof Corner 2"),
@ -240,98 +240,93 @@ minetest.register_node("trunks:twigs_roof_corner_2", {
sounds = default.node_sound_wood_defaults(),
})
if Auto_Roof_Corner == true then
local roof = "trunks:twigs_roof"
local corner = "trunks:twigs_roof_corner"
local corner_2 = "trunks:twigs_roof_corner_2"
local roof = "trunks:twigs_roof"
local corner = "trunks:twigs_roof_corner"
local corner_2 = "trunks:twigs_roof_corner_2"
minetest.register_abm({
nodenames = {roof},
interval = 1,
chance = 1,
action = function(pos)
minetest.register_abm({
nodenames = {roof},
interval = 1,
chance = 1,
action = function(pos)
local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z })
local node_west = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z })
local node_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1})
local node_south = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1})
-- corner 1
if ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner and node_north.param2 == 3))
then
minetest.swap_node(pos, {name=corner, param2=0})
end
local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z })
local node_west = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z })
local node_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1})
local node_south = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1})
-- corner 1
if ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner and node_north.param2 == 3))
then
minetest.swap_node(pos, {name=corner, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner and node_east.param2 == 0))
then
minetest.swap_node(pos, {name=corner, param2=1})
end
if ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner and node_east.param2 == 0))
then
minetest.swap_node(pos, {name=corner, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner and node_south.param2 == 1))
then
minetest.swap_node(pos, {name=corner, param2=2})
end
if ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner and node_south.param2 == 1))
then
minetest.swap_node(pos, {name=corner, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner and node_west.param2 == 2))
then
minetest.swap_node(pos, {name=corner, param2=3})
end
-- corner 2
if ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner_2 and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner_2 and node_north.param2 == 3))
then
minetest.swap_node(pos, {name=corner_2, param2=0})
end
if ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner and node_west.param2 == 2))
then
minetest.swap_node(pos, {name=corner, param2=3})
end
-- corner 2
if ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner_2 and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner_2 and node_north.param2 == 3))
then
minetest.swap_node(pos, {name=corner_2, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner_2 and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner_2 and node_east.param2 == 0))
then
minetest.swap_node(pos, {name=corner_2, param2=1})
end
if ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner_2 and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner_2 and node_east.param2 == 0))
then
minetest.swap_node(pos, {name=corner_2, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner_2 and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner_2 and node_south.param2 == 1))
then
minetest.swap_node(pos, {name=corner_2, param2=2})
end
if ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner_2 and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner_2 and node_south.param2 == 1))
then
minetest.swap_node(pos, {name=corner_2, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner_2 and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner_2 and node_west.param2 == 2))
then
minetest.swap_node(pos, {name=corner_2, param2=3})
end
if ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner_2 and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner_2 and node_west.param2 == 2))
then
minetest.swap_node(pos, {name=corner_2, param2=3})
end
end,
})
end
end,
})
-- MM: The following stuff is just for testing purposes for now; no generating of roots.
-- I'm not satisfied with this; they should be either bigger or a different drawtype.
-----------------------------------------------------------------------------------------------
-- RooTS
-----------------------------------------------------------------------------------------------
if Roots == true then -- see settings.txt
local roots_cube = {-2/16, -1/2, -3/16, 2/16, 1/16, 1/2}
local roots_sheet = {0, -1/2, -1/2, 0, 1/16, 1/2}
@ -402,7 +397,6 @@ for i in pairs(TRuNKS) do
end
end
end
end
minetest.register_alias("trunks:pine_trunkroot", "trunks:pine_treeroot")

View File

@ -1,70 +0,0 @@
-- Settings for generation of stuff (at map-generation time)
Horizontal_Trunks = true
Trunks_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
Trunks_Rarity = 99 -- larger values make trunks more rare (100 means chance of 0 %)
Big_Twigs = true -- twigs larger than one node
Twigs_on_ground = true
Twigs_on_ground_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
Twigs_on_ground_Rarity = 66 -- larger values make twigs more rare (100 means chance of 0 %)
Twigs_on_water = true
Twigs_on_water_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
Twigs_on_water_Rarity = 33 -- larger values make twigs more rare (100 means chance of 0 %)
Moss_on_ground = true
Moss_on_ground_Max_Count = 400 -- absolute maximum number in an area of 80x80x80 nodes
Moss_on_ground_Rarity = 79 -- larger values makes moss more rare (100 means chance of 0 %)
Moss_on_trunk = true
Moss_on_trunk_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
Moss_on_trunk_Rarity = 24 -- larger values makes moss more rare (100 means chance of 0 %)
Auto_Roof_Corner = false -- behavior is similar (not the same!) to the one of minecraft stairs
Roots = true