This commit is contained in:
root 2022-01-16 20:12:39 +01:00
parent b999fa4dc5
commit 4f66b7fd4b
24 changed files with 171 additions and 112 deletions

View File

@ -33,5 +33,6 @@ Changelog:
- 1.1 - Added {can_bonemeal=1} group for special nodes
- 1.2 - Added support for minetest 5.0 cactus seedling, blueberry bush sapling and emergent jungle tree saplings, additional flowers and pine bush sapling.
- 1.3 - Ability to craft dye from mulch, bonemeal and fertiliser (thanks orbea)
- 1.4 - Add support for fern saplings from plantlife mod (thanks nixnoxus)
Lucky Blocks: 6

View File

@ -7,3 +7,5 @@ technic_worldgen?
lucky_block?
flowers?
dye?
ferns?
dryplants?

View File

@ -689,4 +689,4 @@ minetest.override_item("default:dirt", {
dofile(path .. "/mods.lua")
dofile(path .. "/lucky_block.lua")
print (S("[MOD] bonemeal loaded"))
print ("[MOD] bonemeal loaded")

View File

@ -22,8 +22,7 @@ if minetest.get_modpath("lucky_block") then
{"nod", "default:chest", 0, {
{name = "bonemeal:mulch", max = 20},
{name = "bonemeal:bonemeal", max = 15},
{name = "bonemeal:fertiliser", max = 10},
}},
{name = "bonemeal:fertiliser", max = 10}
}}
})
end

View File

@ -1,4 +1,4 @@
name = bonemeal
depends = default
optional_depends = intllib, lucky_block, farming, ethereal, moretrees, technic_worldgen, flowers, dye
optional_depends = intllib, lucky_block, farming, ethereal, moretrees, technic_worldgen, flowers, dye, ferns, dryplants
description = Adds bone and bonemeal giving the ability to quickly grow plants and saplings.

View File

