plantlife_modpack/poisonivy/init.lua

105 lines
2.8 KiB
Lua
Raw Normal View History

2013-01-25 05:21:57 +01:00
-- This file supplies poison ivy for the plantlife modpack
-- Last revision: 2013-01-24
-- support for i18n
local S = minetest.get_translator("poisonivy")
2014-03-12 19:36:42 +01:00
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 poisonivy_seed_diff = 339
local walls_list = {
"default:dirt",
"default:dirt_with_grass",
"default:stone",
"default:cobble",
"default:mossycobble",
"default:brick",
"default:tree",
"default:jungletree",
"default:stone_with_coal",
"default:stone_with_iron"
2013-01-25 05:21:57 +01:00
},
minetest.register_node('poisonivy:seedling', {
2014-03-12 19:36:42 +01:00
description = S("Poison ivy (seedling)"),
2013-01-25 05:21:57 +01:00
drawtype = 'plantlike',
waving = 1,
2015-10-23 19:08:58 +02:00
tiles = { 'poisonivy_seedling.png' },
2013-01-25 05:21:57 +01:00
inventory_image = 'poisonivy_seedling.png',
wield_image = 'poisonivy_seedling.png',
sunlight_propagates = true,
paramtype = 'light',
walkable = false,
groups = { snappy = 3, poisonivy=1, flora_block=1 },
2013-01-25 05:21:57 +01:00
sounds = default.node_sound_leaves_defaults(),
buildable_to = true,
2013-01-25 05:21:57 +01:00
})
minetest.register_node('poisonivy:sproutling', {
2014-03-12 19:36:42 +01:00
description = S("Poison ivy (sproutling)"),
2013-01-25 05:21:57 +01:00
drawtype = 'plantlike',
waving = 1,
2015-10-23 19:08:58 +02:00
tiles = { 'poisonivy_sproutling.png' },
2013-01-25 05:21:57 +01:00
inventory_image = 'poisonivy_sproutling.png',
wield_image = 'poisonivy_sproutling.png',
sunlight_propagates = true,
paramtype = 'light',
walkable = false,
groups = { snappy = 3, poisonivy=1, flora_block=1 },
2013-01-25 05:21:57 +01:00
sounds = default.node_sound_leaves_defaults(),
buildable_to = true,
2013-01-25 05:21:57 +01:00
})
minetest.register_node('poisonivy:climbing', {
2014-03-12 19:36:42 +01:00
description = S("Poison ivy (climbing plant)"),
2013-01-25 05:21:57 +01:00
drawtype = 'signlike',
2015-10-23 19:08:58 +02:00
tiles = { 'poisonivy_climbing.png' },
2013-01-25 05:21:57 +01:00
inventory_image = 'poisonivy_climbing.png',
wield_image = 'poisonivy_climbing.png',
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = 'wallmounted',
walkable = false,
groups = { snappy = 3, poisonivy=1, flora_block=1 },
2013-01-25 05:21:57 +01:00
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "wallmounted",
--wall_side = = <default>
},
buildable_to = true,
2013-01-25 05:21:57 +01:00
})
biome_lib.register_active_spawner({
2013-01-25 05:21:57 +01:00
spawn_delay = SPAWN_DELAY,
spawn_plants = {"poisonivy:seedling"},
avoid_radius = 10,
spawn_chance = SPAWN_CHANCE/10,
spawn_surfaces = {"default:dirt_with_grass"},
avoid_nodes = {"group:poisonivy", "group:flower", "group:flora"},
2013-01-25 05:21:57 +01:00
seed_diff = poisonivy_seed_diff,
light_min = 7,
alt_wallnode = "poisonivy:climbing",
verticals_list = walls_list
})
biome_lib.update_plant({
2013-01-25 05:21:57 +01:00
grow_delay = SPAWN_DELAY,
grow_chance = GROW_CHANCE,
grow_plant = "poisonivy:seedling",
grow_result = "poisonivy:sproutling",
grow_nodes = {"default:dirt_with_grass"}
})
biome_lib.update_plant({
2013-01-25 05:21:57 +01:00
grow_delay = GROW_DELAY,
grow_chance = GROW_CHANCE*2,
grow_plant = "poisonivy:climbing",
need_wall = true,
grow_vertically = true,
verticals_list = walls_list,
ground_nodes = {"default:dirt_with_grass"}
})
print("[Poison Ivy] Loaded.")