2012-12-03 23:20:50 +01:00
|
|
|
-- This file supplies jungle grass for the plantlife modpack
|
Changed plants_lib API to require a table argument when not using legacy
calling options. This opens the door for even more features in the future.
Changed flowers, junglegrass, poisonivy to match.
Made plants lib faster in some places, especially the surface-hunting
algorithm, and especially over water. Fixed a few other misc. bugs.
Made growth code properly execute all biome-control code before executing
any string-named function or spawn_tree().
Tuned flowers settings. Made flowers require at least some light to spawn,
made waterlilies require shallower water. Fixed a bug in water depth detection
and made water depth depend on whether the bottom of the water area is dirt,
dirt with grass, or sand, rather than just anything.
Made waterlilies randomly rotate on spawning to break up the patterns (now has
16 orientations with the help of nodeboxes and facedir, requires only 3 new
nodes). Smoothed edges of the regular waterlily texture. Made all flowers and
water- lilies spawn using only 3 ABM calls instead of 8.
Got rid of colon prefix node def overrides on all plants, since this is a
modpack now instead of an integrated mod. Fixed a misspelled folder name for
poisonivy.
Fixed a bug in the wall detection routine - it returned the last wall found,
not the first.
Made the top-side-check for air only apply when spawning on top of the
target rather than its sides/bottom.
Many other features and enhancements have been made. Too many to list here.
Please see API.txt for details.
2013-01-25 05:21:57 +01:00
|
|
|
-- Last revision: 2013-01-24
|
2012-12-03 23:20:50 +01:00
|
|
|
|
Changed plants_lib API to require a table argument when not using legacy
calling options. This opens the door for even more features in the future.
Changed flowers, junglegrass, poisonivy to match.
Made plants lib faster in some places, especially the surface-hunting
algorithm, and especially over water. Fixed a few other misc. bugs.
Made growth code properly execute all biome-control code before executing
any string-named function or spawn_tree().
Tuned flowers settings. Made flowers require at least some light to spawn,
made waterlilies require shallower water. Fixed a bug in water depth detection
and made water depth depend on whether the bottom of the water area is dirt,
dirt with grass, or sand, rather than just anything.
Made waterlilies randomly rotate on spawning to break up the patterns (now has
16 orientations with the help of nodeboxes and facedir, requires only 3 new
nodes). Smoothed edges of the regular waterlily texture. Made all flowers and
water- lilies spawn using only 3 ABM calls instead of 8.
Got rid of colon prefix node def overrides on all plants, since this is a
modpack now instead of an integrated mod. Fixed a misspelled folder name for
poisonivy.
Fixed a bug in the wall detection routine - it returned the last wall found,
not the first.
Made the top-side-check for air only apply when spawning on top of the
target rather than its sides/bottom.
Many other features and enhancements have been made. Too many to list here.
Please see API.txt for details.
2013-01-25 05:21:57 +01:00
|
|
|
local SPAWN_DELAY = 1000
|
|
|
|
local SPAWN_CHANCE = 200
|
|
|
|
local GROW_DELAY = 500
|
|
|
|
local GROW_CHANCE = 30
|
|
|
|
local junglegrass_seed_diff = 329
|
2012-12-03 23:20:50 +01:00
|
|
|
|
|
|
|
local grasses_list = {
|
|
|
|
{"junglegrass:shortest","junglegrass:short" },
|
|
|
|
{"junglegrass:short" ,"junglegrass:medium" },
|
|
|
|
{"junglegrass:medium" ,"default:junglegrass" },
|
|
|
|
{"default:junglegrass" , nil}
|
|
|
|
}
|
|
|
|
|
2013-11-02 21:57:32 +01:00
|
|
|
if not minetest.registered_nodes["default:junglegrass"] then
|
|
|
|
minetest.register_node(":default:junglegrass", {
|
|
|
|
description = "Jungle Grass",
|
|
|
|
drawtype = "plantlike",
|
|
|
|
visual_scale = 1.3,
|
|
|
|
tiles = {"default_junglegrass.png"},
|
|
|
|
inventory_image = "default_junglegrass.png",
|
|
|
|
wield_image = "default_junglegrass.png",
|
|
|
|
paramtype = "light",
|
|
|
|
walkable = false,
|
|
|
|
buildable_to = true,
|
|
|
|
is_ground_content = true,
|
|
|
|
groups = {snappy=3,flammable=2,flora=1,attached_node=1, junglegrass=1},
|
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
else
|
2013-11-03 00:52:08 +01:00
|
|
|
new_junglegrass=plantslib:clone_node("default:junglegrass")
|
2013-11-02 22:32:15 +01:00
|
|
|
new_junglegrass.groups.junglegrass = 1
|
2013-11-02 21:57:32 +01:00
|
|
|
minetest.register_node(":default:junglegrass", new_junglegrass)
|
|
|
|
end
|
|
|
|
|
Changed plants_lib API to require a table argument when not using legacy
calling options. This opens the door for even more features in the future.
Changed flowers, junglegrass, poisonivy to match.
Made plants lib faster in some places, especially the surface-hunting
algorithm, and especially over water. Fixed a few other misc. bugs.
Made growth code properly execute all biome-control code before executing
any string-named function or spawn_tree().
Tuned flowers settings. Made flowers require at least some light to spawn,
made waterlilies require shallower water. Fixed a bug in water depth detection
and made water depth depend on whether the bottom of the water area is dirt,
dirt with grass, or sand, rather than just anything.
Made waterlilies randomly rotate on spawning to break up the patterns (now has
16 orientations with the help of nodeboxes and facedir, requires only 3 new
nodes). Smoothed edges of the regular waterlily texture. Made all flowers and
water- lilies spawn using only 3 ABM calls instead of 8.
Got rid of colon prefix node def overrides on all plants, since this is a
modpack now instead of an integrated mod. Fixed a misspelled folder name for
poisonivy.
Fixed a bug in the wall detection routine - it returned the last wall found,
not the first.
Made the top-side-check for air only apply when spawning on top of the
target rather than its sides/bottom.
Many other features and enhancements have been made. Too many to list here.
Please see API.txt for details.
2013-01-25 05:21:57 +01:00
|
|
|
minetest.register_node('junglegrass:medium', {
|
2012-12-03 23:20:50 +01:00
|
|
|
description = "Jungle Grass (medium height)",
|
|
|
|
drawtype = 'plantlike',
|
2013-11-27 09:36:22 +01:00
|
|
|
waving = 1,
|
2012-12-03 23:20:50 +01:00
|
|
|
tile_images = { 'junglegrass_medium.png' },
|
|
|
|
inventory_image = 'junglegrass_medium.png',
|
|
|
|
wield_image = 'junglegrass_medium.png',
|
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = 'light',
|
|
|
|
walkable = false,
|
2013-04-26 11:48:38 +02:00
|
|
|
groups = { snappy = 3, flammable=2, junglegrass=1, flora=1 },
|
2012-12-03 23:20:50 +01:00
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
drop = 'default:junglegrass',
|
|
|
|
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.4, -0.5, -0.4, 0.4, 0.5, 0.4},
|
|
|
|
},
|
2013-03-20 16:37:11 +01:00
|
|
|
buildable_to = true,
|
2012-12-03 23:20:50 +01:00
|
|
|
})
|
|
|
|
|
Changed plants_lib API to require a table argument when not using legacy
calling options. This opens the door for even more features in the future.
Changed flowers, junglegrass, poisonivy to match.
Made plants lib faster in some places, especially the surface-hunting
algorithm, and especially over water. Fixed a few other misc. bugs.
Made growth code properly execute all biome-control code before executing
any string-named function or spawn_tree().
Tuned flowers settings. Made flowers require at least some light to spawn,
made waterlilies require shallower water. Fixed a bug in water depth detection
and made water depth depend on whether the bottom of the water area is dirt,
dirt with grass, or sand, rather than just anything.
Made waterlilies randomly rotate on spawning to break up the patterns (now has
16 orientations with the help of nodeboxes and facedir, requires only 3 new
nodes). Smoothed edges of the regular waterlily texture. Made all flowers and
water- lilies spawn using only 3 ABM calls instead of 8.
Got rid of colon prefix node def overrides on all plants, since this is a
modpack now instead of an integrated mod. Fixed a misspelled folder name for
poisonivy.
Fixed a bug in the wall detection routine - it returned the last wall found,
not the first.
Made the top-side-check for air only apply when spawning on top of the
target rather than its sides/bottom.
Many other features and enhancements have been made. Too many to list here.
Please see API.txt for details.
2013-01-25 05:21:57 +01:00
|
|
|
minetest.register_node('junglegrass:short', {
|
2012-12-03 23:20:50 +01:00
|
|
|
description = "Jungle Grass (short)",
|
|
|
|
drawtype = 'plantlike',
|
2013-11-27 09:36:22 +01:00
|
|
|
waving = 1,
|
2012-12-03 23:20:50 +01:00
|
|
|
tile_images = { 'junglegrass_short.png' },
|
|
|
|
inventory_image = 'junglegrass_short.png',
|
|
|
|
wield_image = 'junglegrass_short.png',
|
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = 'light',
|
|
|
|
walkable = false,
|
2013-04-26 11:48:38 +02:00
|
|
|
groups = { snappy = 3, flammable=2, junglegrass=1, flora=1 },
|
2012-12-03 23:20:50 +01:00
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
drop = 'default:junglegrass',
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.4, -0.5, -0.4, 0.4, 0.3, 0.4},
|
|
|
|
},
|
2013-03-20 16:37:11 +01:00
|
|
|
buildable_to = true,
|
2012-12-03 23:20:50 +01:00
|
|
|
})
|
|
|
|
|
Changed plants_lib API to require a table argument when not using legacy
calling options. This opens the door for even more features in the future.
Changed flowers, junglegrass, poisonivy to match.
Made plants lib faster in some places, especially the surface-hunting
algorithm, and especially over water. Fixed a few other misc. bugs.
Made growth code properly execute all biome-control code before executing
any string-named function or spawn_tree().
Tuned flowers settings. Made flowers require at least some light to spawn,
made waterlilies require shallower water. Fixed a bug in water depth detection
and made water depth depend on whether the bottom of the water area is dirt,
dirt with grass, or sand, rather than just anything.
Made waterlilies randomly rotate on spawning to break up the patterns (now has
16 orientations with the help of nodeboxes and facedir, requires only 3 new
nodes). Smoothed edges of the regular waterlily texture. Made all flowers and
water- lilies spawn using only 3 ABM calls instead of 8.
Got rid of colon prefix node def overrides on all plants, since this is a
modpack now instead of an integrated mod. Fixed a misspelled folder name for
poisonivy.
Fixed a bug in the wall detection routine - it returned the last wall found,
not the first.
Made the top-side-check for air only apply when spawning on top of the
target rather than its sides/bottom.
Many other features and enhancements have been made. Too many to list here.
Please see API.txt for details.
2013-01-25 05:21:57 +01:00
|
|
|
minetest.register_node('junglegrass:shortest', {
|
2012-12-03 23:20:50 +01:00
|
|
|
description = "Jungle Grass (very short)",
|
|
|
|
drawtype = 'plantlike',
|
2013-11-27 09:36:22 +01:00
|
|
|
waving = 1,
|
2012-12-03 23:20:50 +01:00
|
|
|
tile_images = { 'junglegrass_shortest.png' },
|
|
|
|
inventory_image = 'junglegrass_shortest.png',
|
|
|
|
wield_image = 'junglegrass_shortest.png',
|
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = 'light',
|
|
|
|
walkable = false,
|
2013-04-26 11:48:38 +02:00
|
|
|
groups = { snappy = 3, flammable=2, junglegrass=1, flora=1 },
|
2012-12-03 23:20:50 +01:00
|
|
|
sounds = default.node_sound_leaves_defaults(),
|
|
|
|
drop = 'default:junglegrass',
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3},
|
|
|
|
},
|
2013-03-20 16:37:11 +01:00
|
|
|
buildable_to = true,
|
2012-12-03 23:20:50 +01:00
|
|
|
})
|
|
|
|
|
Changed plants_lib API to require a table argument when not using legacy
calling options. This opens the door for even more features in the future.
Changed flowers, junglegrass, poisonivy to match.
Made plants lib faster in some places, especially the surface-hunting
algorithm, and especially over water. Fixed a few other misc. bugs.
Made growth code properly execute all biome-control code before executing
any string-named function or spawn_tree().
Tuned flowers settings. Made flowers require at least some light to spawn,
made waterlilies require shallower water. Fixed a bug in water depth detection
and made water depth depend on whether the bottom of the water area is dirt,
dirt with grass, or sand, rather than just anything.
Made waterlilies randomly rotate on spawning to break up the patterns (now has
16 orientations with the help of nodeboxes and facedir, requires only 3 new
nodes). Smoothed edges of the regular waterlily texture. Made all flowers and
water- lilies spawn using only 3 ABM calls instead of 8.
Got rid of colon prefix node def overrides on all plants, since this is a
modpack now instead of an integrated mod. Fixed a misspelled folder name for
poisonivy.
Fixed a bug in the wall detection routine - it returned the last wall found,
not the first.
Made the top-side-check for air only apply when spawning on top of the
target rather than its sides/bottom.
Many other features and enhancements have been made. Too many to list here.
Please see API.txt for details.
2013-01-25 05:21:57 +01:00
|
|
|
plantslib:spawn_on_surfaces({
|
|
|
|
spawn_delay = SPAWN_DELAY,
|
|
|
|
spawn_plants = {"junglegrass:shortest"},
|
|
|
|
avoid_radius = 4,
|
|
|
|
spawn_chance = SPAWN_CHANCE,
|
|
|
|
spawn_surfaces = {"default:dirt_with_grass", "default:cactus", "default:papyrus"},
|
|
|
|
avoid_nodes = {"group:junglegrass", "default:junglegrass", "default:dry_shrub"},
|
|
|
|
seed_diff = junglegrass_seed_diff,
|
|
|
|
light_min = 5
|
|
|
|
})
|
|
|
|
|
|
|
|
plantslib:spawn_on_surfaces({
|
|
|
|
spawn_delay = SPAWN_DELAY,
|
|
|
|
spawn_plants = {"junglegrass:shortest"},
|
|
|
|
avoid_radius = 4,
|
|
|
|
spawn_chance = SPAWN_CHANCE*2,
|
|
|
|
spawn_surfaces = {"default:sand"},
|
|
|
|
avoid_nodes = {"group:junglegrass", "default:junglegrass", "default:dry_shrub"},
|
|
|
|
seed_diff = junglegrass_seed_diff,
|
|
|
|
light_min = 5
|
|
|
|
})
|
|
|
|
|
|
|
|
plantslib:spawn_on_surfaces({
|
|
|
|
spawn_delay = SPAWN_DELAY,
|
|
|
|
spawn_plants = {"junglegrass:shortest"},
|
|
|
|
avoid_radius = 4,
|
|
|
|
spawn_chance = SPAWN_CHANCE*5,
|
|
|
|
spawn_surfaces = {"default:desert_sand"},
|
|
|
|
avoid_nodes = {"group:junglegrass", "default:junglegrass", "default:dry_shrub"},
|
|
|
|
seed_diff = junglegrass_seed_diff,
|
|
|
|
light_min = 5
|
|
|
|
})
|
2012-12-03 23:20:50 +01:00
|
|
|
|
|
|
|
for i in ipairs(grasses_list) do
|
Changed plants_lib API to require a table argument when not using legacy
calling options. This opens the door for even more features in the future.
Changed flowers, junglegrass, poisonivy to match.
Made plants lib faster in some places, especially the surface-hunting
algorithm, and especially over water. Fixed a few other misc. bugs.
Made growth code properly execute all biome-control code before executing
any string-named function or spawn_tree().
Tuned flowers settings. Made flowers require at least some light to spawn,
made waterlilies require shallower water. Fixed a bug in water depth detection
and made water depth depend on whether the bottom of the water area is dirt,
dirt with grass, or sand, rather than just anything.
Made waterlilies randomly rotate on spawning to break up the patterns (now has
16 orientations with the help of nodeboxes and facedir, requires only 3 new
nodes). Smoothed edges of the regular waterlily texture. Made all flowers and
water- lilies spawn using only 3 ABM calls instead of 8.
Got rid of colon prefix node def overrides on all plants, since this is a
modpack now instead of an integrated mod. Fixed a misspelled folder name for
poisonivy.
Fixed a bug in the wall detection routine - it returned the last wall found,
not the first.
Made the top-side-check for air only apply when spawning on top of the
target rather than its sides/bottom.
Many other features and enhancements have been made. Too many to list here.
Please see API.txt for details.
2013-01-25 05:21:57 +01:00
|
|
|
plantslib:grow_plants({
|
|
|
|
grow_delay = GROW_DELAY,
|
|
|
|
grow_chance = GROW_CHANCE/2,
|
|
|
|
grow_plant = grasses_list[i][1],
|
|
|
|
grow_result = grasses_list[i][2],
|
|
|
|
dry_early_node = "default:desert_sand",
|
|
|
|
grow_nodes = {"default:dirt_with_grass", "default:sand", "default:desert_sand"}
|
|
|
|
})
|
2012-12-03 23:20:50 +01:00
|
|
|
end
|
|
|
|
|
Changed plants_lib API to require a table argument when not using legacy
calling options. This opens the door for even more features in the future.
Changed flowers, junglegrass, poisonivy to match.
Made plants lib faster in some places, especially the surface-hunting
algorithm, and especially over water. Fixed a few other misc. bugs.
Made growth code properly execute all biome-control code before executing
any string-named function or spawn_tree().
Tuned flowers settings. Made flowers require at least some light to spawn,
made waterlilies require shallower water. Fixed a bug in water depth detection
and made water depth depend on whether the bottom of the water area is dirt,
dirt with grass, or sand, rather than just anything.
Made waterlilies randomly rotate on spawning to break up the patterns (now has
16 orientations with the help of nodeboxes and facedir, requires only 3 new
nodes). Smoothed edges of the regular waterlily texture. Made all flowers and
water- lilies spawn using only 3 ABM calls instead of 8.
Got rid of colon prefix node def overrides on all plants, since this is a
modpack now instead of an integrated mod. Fixed a misspelled folder name for
poisonivy.
Fixed a bug in the wall detection routine - it returned the last wall found,
not the first.
Made the top-side-check for air only apply when spawning on top of the
target rather than its sides/bottom.
Many other features and enhancements have been made. Too many to list here.
Please see API.txt for details.
2013-01-25 05:21:57 +01:00
|
|
|
print("[Junglegrass] Loaded.")
|