update biome_lib, coloredwood, extra_stairsplus, farming redo,
moreblocks, moretrees, plantlife, and ropes
This commit is contained in:
parent
14117cdce0
commit
ea9e0c62c9
@ -2,6 +2,19 @@ local time_scale = ...
|
||||
|
||||
-- The growing ABM
|
||||
|
||||
function biome_lib.check_surface(name, nodes)
|
||||
if not nodes then return true end
|
||||
if type(nodes) == "string" then return nodes == name end
|
||||
if nodes.set and nodes[name] then
|
||||
return true
|
||||
else
|
||||
for _, n in ipairs(nodes) do
|
||||
if name == n then return true end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function biome_lib:grow_plants(opts)
|
||||
|
||||
local options = opts
|
||||
@ -44,21 +57,18 @@ function biome_lib:grow_plants(opts)
|
||||
end
|
||||
if (n_top.name == "air" or n_top.name == "default:snow")
|
||||
and (not options.need_wall or (options.need_wall and walldir)) then
|
||||
-- corner case for changing short junglegrass
|
||||
-- to dry shrub in desert
|
||||
if n_bot.name == options.dry_early_node and options.grow_plant == "junglegrass:short" then
|
||||
minetest.swap_node(pos, { name = "default:dry_shrub" })
|
||||
|
||||
elseif options.grow_vertically and walldir then
|
||||
if options.grow_vertically and walldir then
|
||||
if biome_lib:search_downward(pos, options.height_limit, options.ground_nodes) then
|
||||
minetest.swap_node(p_top, { name = options.grow_plant, param2 = walldir})
|
||||
end
|
||||
|
||||
elseif not options.grow_result and not options.grow_function then
|
||||
minetest.swap_node(pos, biome_lib.air)
|
||||
elseif biome_lib.check_surface(n_bot.name, options.grow_nodes) then
|
||||
if not options.grow_result and not options.grow_function then
|
||||
minetest.swap_node(pos, biome_lib.air)
|
||||
|
||||
else
|
||||
biome_lib:replace_object(pos, options.grow_result, options.grow_function, options.facedir, options.seed_diff)
|
||||
else
|
||||
biome_lib:replace_object(pos, options.grow_result, options.grow_function, options.facedir, options.seed_diff)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -158,13 +158,14 @@ default.register_fence("coloredwood:fence", {
|
||||
texture = "coloredwood_fence_base.png",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
material = "coloredwood:wood_block"
|
||||
})
|
||||
|
||||
minetest.override_item("default:fence_wood", {
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
airbrush_replacement_node = "coloredwood:fence",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1}
|
||||
})
|
||||
|
||||
|
@ -1,3 +1,2 @@
|
||||
default
|
||||
moreblocks
|
||||
caverealms
|
||||
|
@ -9,7 +9,8 @@ local cave_nodes = { -- Default stairs/slabs/panels/microblocks:
|
||||
"caverealms:glow_ruby_ore",
|
||||
"caverealms:salt_crystal",
|
||||
"caverealms:stone_with_salt",
|
||||
"caverealms:glow_obsidian"
|
||||
"caverealms:glow_obsidian",
|
||||
"caverealms:glow_obsidian_glass",
|
||||
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t
|
||||
|
||||
### Changelog:
|
||||
|
||||
- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection.
|
||||
- 1.41 - Each crop has it's own spawn rate (can be changed in farming.conf)
|
||||
- 1.40 - Added Mithril Scythe to quick harvest and replant crops on right-click. Added Hoe's for MoreOres with Toolrank support.
|
||||
- 1.39 - Added Rice, Rye and Oats thanks to Ademants Grains mod. Added Jaffa Cake and multigrain bread.
|
||||
|
@ -46,6 +46,8 @@ minetest.register_node("farming:jackolantern", {
|
||||
groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_punch = function(pos, node, puncher)
|
||||
local name = puncher:get_player_name() or ""
|
||||
if minetest.is_protected(pos, name) then return end
|
||||
node.name = "farming:jackolantern_on"
|
||||
minetest.swap_node(pos, node)
|
||||
end,
|
||||
@ -69,6 +71,8 @@ minetest.register_node("farming:jackolantern_on", {
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drop = "farming:jackolantern",
|
||||
on_punch = function(pos, node, puncher)
|
||||
local name = puncher:get_player_name() or ""
|
||||
if minetest.is_protected(pos, name) then return end
|
||||
node.name = "farming:jackolantern"
|
||||
minetest.swap_node(pos, node)
|
||||
end,
|
||||
|
@ -322,14 +322,14 @@ function farming.plant_growth_timer(pos, elapsed, node_name)
|
||||
end
|
||||
|
||||
local growth
|
||||
local light_pos = {x = pos.x, y = pos.y, z = pos.z} -- was y + 1
|
||||
local light_pos = {x = pos.x, y = pos.y, z = pos.z}
|
||||
local lambda = elapsed / STAGE_LENGTH_AVG
|
||||
|
||||
if lambda < 0.1 then
|
||||
return true
|
||||
end
|
||||
|
||||
local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 13
|
||||
local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 12
|
||||
local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or 15
|
||||
--print ("---", MIN_LIGHT, MAX_LIGHT)
|
||||
|
||||
@ -497,7 +497,7 @@ farming.register_plant = function(name, def)
|
||||
-- Check def
|
||||
def.description = def.description or S("Seed")
|
||||
def.inventory_image = def.inventory_image or "unknown_item.png"
|
||||
def.minlight = def.minlight or 13
|
||||
def.minlight = def.minlight or 12
|
||||
def.maxlight = def.maxlight or 15
|
||||
|
||||
-- Register seed
|
||||
|
@ -139,3 +139,6 @@ Created by PilzAdam and edited by SpaghettiToastBook (CC0):
|
||||
|
||||
Created by VanessaE and edited by SpaghettiToastBook (CC0):
|
||||
farming_flour_multigrain.png
|
||||
|
||||
Created by mDiyo (Natura), modified by TenPlus1 (License: CC BY-SA 3.0):
|
||||
farming_barley.png
|
||||
|
@ -52,7 +52,14 @@ minetest.register_abm({
|
||||
end
|
||||
|
||||
-- check if there is water nearby and change soil accordingly
|
||||
if minetest.find_node_near(pos, 3, {"group:water"}) then
|
||||
-- if minetest.find_node_near(pos, 3, {"group:water"}) then
|
||||
|
||||
-- check if water is within 3 nodes horizontally and 1 below
|
||||
if #minetest.find_nodes_in_area(
|
||||
{x = pos.x + 3, y = pos.y - 1, z = pos.z + 3},
|
||||
{x = pos.x - 3, y = pos.y , z = pos.z - 3},
|
||||
{"group:water"}) > 0 then
|
||||
|
||||
if node.name == "farming:soil" then
|
||||
minetest.set_node(pos, {name = "farming:soil_wet"})
|
||||
end
|
||||
@ -64,4 +71,4 @@ minetest.register_abm({
|
||||
minetest.set_node(pos, {name = "default:dirt"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
})
|
||||
|
@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
### Changed
|
||||
|
||||
- Stairs+ nodes now emit one light level less compared to full nodes to make up
|
||||
for their smaller visual size.
|
||||
- The minimum supported Minetest version is now 5.0.0.
|
||||
|
||||
## [1.3.0] - 2019-03-23
|
||||
|
@ -35,6 +35,9 @@ stairsplus.register_single = function(category, alternate, info, modname, subnam
|
||||
-- This makes node rotation work on placement
|
||||
def.place_param2 = nil
|
||||
|
||||
-- Darken light sources slightly to make up for their smaller visual size
|
||||
def.light_source = math.max(0, (def.light_source or 0) - 1)
|
||||
|
||||
def.on_place = minetest.rotate_node
|
||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||
|
||||
|
@ -14,8 +14,10 @@ stairsplus.expect_infinite_stacks = false
|
||||
|
||||
stairsplus.shapes_list = {}
|
||||
|
||||
if not minetest.get_modpath("unified_inventory")
|
||||
and minetest.settings:get_bool("creative_mode") then
|
||||
if
|
||||
not minetest.get_modpath("unified_inventory")
|
||||
and minetest.settings:get_bool("creative_mode")
|
||||
then
|
||||
stairsplus.expect_infinite_stacks = true
|
||||
end
|
||||
|
||||
@ -36,7 +38,7 @@ end
|
||||
|
||||
function stairsplus:register_all(modname, subname, recipeitem, fields)
|
||||
self:register_stair(modname, subname, recipeitem, fields)
|
||||
self:register_slab (modname, subname, recipeitem, fields)
|
||||
self:register_slab(modname, subname, recipeitem, fields)
|
||||
self:register_slope(modname, subname, recipeitem, fields)
|
||||
self:register_panel(modname, subname, recipeitem, fields)
|
||||
self:register_micro(modname, subname, recipeitem, fields)
|
||||
|
@ -122,8 +122,8 @@ moretrees.dates_item_drop_ichance = 10 -- inverse probability of ripe dates dr
|
||||
|
||||
-- Sapling settings
|
||||
|
||||
moretrees.sapling_interval = 500
|
||||
moretrees.sapling_chance = 20
|
||||
moretrees.sapling_interval = 100
|
||||
moretrees.sapling_chance = 5
|
||||
|
||||
-- If this variable is set to true, drop leaves out as entities during leaf
|
||||
-- decay, rather than just disappearing them.
|
||||
|
@ -212,7 +212,7 @@ for i in ipairs(moretrees.treelist) do
|
||||
end
|
||||
|
||||
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
||||
description = S(treedesc.." Sapling (on-generated)"),
|
||||
description = S(treedesc.." Sapling (fast growth)"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {saptex},
|
||||
inventory_image = saptex,
|
||||
@ -224,7 +224,7 @@ for i in ipairs(moretrees.treelist) do
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
||||
},
|
||||
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,not_in_creative_inventory=1,sapling=1},
|
||||
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
|
||||
sounds = default.node_sound_defaults(),
|
||||
drop = "moretrees:"..treename.."_sapling"
|
||||
})
|
||||
|
@ -1,98 +1,84 @@
|
||||
-- sapling growth
|
||||
-- these tables only affect hand-placed saplings
|
||||
-- mapgen-placed always use their biome def settings, which are much more
|
||||
-- limited, in the interest of speed.
|
||||
|
||||
local dirt_surfaces = {
|
||||
set = true,
|
||||
["default:dirt"] = true,
|
||||
["default:dirt_with_grass"] = true,
|
||||
["default:dirt_with_dry_grass"] = true,
|
||||
["default:dirt_with_coniferous_litter"] = true,
|
||||
["default:dirt_with_rainforest_litter"] = true,
|
||||
["woodsoils:dirt_with_leaves_1"] = true,
|
||||
["woodsoils:dirt_with_leaves_2"] = true,
|
||||
["woodsoils:grass_with_leaves_1"] = true,
|
||||
["woodsoils:grass_with_leaves_2"] = true
|
||||
}
|
||||
|
||||
local conifer_surfaces = {
|
||||
set = true,
|
||||
["default:dirt"] = true,
|
||||
["default:dirt_with_grass"] = true,
|
||||
["default:dirt_with_dry_grass"] = true,
|
||||
["default:dirt_with_coniferous_litter"] = true,
|
||||
["default:dirt_with_rainforest_litter"] = true,
|
||||
["woodsoils:dirt_with_leaves_1"] = true,
|
||||
["woodsoils:dirt_with_leaves_2"] = true,
|
||||
["woodsoils:grass_with_leaves_1"] = true,
|
||||
["woodsoils:grass_with_leaves_2"] = true,
|
||||
["default:dirt_with_snow"] = true
|
||||
}
|
||||
|
||||
local sand_surfaces = {
|
||||
set = true,
|
||||
["default:sand"] = true,
|
||||
["default:desert_sand"] = true,
|
||||
["cottages:loam"] = true,
|
||||
-- note, no silver sand here.
|
||||
-- too cold for a palm, too... well... sandy for anything else.
|
||||
}
|
||||
|
||||
for i in ipairs(moretrees.treelist) do
|
||||
local treename = moretrees.treelist[i][1]
|
||||
local tree_model = treename.."_model"
|
||||
local tree_biome = treename.."_biome"
|
||||
local surfaces
|
||||
local grow_function = moretrees[tree_model]
|
||||
|
||||
if treename ~= "birch" and treename ~= "spruce" and treename ~= "fir" and treename ~= "jungletree" then
|
||||
|
||||
biome_lib:dbg(dump(moretrees[tree_biome].surface))
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = moretrees.sapling_interval,
|
||||
grow_chance = moretrees.sapling_chance,
|
||||
grow_plant = "moretrees:"..treename.."_sapling",
|
||||
grow_nodes = moretrees[tree_biome].surface,
|
||||
grow_function = moretrees[tree_model],
|
||||
})
|
||||
|
||||
if moretrees.spawn_saplings then
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = 2,
|
||||
grow_chance = 30,
|
||||
grow_plant = "moretrees:"..treename.."_sapling_ongen",
|
||||
grow_nodes = moretrees[tree_biome].surface,
|
||||
grow_function = moretrees[tree_model],
|
||||
})
|
||||
end
|
||||
|
||||
if treename == "spruce"
|
||||
or treename == "fir"
|
||||
or treename == "cedar"
|
||||
or treename == "pine" then
|
||||
surfaces = conifer_surfaces
|
||||
elseif string.find(treename, "palm") then
|
||||
surfaces = sand_surfaces
|
||||
else
|
||||
surfaces = dirt_surfaces
|
||||
end
|
||||
end
|
||||
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = moretrees.sapling_interval,
|
||||
grow_chance = moretrees.sapling_chance,
|
||||
grow_plant = "moretrees:birch_sapling",
|
||||
grow_nodes = moretrees.birch_biome.surface,
|
||||
grow_function = "moretrees.grow_birch"
|
||||
})
|
||||
if treename == "spruce"
|
||||
or treename == "fir"
|
||||
or treename == "birch"
|
||||
or treename == "jungletree" then
|
||||
grow_function = "moretrees.grow_"..treename
|
||||
end
|
||||
|
||||
biome_lib:dbg(dump(moretrees[tree_biome].surface))
|
||||
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = moretrees.sapling_interval,
|
||||
grow_chance = moretrees.sapling_chance,
|
||||
grow_plant = "moretrees:spruce_sapling",
|
||||
grow_nodes = moretrees.spruce_biome.surface,
|
||||
grow_function = "moretrees.grow_spruce"
|
||||
})
|
||||
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = moretrees.sapling_interval,
|
||||
grow_chance = moretrees.sapling_chance,
|
||||
grow_plant = "moretrees:fir_sapling",
|
||||
grow_nodes = moretrees.fir_biome.surface,
|
||||
grow_function = "moretrees.grow_fir"
|
||||
})
|
||||
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = moretrees.sapling_interval,
|
||||
grow_chance = moretrees.sapling_chance,
|
||||
grow_plant = "default:junglesapling",
|
||||
grow_nodes = moretrees.jungletree_biome.surface,
|
||||
grow_function = "moretrees.grow_jungletree"
|
||||
})
|
||||
|
||||
if moretrees.spawn_saplings then
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = 2,
|
||||
grow_chance = 30,
|
||||
grow_plant = "moretrees:jungletree_sapling_ongen",
|
||||
grow_nodes = moretrees.jungletree_biome.surface,
|
||||
grow_function = "moretrees.grow_jungletree"
|
||||
grow_delay = moretrees.sapling_interval,
|
||||
grow_chance = moretrees.sapling_chance,
|
||||
grow_plant = "moretrees:"..treename.."_sapling",
|
||||
grow_nodes = surfaces,
|
||||
grow_function = grow_function,
|
||||
})
|
||||
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = 2,
|
||||
grow_chance = 30,
|
||||
grow_plant = "moretrees:fir_sapling_ongen",
|
||||
grow_nodes = moretrees.fir_biome.surface,
|
||||
grow_function = "moretrees.grow_fir"
|
||||
})
|
||||
|
||||
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = 2,
|
||||
grow_chance = 30,
|
||||
grow_plant = "moretrees:spruce_sapling_ongen",
|
||||
grow_nodes = moretrees.spruce_biome.surface,
|
||||
grow_function = "moretrees.grow_spruce"
|
||||
})
|
||||
|
||||
biome_lib:grow_plants({
|
||||
grow_delay = 2,
|
||||
grow_chance = 30,
|
||||
grow_plant = "moretrees:birch_sapling_ongen",
|
||||
grow_nodes = moretrees.birch_biome.surface,
|
||||
grow_function = "moretrees.grow_birch"
|
||||
grow_chance = 1,
|
||||
grow_plant = "moretrees:"..treename.."_sapling_ongen",
|
||||
grow_nodes = surfaces,
|
||||
grow_function = grow_function,
|
||||
})
|
||||
end
|
||||
|
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ local S = plantlife_i18n.gettext
|
||||
minetest.register_craftitem("vines:vines", {
|
||||
description = S("Vines"),
|
||||
inventory_image = "vines_item.png",
|
||||
group = {vines = 1, flammable = 2}
|
||||
groups = {vines = 1, flammable = 2}
|
||||
})
|
||||
|
||||
-- FUNCTIONS
|
||||
|
Loading…
x
Reference in New Issue
Block a user