@ -3,9 +3,8 @@
if minetest.get_modpath("animalmaterials") then
minetest.register_craft({
type = "shapeless",
output = "bonemeal:bonemeal 2",
recipe = {"animalmaterials:bone"}
recipe = {{"animalmaterials:bone"}}
})
end
@ -115,13 +114,11 @@ if minetest.get_modpath("moretrees") then
{"moretrees:apple_tree_sapling", moretrees.spawn_apple_tree_object, "soil"},
{"moretrees:oak_sapling", moretrees.spawn_oak_object, "soil"},
{"moretrees:sequoia_sapling", moretrees.spawn_sequoia_object, "soil"},
--{"moretrees:birch_sapling", moretrees.spawn_birch_object, "soil"},
{"moretrees:birch_sapling", moretrees.grow_birch, "soil"},
{"moretrees:palm_sapling", moretrees.spawn_palm_object, "soil"},
{"moretrees:palm_sapling", moretrees.spawn_palm_object, "sand"},
{"moretrees:date_palm_sapling", moretrees.spawn_date_palm_object, "soil"},
{"moretrees:date_palm_sapling", moretrees.spawn_date_palm_object, "sand"},
--{"moretrees:spruce_sapling", moretrees.spawn_spruce_object, "soil"},
{"moretrees:spruce_sapling", moretrees.grow_spruce, "soil"},
{"moretrees:cedar_sapling", moretrees.spawn_cedar_object, "soil"},
{"moretrees:poplar_sapling", moretrees.spawn_poplar_object, "soil"},
@ -155,6 +152,29 @@ if minetest.get_modpath("caverealms") then
end
local function y_func(grow_func)
return function(pos)
grow_func({x = pos.x, y = pos.y - 1, z = pos.z})
end
end
if minetest.get_modpath("ferns") then
bonemeal:add_sapling({
{"ferns:sapling_giant_tree_fern", y_func(abstract_ferns.grow_giant_tree_fern), "soil"},
{"ferns:sapling_giant_tree_fern", y_func(abstract_ferns.grow_giant_tree_fern), "sand"},
{"ferns:sapling_tree_fern", y_func(abstract_ferns.grow_tree_fern), "soil"}
})
end
if minetest.get_modpath("dryplants") then
bonemeal:add_sapling({
{"dryplants:reedmace_sapling", y_func(abstract_dryplants.grow_reedmace), "soil"}
})
end
if minetest.get_modpath("dye") then
local bonemeal_dyes = {

View File

@ -508,7 +508,7 @@ function doors.register(name, def)
def.paramtype = "light"
def.paramtype2 = "facedir"
def.sunlight_propagates = true
def.use_texture_alpha = "clip"
def.use_texture_alpha = def.use_texture_alpha or "clip"
def.walkable = true
def.is_ground_content = false
def.buildable_to = false
@ -719,7 +719,7 @@ function doors.register_trapdoor(name, def)
def.drawtype = "nodebox"
def.paramtype = "light"
def.paramtype2 = "facedir"
def.use_texture_alpha = "clip"
def.use_texture_alpha = def.use_texture_alpha or "clip"
def.is_ground_content = false
if def.protected then

View File

@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = {
mod = "redo",
version = "20211212",
version = "20220116",
intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {}
}
@ -1002,19 +1002,19 @@ end
-- Returns true is node can deal damage to self
local is_node_dangerous = function(self, nodename)
function mobs:is_node_dangerous(mob_object, nodename)
if self.water_damage > 0
if mob_object.water_damage > 0
and minetest.get_item_group(nodename, "water") ~= 0 then
return true
end
if self.lava_damage > 0
if mob_object.lava_damage > 0
and minetest.get_item_group(nodename, "lava") ~= 0 then
return true
end
if self.fire_damage > 0
if mob_object.fire_damage > 0
and minetest.get_item_group(nodename, "fire") ~= 0 then
return true
end
@ -1026,6 +1026,10 @@ local is_node_dangerous = function(self, nodename)
return false
end
local function is_node_dangerous(mob_object, nodename)
return mobs:is_node_dangerous(mob_object, nodename)
end
-- is mob facing a cliff
function mob_class:is_at_cliff()

View File

@ -691,6 +691,12 @@ space to spawn mob [name], if so then a new position is returned for use,
otherwise nil is returned.
mobs:is_node_dangerous(self, nodename)
This function returns true if the node name given is harmful to the mob (self), it is
mainly used when a mob is near a node it has to avoid.
External Settings for "minetest.conf"
------------------------------------

View File

@ -264,7 +264,8 @@ minetest.register_node("dryplants:reedmace_sapling", {
groups = {
snappy=3,
flammable=2,
attached_node=1
attached_node=1,
sapling=1,
},
sounds = default.node_sound_leaves_defaults(),
selection_box = {

View File

@ -162,6 +162,14 @@ minetest.register_node("ferns:tree_fern_leave_big", {
},
drop = "",
sounds = default.node_sound_leaves_defaults(),
after_destruct = function(pos,oldnode)
for _, d in pairs({{x=-1,z=0},{x=1,z=0},{x=0,z=-1},{x=0,z=1}}) do
local node = minetest.get_node({x=pos.x+d.x,y=pos.y+1,z=pos.z+d.z})
if node.name == "ferns:tree_fern_leave_big" then
minetest.dig_node({x=pos.x+d.x,y=pos.y+1,z=pos.z+d.z})
end
end
end,
})
-----------------------------------------------------------------------------------------------
@ -271,7 +279,7 @@ minetest.register_node("ferns:sapling_giant_tree_fern", {
tiles = {"ferns_sapling_tree_fern_giant.png"},
inventory_image = "ferns_sapling_tree_fern_giant.png",
walkable = false,
groups = {snappy=3,flammable=2,flora=1,attached_node=1},
groups = {snappy=3,flammable=2,flora=1,attached_node=1,sapling=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",

View File

@ -158,7 +158,7 @@ minetest.register_node("ferns:sapling_tree_fern", {
tiles = {"ferns_sapling_tree_fern.png"},
inventory_image = "ferns_sapling_tree_fern.png",
walkable = false,
groups = {snappy=3,flammable=2,flora=1,attached_node=1},
groups = {snappy=3,flammable=2,flora=1,attached_node=1,sapling=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",

View File

@ -0,0 +1,3 @@
SatchelmanSam
Philipbenr
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
olli
olli
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
bab-cora
cora
CC 0 (1.0)

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -55,7 +55,7 @@ optional: intllib
## License
Copyright (C) 2017-2021 Joachim Stolberg
Copyright (C) 2017-2022 Joachim Stolberg
Code: Licensed under the GNU LGPL version 2.1 or later.
See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt
Textures: CC0
@ -89,5 +89,6 @@ Textures: CC0
- 2020-05-31 v1.9 * Generator function 'get_tube_line' added, storage improvements
- 2021-01-23 v2.0 * Add functions for easy & fast 'valid side' checking (PR #8)
- 2021-05-24 v2.1 * Add API functions 'register_on_tube_update2'
- 2022-01-05 v2.2 * Extend the 'node.param2' support for all 24 possible values

View File

@ -13,7 +13,7 @@
]]--
-- Version for compatibility checks, see readme.md/history
tubelib2.version = 2.1
tubelib2.version = 2.2
-- for lazy programmers
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
@ -31,23 +31,31 @@ function tubelib2.dir_to_string(dir)
end
-- Relative directions, dependant on orientation (param2)
local DirToSide = {"B", "R", "F", "L", "D", "U"}
local DirToSide = {
-- param2 (0 to 23)
{[0]="B","L","F","R", "U","U","U","U", "D","D","D","D", "B","L","F","R", "B","L","F","R", "B","L","F","R",}, -- dir = 1
{[0]="R","B","L","F", "R","B","L","F", "R","B","L","F", "U","U","U","U", "D","D","D","D", "L","F","R","B",}, -- dir = 2
{[0]="F","R","B","L", "D","D","D","D", "U","U","U","U", "F","R","B","L", "F","R","B","L", "F","R","B","L",}, -- dir = 3
{[0]="L","F","R","B", "L","F","R","B", "L","F","R","B", "D","D","D","D", "U","U","U","U", "R","B","L","F",}, -- dir = 4
{[0]="D","D","D","D", "B","L","F","R", "F","R","B","L", "R","B","L","F", "L","F","R","B", "U","U","U","U",}, -- dir = 5
{[0]="U","U","U","U", "F","R","B","L", "B","L","F","R", "L","F","R","B", "R","B","L","F", "D","D","D","D",}, -- dir = 6
}
function tubelib2.dir_to_side(dir, param2)
if dir < 5 then
dir = (((dir - 1) - (param2 % 4)) % 4) + 1
local SideToDir = {B={}, R={}, F={}, L={}, D={}, U={}}
for param2 = 0,23 do
for dir = 1,6 do
local side = DirToSide[dir][param2]
SideToDir[side][param2] = dir
end
return DirToSide[dir]
end
local SideToDir = {B=1, R=2, F=3, L=4, D=5, U=6}
function tubelib2.dir_to_side(dir, param2)
return DirToSide[dir][param2]
end
function tubelib2.side_to_dir(side, param2)
local dir = SideToDir[side]
if dir < 5 then
dir = (((dir - 1) + (param2 % 4)) % 4) + 1
end
return dir
return SideToDir[side][param2]
end
@ -234,7 +242,7 @@ local function invert_booleans(tab)
end
return inversion
end
local valid_sides_default_true = Tbl(DirToSide)
local valid_sides_default_true = Tbl({"B", "R", "F", "L", "D", "U"})
local valid_sides_default_false = invert_booleans(valid_sides_default_true)
local function complete_valid_sides(valid_sides, existing_defaults)
local valid_sides_complete = {}