1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-04-03 19:20:35 +02:00

Removed all whitespaces (using new script)

This commit is contained in:
LeMagnesium 2015-06-10 19:12:48 +02:00
parent f81b8ca677
commit 2913bcb93d
101 changed files with 589 additions and 571 deletions

View File

@ -17,7 +17,7 @@ function beds.register_bed(name, def)
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = def.selectionbox, fixed = def.selectionbox,
}, },
after_place_node = function(pos, placer, itemstack) after_place_node = function(pos, placer, itemstack)
local n = minetest.get_node_or_nil(pos) local n = minetest.get_node_or_nil(pos)
@ -35,7 +35,7 @@ function beds.register_bed(name, def)
end end
minetest.set_node(p, {name = n.name:gsub("%_bottom", "_top"), param2 = n.param2}) minetest.set_node(p, {name = n.name:gsub("%_bottom", "_top"), param2 = n.param2})
return false return false
end, end,
on_destruct = function(pos) on_destruct = function(pos)
local n = minetest.get_node_or_nil(pos) local n = minetest.get_node_or_nil(pos)
if not n then return end if not n then return end

View File

@ -64,7 +64,7 @@ beds.register_bed("beds:bed", {
}, },
top = { top = {
"beds_bed_top_top.png^[transformR90", "beds_bed_top_top.png^[transformR90",
"default_wood.png", "default_wood.png",
"beds_bed_side_top_r.png", "beds_bed_side_top_r.png",
"beds_bed_side_top_r.png^[transformfx", "beds_bed_side_top_r.png^[transformfx",
"beds_bed_side_top.png", "beds_bed_side_top.png",

View File

@ -56,7 +56,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
if skip then if skip then
return return
end end
if p then if p then
player:setpos(p) player:setpos(p)
end end
@ -100,7 +100,7 @@ local function update_formspecs(finished)
"label[2.7,11; Good morning.]" "label[2.7,11; Good morning.]"
else else
form_n = beds.formspec .. form_n = beds.formspec ..
"label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]" "label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]"
if is_majority then if is_majority then
form_n = form_n .. form_n = form_n ..
"button_exit[2,8;4,0.75;force;Force night skip]" "button_exit[2,8;4,0.75;force;Force night skip]"

View File

@ -184,7 +184,7 @@ boats.register_boat = function(parameters)
wield_image = "boats_"..parameters.name.."_wield.png", wield_image = "boats_"..parameters.name.."_wield.png",
wield_scale = {x=2, y=2, z=1}, wield_scale = {x=2, y=2, z=1},
liquids_pointable = true, liquids_pointable = true,
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" then
return return

View File

@ -56,7 +56,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" then
return return
end end
local node = minetest.get_node_or_nil(pointed_thing.under) local node = minetest.get_node_or_nil(pointed_thing.under)
local ndef local ndef
if node then if node then

View File

@ -122,7 +122,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if start_i >= creative_inventory.creative_inventory_size then if start_i >= creative_inventory.creative_inventory_size then
start_i = start_i - 4*6 start_i = start_i - 4*6
end end
if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then
start_i = 0 start_i = 0
end end
@ -150,11 +150,11 @@ if minetest.setting_getbool("creative_mode") then
damage_groups = {fleshy = 10}, damage_groups = {fleshy = 10},
} }
}) })
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack) minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
return return
end) end)
function minetest.handle_node_drops(pos, drops, digger) function minetest.handle_node_drops(pos, drops, digger)
if not digger or not digger:is_player() then if not digger or not digger:is_player() then
return return
@ -169,5 +169,5 @@ if minetest.setting_getbool("creative_mode") then
end end
end end
end end
end end

View File

@ -13,7 +13,7 @@ minetest.register_craftitem("default:infotool", {
if minetest.registered_items[nn] == nil or minetest.registered_items[nn].tiles == nil or type(minetest.registered_items[nn].tiles[1]) ~= "string" then return end if minetest.registered_items[nn] == nil or minetest.registered_items[nn].tiles == nil or type(minetest.registered_items[nn].tiles[1]) ~= "string" then return end
local def = minetest.registered_nodes[nn] local def = minetest.registered_nodes[nn]
if not def then return end if not def then return end
local textures = def.tiles local textures = def.tiles
local description = def.description local description = def.description
if not textures then if not textures then

View File

@ -176,7 +176,7 @@ local function cool_wf_vm(pos, node1, node2)
nodes[i] = stone nodes[i] = stone
end end
end end
manip:set_data(nodes) manip:set_data(nodes)
manip:write_to_map() manip:write_to_map()
-- minetest.log("action", "Lava cooling happened at (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ").") -- minetest.log("action", "Lava cooling happened at (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ").")

View File

@ -4,7 +4,7 @@
-- --
local function active_formspec(fuel_percent, item_percent) local function active_formspec(fuel_percent, item_percent)
local formspec = local formspec =
"size[8,8.5]".. "size[8,8.5]"..
default.gui_slots.. default.gui_slots..
"list[current_name;src;2.75,0.5;1,1;]".. "list[current_name;src;2.75,0.5;1,1;]"..
@ -94,9 +94,9 @@ minetest.register_node("default:furnace", {
legacy_facedir_simple = true, legacy_facedir_simple = true,
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
can_dig = can_dig, can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move, allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take, allow_metadata_inventory_take = allow_metadata_inventory_take,
@ -126,9 +126,9 @@ minetest.register_node("default:furnace_active", {
legacy_facedir_simple = true, legacy_facedir_simple = true,
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
can_dig = can_dig, can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move, allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take, allow_metadata_inventory_take = allow_metadata_inventory_take,
@ -335,7 +335,7 @@ minetest.register_abm({
local fuel_time = meta:get_float("fuel_time") or 0 local fuel_time = meta:get_float("fuel_time") or 0
local src_time = meta:get_float("src_time") or 0 local src_time = meta:get_float("src_time") or 0
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0 local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
-- --
-- Inizialize inventory -- Inizialize inventory
-- --
@ -352,24 +352,24 @@ minetest.register_abm({
local srclist = inv:get_list("src") local srclist = inv:get_list("src")
local fuellist = inv:get_list("fuel") local fuellist = inv:get_list("fuel")
local dstlist = inv:get_list("dst") local dstlist = inv:get_list("dst")
-- --
-- Cooking -- Cooking
-- --
-- Check if we have cookable content -- Check if we have cookable content
local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
local cookable = true local cookable = true
if cooked.time == 0 then if cooked.time == 0 then
cookable = false cookable = false
end end
-- Check if we have enough fuel to burn -- Check if we have enough fuel to burn
if fuel_time < fuel_totaltime then if fuel_time < fuel_totaltime then
-- The furnace is currently active and has enough fuel -- The furnace is currently active and has enough fuel
fuel_time = fuel_time + 1 fuel_time = fuel_time + 1
-- If there is a cookable item then check if it is ready yet -- If there is a cookable item then check if it is ready yet
if cookable then if cookable then
src_time = src_time + 1 src_time = src_time + 1
@ -387,7 +387,7 @@ minetest.register_abm({
if cookable then if cookable then
-- We need to get new fuel -- We need to get new fuel
local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
if fuel.time == 0 then if fuel.time == 0 then
-- No valid fuel in fuel list -- No valid fuel in fuel list
fuel_totaltime = 0 fuel_totaltime = 0
@ -396,10 +396,10 @@ minetest.register_abm({
else else
-- Take fuel from fuel list -- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1]) inv:set_stack("fuel", 1, afterfuel.items[1])
fuel_totaltime = fuel.time fuel_totaltime = fuel.time
fuel_time = 0 fuel_time = 0
end end
else else
-- We don't need to get new fuel since there is no cookable item -- We don't need to get new fuel since there is no cookable item
@ -408,7 +408,7 @@ minetest.register_abm({
src_time = 0 src_time = 0
end end
end end
-- --
-- Update formspec, infotext and node -- Update formspec, infotext and node
-- --
@ -425,7 +425,7 @@ minetest.register_abm({
item_state = "Not cookable" item_state = "Not cookable"
end end
end end
local fuel_state = "Empty" local fuel_state = "Empty"
local active = "inactive " local active = "inactive "
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
@ -440,9 +440,9 @@ minetest.register_abm({
end end
swap_node(pos, "default:furnace") swap_node(pos, "default:furnace")
end end
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")" local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
-- --
-- Set meta values -- Set meta values
-- --
@ -475,13 +475,13 @@ minetest.register_abm({
local srclist = inv:get_list("src") local srclist = inv:get_list("src")
local cooked = nil local cooked = nil
if srclist then if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end end
local was_active = false local was_active = false
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
was_active = true was_active = true
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1) meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
@ -501,12 +501,12 @@ minetest.register_abm({
meta:set_string("src_time", 0) meta:set_string("src_time", 0)
end end
end end
local item_percent = 0 local item_percent = 0
if cooked then if cooked then
item_percent = meta:get_float("src_time") * 100 / cooked.time item_percent = meta:get_float("src_time") * 100 / cooked.time
end end
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") / local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100) meta:get_float("fuel_totaltime") * 100)
@ -520,7 +520,7 @@ minetest.register_abm({
local cooked = nil local cooked = nil
local fuellist = inv:get_list("fuel") local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src") local srclist = inv:get_list("src")
if srclist then if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end end
@ -546,7 +546,7 @@ minetest.register_abm({
meta:set_string("fuel_totaltime", fuel.time) meta:set_string("fuel_totaltime", fuel.time)
meta:set_string("fuel_time", 0) meta:set_string("fuel_time", 0)
local stack = inv:get_stack("fuel", 1) local stack = inv:get_stack("fuel", 1)
stack:take_item() stack:take_item()
inv:set_stack("fuel", 1, stack) inv:set_stack("fuel", 1, stack)

View File

@ -387,7 +387,7 @@ function default.register_ores()
end end
-- Underground springs: -- Underground springs:
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:water_source", ore = "default:water_source",
@ -721,7 +721,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
break break
end end
end end
if ground_y then if ground_y then
local p = {x=x,y =ground_y+1,z=z} local p = {x=x,y =ground_y+1,z=z}
local nn = minetest.get_node(p).name local nn = minetest.get_node(p).name
@ -732,14 +732,14 @@ minetest.register_on_generated(function(minp, maxp, seed)
-- If desert sand, add dry shrub -- If desert sand, add dry shrub
if nn == "default:desert_sand" then if nn == "default:desert_sand" then
minetest.set_node(p,{name = "default:dry_shrub"}) minetest.set_node(p,{name = "default:dry_shrub"})
-- If dirt with grass, add grass -- If dirt with grass, add grass
elseif nn == "default:dirt_with_grass" then elseif nn == "default:dirt_with_grass" then
minetest.set_node(p,{name = "default:grass_" .. pr:next(1, 5)}) minetest.set_node(p,{name = "default:grass_" .. pr:next(1, 5)})
end end
end end
end end
end end
end end
end end
@ -989,7 +989,7 @@ end
-- --
function default.register_blobs() function default.register_blobs()
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:sand", ore = "default:sand",
wherein = {"default:stone"}, wherein = {"default:stone"},

View File

@ -1613,7 +1613,7 @@ minetest.register_node("default:meze", {
drop = "", drop = "",
groups = {cracky = 1, level = 2, fall_damage_add_percent = -75}, groups = {cracky = 1, level = 2, fall_damage_add_percent = -75},
sounds = default.node_sound_wood_defaults(), -- Intended. sounds = default.node_sound_wood_defaults(), -- Intended.
on_dig = function(pos, node, digger) on_dig = function(pos, node, digger)
if digger and minetest.setting_getbool("enable_damage") and not minetest.setting_getbool("creative_mode") then if digger and minetest.setting_getbool("enable_damage") and not minetest.setting_getbool("creative_mode") then
minetest.after(3, die_later, digger) minetest.after(3, die_later, digger)
@ -2170,7 +2170,7 @@ if minetest.setting_getbool("xray") then
minetest.override_item("default:stone_with_mese", {tiles = {"default_mineral_mese.png"}}) minetest.override_item("default:stone_with_mese", {tiles = {"default_mineral_mese.png"}})
minetest.override_item("default:stone_with_diamond", {tiles = {"default_mineral_diamond.png"}}) minetest.override_item("default:stone_with_diamond", {tiles = {"default_mineral_diamond.png"}})
minetest.override_item("default:stone_with_coin", {tiles = {"maptools_gold_coin.png"}}) minetest.override_item("default:stone_with_coin", {tiles = {"maptools_gold_coin.png"}})
-- Nodes to hide: -- Nodes to hide:
minetest.override_item("default:stone", {drawtype = "airlike", pointable = false,}) minetest.override_item("default:stone", {drawtype = "airlike", pointable = false,})
minetest.override_item("default:dirt", {drawtype = "airlike", pointable = false,}) minetest.override_item("default:dirt", {drawtype = "airlike", pointable = false,})

View File

@ -95,7 +95,7 @@ minetest.register_on_joinplayer(function(player)
default.player_attached[player:get_player_name()] = false default.player_attached[player:get_player_name()] = false
default.player_set_model(player, "character.b3d") default.player_set_model(player, "character.b3d")
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30) player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
-- set GUI -- set GUI
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
player:set_inventory_formspec(default.gui_survival_form) player:set_inventory_formspec(default.gui_survival_form)

View File

@ -57,13 +57,13 @@ minetest.register_abm({
if not can_grow(pos) then if not can_grow(pos) then
return return
end end
minetest.log("action", "A pine sapling grows into a tree at ".. minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos)) minetest.pos_to_string(pos))
default.grow_pine_tree(pos) default.grow_pine_tree(pos)
end end
}) })
-- Appletree, jungletree function -- Appletree, jungletree function
local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid, local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
@ -72,7 +72,7 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
local c_air = minetest.get_content_id("air") local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore") local c_ignore = minetest.get_content_id("ignore")
local c_apple = minetest.get_content_id("default:apple") local c_apple = minetest.get_content_id("default:apple")
-- Trunk -- Trunk
for y_dist = 0, height - 1 do for y_dist = 0, height - 1 do
local vi = a:index(x, y + y_dist, z) local vi = a:index(x, y + y_dist, z)
@ -139,7 +139,7 @@ function default.grow_tree(pos, is_apple_tree, bad)
local height = random(4, 5) local height = random(4, 5)
local c_tree = minetest.get_content_id("default:tree") local c_tree = minetest.get_content_id("default:tree")
local c_leaves = minetest.get_content_id("default:leaves") local c_leaves = minetest.get_content_id("default:leaves")
local vm = minetest.get_voxel_manip() local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map( local minp, maxp = vm:read_from_map(
{x = pos.x - 2, y = pos.y, z = pos.z - 2}, {x = pos.x - 2, y = pos.y, z = pos.z - 2},
@ -410,15 +410,15 @@ minetest.register_abm({
interval = 80, interval = 80,
chance = 3, chance = 3,
action = function(pos, node) action = function(pos, node)
local nu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name local nu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
local is_soil = minetest.get_item_group(nu, "soil") local is_soil = minetest.get_item_group(nu, "soil")
if is_soil == 0 then if is_soil == 0 then
return return
end end
minetest.remove_node({x=pos.x, y=pos.y, z=pos.z}) minetest.remove_node({x=pos.x, y=pos.y, z=pos.z})
default.grow_cherry_tree(pos, false, "default:cherry_tree", "default:cherry_blossom_leaves") default.grow_cherry_tree(pos, false, "default:cherry_tree", "default:cherry_blossom_leaves")
end, end,

View File

@ -25,7 +25,7 @@ function doors.register_door(name, def)
if not def.sound_open_door then if not def.sound_open_door then
def.sound_open_door = "doors_door_open" def.sound_open_door = "doors_door_open"
end end
minetest.register_craftitem(name, { minetest.register_craftitem(name, {
description = def.description, description = def.description,
inventory_image = def.inventory_image, inventory_image = def.inventory_image,
@ -99,7 +99,7 @@ function doors.register_door(name, def)
local tt = def.tiles_top local tt = def.tiles_top
local tb = def.tiles_bottom local tb = def.tiles_bottom
local function after_dig_node(pos, name, digger) local function after_dig_node(pos, name, digger)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
if node.name == name then if node.name == name then
@ -114,16 +114,16 @@ function doors.register_door(name, def)
end end
local p2 = minetest.get_node(pos).param2 local p2 = minetest.get_node(pos).param2
p2 = params[p2+1] p2 = params[p2+1]
minetest.swap_node(pos, {name=replace_dir, param2=p2}) minetest.swap_node(pos, {name=replace_dir, param2=p2})
pos.y = pos.y-dir pos.y = pos.y-dir
minetest.swap_node(pos, {name=replace, param2=p2}) minetest.swap_node(pos, {name=replace, param2=p2})
local snd_1 = def.sound_close_door local snd_1 = def.sound_close_door
local snd_2 = def.sound_open_door local snd_2 = def.sound_open_door
if params[1] == 3 then if params[1] == 3 then
snd_1 = def.sound_open_door snd_1 = def.sound_open_door
snd_2 = def.sound_close_door snd_2 = def.sound_close_door
end end
@ -158,18 +158,18 @@ function doors.register_door(name, def)
fixed = def.selection_box_bottom fixed = def.selection_box_bottom
}, },
groups = def.groups, groups = def.groups,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
pos.y = pos.y+1 pos.y = pos.y+1
after_dig_node(pos, name.."_t_1", digger) after_dig_node(pos, name.."_t_1", digger)
end, end,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
if check_player_priv(pos, clicker) then if check_player_priv(pos, clicker) then
on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0}) on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
end end
end, end,
can_dig = check_player_priv, can_dig = check_player_priv,
sounds = def.sounds, sounds = def.sounds,
sunlight_propagates = def.sunlight sunlight_propagates = def.sunlight
@ -190,18 +190,18 @@ function doors.register_door(name, def)
fixed = def.selection_box_top fixed = def.selection_box_top
}, },
groups = def.groups, groups = def.groups,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
pos.y = pos.y-1 pos.y = pos.y-1
after_dig_node(pos, name.."_b_1", digger) after_dig_node(pos, name.."_b_1", digger)
end, end,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
if check_player_priv(pos, clicker) then if check_player_priv(pos, clicker) then
on_rightclick(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2", {1,2,3,0}) on_rightclick(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2", {1,2,3,0})
end end
end, end,
can_dig = check_player_priv, can_dig = check_player_priv,
sounds = def.sounds, sounds = def.sounds,
sunlight_propagates = def.sunlight, sunlight_propagates = def.sunlight,
@ -222,18 +222,18 @@ function doors.register_door(name, def)
fixed = def.selection_box_bottom fixed = def.selection_box_bottom
}, },
groups = def.groups, groups = def.groups,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
pos.y = pos.y+1 pos.y = pos.y+1
after_dig_node(pos, name.."_t_2", digger) after_dig_node(pos, name.."_t_2", digger)
end, end,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
if check_player_priv(pos, clicker) then if check_player_priv(pos, clicker) then
on_rightclick(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2}) on_rightclick(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2})
end end
end, end,
can_dig = check_player_priv, can_dig = check_player_priv,
sounds = def.sounds, sounds = def.sounds,
sunlight_propagates = def.sunlight sunlight_propagates = def.sunlight
@ -254,18 +254,18 @@ function doors.register_door(name, def)
fixed = def.selection_box_top fixed = def.selection_box_top
}, },
groups = def.groups, groups = def.groups,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
pos.y = pos.y-1 pos.y = pos.y-1
after_dig_node(pos, name.."_b_2", digger) after_dig_node(pos, name.."_b_2", digger)
end, end,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
if check_player_priv(pos, clicker) then if check_player_priv(pos, clicker) then
on_rightclick(pos, -1, name.."_b_2", name.."_t_1", name.."_b_1", {3,0,1,2}) on_rightclick(pos, -1, name.."_b_2", name.."_t_1", name.."_b_1", {3,0,1,2})
end end
end, end,
can_dig = check_player_priv, can_dig = check_player_priv,
sounds = def.sounds, sounds = def.sounds,
sunlight_propagates = def.sunlight sunlight_propagates = def.sunlight

View File

@ -15,11 +15,11 @@ minetest.register_node("fire:basic_flame", {
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
damage_per_second = 4, damage_per_second = 4,
on_construct = function(pos, placer) on_construct = function(pos, placer)
fire.on_flame_add_at(pos) fire.on_flame_add_at(pos)
end, end,
on_destruct = function(pos, oldnode, oldmetadata, digger) on_destruct = function(pos, oldnode, oldmetadata, digger)
fire.on_flame_remove_at(pos) fire.on_flame_remove_at(pos)
end, end,

View File

@ -95,23 +95,23 @@ minetest.register_abm({
elseif under.name ~= "default:dirt_with_grass" then elseif under.name ~= "default:dirt_with_grass" then
return return
end end
local light = minetest.get_node_light(pos) local light = minetest.get_node_light(pos)
if not light or light < 13 then if not light or light < 13 then
return return
end end
local pos0 = {x=pos.x-4,y=pos.y-4,z=pos.z-4} local pos0 = {x=pos.x-4,y=pos.y-4,z=pos.z-4}
local pos1 = {x=pos.x+4,y=pos.y+4,z=pos.z+4} local pos1 = {x=pos.x+4,y=pos.y+4,z=pos.z+4}
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then
return return
end end
local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora") local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora")
if #flowers > 3 then if #flowers > 3 then
return return
end end
local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass") local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass")
if #seedling > 0 then if #seedling > 0 then
seedling = seedling[math.random(#seedling)] seedling = seedling[math.random(#seedling)]

View File

@ -138,7 +138,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
end end
return itemstack return itemstack
end end
-- Upside down slabs -- Upside down slabs
if p0.y-1 == p1.y then if p0.y-1 == p1.y then
-- Turn into full block if pointing at a existing slab -- Turn into full block if pointing at a existing slab
@ -267,7 +267,7 @@ stairs.register_stair_and_slab("sandstone", "default:sandstone",
"Sandstone Stair", "Sandstone Stair",
"Sandstone Slab", "Sandstone Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("sandstonebrick", "default:sandstonebrick", stairs.register_stair_and_slab("sandstonebrick", "default:sandstonebrick",
{crumbly=2,cracky=2}, {crumbly=2,cracky=2},
{"default_sandstone_brick.png"}, {"default_sandstone_brick.png"},

View File

@ -50,7 +50,7 @@ minetest.register_node("vessels:shelf", {
local stack = inv:get_stack(from_list, from_index) local stack = inv:get_stack(from_list, from_index)
local to_stack = inv:get_stack(to_list, to_index) local to_stack = inv:get_stack(to_list, to_index)
if to_list == "vessels" then if to_list == "vessels" then
if minetest.get_item_group(stack:get_name(), "vessel") ~= 0 if minetest.get_item_group(stack:get_name(), "vessel") ~= 0
and to_stack:is_empty() then and to_stack:is_empty() then
return 1 return 1
else else

View File

@ -16,7 +16,7 @@ ARMOR_MATERIALS = {
mithril = "moreores:mithril_ingot", mithril = "moreores:mithril_ingot",
crystal = "ethereal:crystal_ingot", crystal = "ethereal:crystal_ingot",
-- Hunter armors (A déc-ommenter quand activation de l'armure au total) -- Hunter armors (A déc-ommenter quand activation de l'armure au total)
--hardened_leather = "3d_armor:hardened_leather" --hardened_leather = "3d_armor:hardened_leather"
--reinforced_leather = "3d_armor:reinforced_leather" --reinforced_leather = "3d_armor:reinforced_leather"
-- Wizard armors -- Wizard armors
--armor = "xxx", --armor = "xxx",
@ -255,7 +255,7 @@ armor.update_armor = function(self, player, dtime)
end end
end end
end end
end end
if hp <= 0 or hp == self.player_hp[name] then if hp <= 0 or hp == self.player_hp[name] then
return return
end end
@ -463,7 +463,7 @@ minetest.register_on_joinplayer(function(player)
for i=1, 6 do for i=1, 6 do
local stack = player_inv:get_stack("armor", i) local stack = player_inv:get_stack("armor", i)
armor_inv:set_stack("armor", i, stack) armor_inv:set_stack("armor", i, stack)
end end
-- Legacy support, import player's armor from old inventory format -- Legacy support, import player's armor from old inventory format
for _,v in pairs(armor.elements) do for _,v in pairs(armor.elements) do

View File

@ -124,4 +124,4 @@ minetest.after(0, function()
table.insert(armor.elements, "shield") table.insert(armor.elements, "shield")
end) end)

View File

@ -15,36 +15,36 @@ local max_frequency_all = 1000 --the larger you make this number the lest freque
--for frequencies below use a number between 0 and max_frequency_all --for frequencies below use a number between 0 and max_frequency_all
--for volumes below, use a number between 0.0 and 1, the larger the number the louder the sounds --for volumes below, use a number between 0.0 and 1, the larger the number the louder the sounds
local night_frequency = 20 --owls, wolves local night_frequency = 20 --owls, wolves
local night_volume = 0.9 local night_volume = 0.9
local night_frequent_frequency = 150 --crickets local night_frequent_frequency = 150 --crickets
local night_frequent_volume = 0.9 local night_frequent_volume = 0.9
local day_frequency = 80 --crow, bluejay, cardinal local day_frequency = 80 --crow, bluejay, cardinal
local day_volume = 0.6 local day_volume = 0.6
local day_frequent_frequency = 250 --crow, bluejay, cardinal local day_frequent_frequency = 250 --crow, bluejay, cardinal
local day_frequent_volume = 0.18 local day_frequent_volume = 0.18
local cave_frequency = 10 --bats local cave_frequency = 10 --bats
local cave_volume = 1.0 local cave_volume = 1.0
local cave_frequent_frequency = 70 --drops of water dripping local cave_frequent_frequency = 70 --drops of water dripping
local cave_frequent_volume = 1.0 local cave_frequent_volume = 1.0
local beach_frequency = 20 --seagulls local beach_frequency = 20 --seagulls
local beach_volume = 1.0 local beach_volume = 1.0
local beach_frequent_frequency = 1000 --waves local beach_frequent_frequency = 1000 --waves
local beach_frequent_volume = 1.0 local beach_frequent_volume = 1.0
local water_frequent_frequency = 1000 --water sounds local water_frequent_frequency = 1000 --water sounds
local water_frequent_volume = 1.0 local water_frequent_volume = 1.0
local desert_frequency = 20 --coyote local desert_frequency = 20 --coyote
local desert_volume = 1.0 local desert_volume = 1.0
local desert_frequent_frequency = 700 --desertwind local desert_frequent_frequency = 700 --desertwind
local desert_frequent_volume = 1.0 local desert_frequent_volume = 1.0
local swimming_frequent_frequency = 1000 --swimming splashes local swimming_frequent_frequency = 1000 --swimming splashes
local swimming_frequent_volume = 1.0 local swimming_frequent_volume = 1.0
local water_surface_volume = 1.0 -- sloshing water local water_surface_volume = 1.0 -- sloshing water
local lava_volume = 1.0 --lava local lava_volume = 1.0 --lava
local flowing_water_volume = .4 --waterfall local flowing_water_volume = .4 --waterfall
local splashing_water_volume = 1 local splashing_water_volume = 1
local music_frequency = 7 --music (suggestion: keep this one low like around 6) local music_frequency = 7 --music (suggestion: keep this one low like around 6)
local music_volume = 0.3 local music_volume = 0.3
--End of Config --End of Config
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
@ -269,7 +269,7 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
totalnodes = totalnodes + #nodes totalnodes = totalnodes + #nodes
maxp = {x=pos.x+20,y=height, z=pos.z+search_distance} maxp = {x=pos.x+20,y=height, z=pos.z+search_distance}
minp = {x=pos.x+20,y=height, z=pos.z-search_distance} minp = {x=pos.x+20,y=height, z=pos.z-search_distance}
nodes = minetest.find_nodes_in_area(minp, maxp, node_name) nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
-- minetest.chat_send_all("x+Found (" .. node_name .. ": " .. #nodes .. ")") -- minetest.chat_send_all("x+Found (" .. node_name .. ": " .. #nodes .. ")")
if #nodes >= threshold then if #nodes >= threshold then
return true return true
@ -277,8 +277,8 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
totalnodes = totalnodes + #nodes totalnodes = totalnodes + #nodes
maxp = {x=pos.x-20,y=height, z=pos.z+search_distance} maxp = {x=pos.x-20,y=height, z=pos.z+search_distance}
minp = {x=pos.x-20,y=height, z=pos.z-search_distance} minp = {x=pos.x-20,y=height, z=pos.z-search_distance}
nodes = minetest.find_nodes_in_area(minp, maxp, node_name) nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
-- minetest.chat_send_all("x+Found (" .. node_name .. ": " .. #nodes .. ")") -- minetest.chat_send_all("x+Found (" .. node_name .. ": " .. #nodes .. ")")
if #nodes >= threshold then if #nodes >= threshold then
return true return true
end end
@ -286,7 +286,7 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
-- minetest.chat_send_all("Found total(" .. totalnodes .. ")") -- minetest.chat_send_all("Found total(" .. totalnodes .. ")")
if totalnodes >= threshold*2 then if totalnodes >= threshold*2 then
return true return true
end end
return false return false
end end
@ -298,11 +298,11 @@ local get_immediate_nodes = function(pos)
pos.y = pos.y+3 pos.y = pos.y+3
pos.y = pos.y+2.2 pos.y = pos.y+2.2
node_at_upper_body = minetest.get_node(pos).name node_at_upper_body = minetest.get_node(pos).name
pos.y = pos.y-1.19 pos.y = pos.y-1.19
node_at_lower_body = minetest.get_node(pos).name node_at_lower_body = minetest.get_node(pos).name
pos.y = pos.y+0.99 pos.y = pos.y+0.99
--minetest.chat_send_all("node_under_feet(" .. nodename .. ")") --minetest.chat_send_all("node_under_feet(" .. nodename .. ")")
end end
local get_ambience = function(player) local get_ambience = function(player)
@ -315,19 +315,19 @@ local get_ambience = function(player)
local player_name = player:get_player_name() local player_name = player:get_player_name()
if player_name == nil or players_pos[player_name] == nil then return end if player_name == nil or players_pos[player_name] == nil then return end
if players_pos[player_name]["last_x_pos"] ~=pos.x or players_pos[player_name]["last_z_pos"] ~=pos.z then if players_pos[player_name]["last_x_pos"] ~=pos.x or players_pos[player_name]["last_z_pos"] ~=pos.z then
player_is_moving_horiz = true player_is_moving_horiz = true
end end
if pos.y > players_pos[player_name]["last_y_pos"]+.5 then if pos.y > players_pos[player_name]["last_y_pos"]+.5 then
player_is_climbing = true player_is_climbing = true
end end
if pos.y < players_pos[player_name]["last_y_pos"]-.5 then if pos.y < players_pos[player_name]["last_y_pos"]-.5 then
player_is_descending = true player_is_descending = true
end end
players_pos[player_name]["last_x_pos"] = pos.x players_pos[player_name]["last_x_pos"] = pos.x
players_pos[player_name]["last_z_pos"] = pos.z players_pos[player_name]["last_z_pos"] = pos.z
players_pos[player_name]["last_y_pos"] = pos.y players_pos[player_name]["last_y_pos"] = pos.y
if string.find(node_at_upper_body, "default:water") then if string.find(node_at_upper_body, "default:water") then
if music then if music then
return {water=water, water_frequent=water_frequent, music=music} return {water=water, water_frequent=water_frequent, music=music}
@ -342,20 +342,20 @@ local get_ambience = function(player)
--swimming w, m swimming --swimming w, m swimming
--walking in water nw, m splashing --walking in water nw, m splashing
--treading water w, nm sloshing --treading water w, nm sloshing
--standing in water nw, nm beach trumps, then sloshing --standing in water nw, nm beach trumps, then sloshing
if player_is_moving_horiz then if player_is_moving_horiz then
if string.find(node_under_feet, "default:water") then if string.find(node_under_feet, "default:water") then
if music then if music then
return {swimming_frequent=swimming_frequent, music=music} return {swimming_frequent=swimming_frequent, music=music}
else else
return {swimming_frequent} return {swimming_frequent}
end end
else --didn't find water under feet: walking in water else --didn't find water under feet: walking in water
if music then if music then
return {splashing_water=splashing_water, music=music} return {splashing_water=splashing_water, music=music}
else else
return {splashing_water} return {splashing_water}
end end
end end
else--player is not moving: treading water else--player is not moving: treading water
if string.find(node_under_feet, "default:water") then if string.find(node_under_feet, "default:water") then
@ -363,25 +363,25 @@ local get_ambience = function(player)
return {water_surface=water_surface, music=music} return {water_surface=water_surface, music=music}
else else
return {water_surface} return {water_surface}
end end
else --didn't find water under feet else --didn't find water under feet
standing_in_water = true standing_in_water = true
end end
end end
end end
end end
-- minetest.chat_send_all("----------") -- minetest.chat_send_all("----------")
-- if not player_is_moving_horiz then -- if not player_is_moving_horiz then
-- minetest.chat_send_all("not moving horiz") -- minetest.chat_send_all("not moving horiz")
-- else -- else
-- minetest.chat_send_all("moving horiz") -- minetest.chat_send_all("moving horiz")
-- end -- end
-- minetest.chat_send_all("nub:" ..node_at_upper_body) -- minetest.chat_send_all("nub:" ..node_at_upper_body)
-- minetest.chat_send_all("nlb:" ..node_at_lower_body) -- minetest.chat_send_all("nlb:" ..node_at_lower_body)
-- minetest.chat_send_all("nuf:" ..node_under_feet) -- minetest.chat_send_all("nuf:" ..node_under_feet)
-- minetest.chat_send_all("----------") -- minetest.chat_send_all("----------")
-- if player_is_moving_horiz then -- if player_is_moving_horiz then
-- minetest.chat_send_all("playermoving") -- minetest.chat_send_all("playermoving")
-- end -- end
@ -392,7 +392,7 @@ local get_ambience = function(player)
-- minetest.chat_send_all("nlb:" ..node_at_lower_body) -- minetest.chat_send_all("nlb:" ..node_at_lower_body)
-- minetest.chat_send_all("nuf:" ..node_under_feet) -- minetest.chat_send_all("nuf:" ..node_under_feet)
-- minetest.chat_send_all("n3uf:" ..node_3_under_feet) -- minetest.chat_send_all("n3uf:" ..node_3_under_feet)
-- --
local air_or_ignore = {air=true,ignore=true} local air_or_ignore = {air=true,ignore=true}
local minp = {x=pos.x-3,y=pos.y-4, z=pos.z-3} local minp = {x=pos.x-3,y=pos.y-4, z=pos.z-3}
local maxp = {x=pos.x+3,y=pos.y-1, z=pos.z+3} local maxp = {x=pos.x+3,y=pos.y-1, z=pos.z+3}
@ -405,19 +405,19 @@ local get_ambience = function(player)
-- minetest.chat_send_all("counter: (" .. counter .. "-----------------)") -- minetest.chat_send_all("counter: (" .. counter .. "-----------------)")
--minetest.chat_send_all(air_or_ignore[node_under_feet]) --minetest.chat_send_all(air_or_ignore[node_under_feet])
-- if (player_is_moving_horiz or player_is_climbing) and air_or_ignore[node_at_upper_body] and air_or_ignore[node_at_lower_body] -- if (player_is_moving_horiz or player_is_climbing) and air_or_ignore[node_at_upper_body] and air_or_ignore[node_at_lower_body]
-- and air_or_ignore[node_under_feet] and air_plus_ignore_under == 196 and not player_is_descending then -- and air_or_ignore[node_under_feet] and air_plus_ignore_under == 196 and not player_is_descending then
--minetest.chat_send_all("flying!!!!") --minetest.chat_send_all("flying!!!!")
-- if music then -- if music then
-- return {flying=flying, music=music} -- return {flying=flying, music=music}
-- else -- else
--- return {flying} --- return {flying}
-- end -- end
-- end -- end
--minetest.chat_send_all("not flying!!!!") --minetest.chat_send_all("not flying!!!!")
if nodes_in_range(pos, 7, "default:lava_flowing")>5 or nodes_in_range(pos, 7, "default:lava_source")>5 then if nodes_in_range(pos, 7, "default:lava_flowing")>5 or nodes_in_range(pos, 7, "default:lava_source")>5 then
if music then if music then
return {lava=lava, lava2=lava2, music=music} return {lava=lava, lava2=lava2, music=music}
else else
return {lava=lava} return {lava=lava}
end end
@ -428,7 +428,7 @@ local get_ambience = function(player)
else else
return {flowing_water=flowing_water, flowing_water2=flowing_water2} return {flowing_water=flowing_water, flowing_water2=flowing_water2}
end end
end end
--if we are near sea level and there is lots of water around the area --if we are near sea level and there is lots of water around the area
@ -437,17 +437,17 @@ local get_ambience = function(player)
return {beach=beach, beach_frequent=beach_frequent, music=music} return {beach=beach, beach_frequent=beach_frequent, music=music}
else else
return {beach=beach, beach_frequent=beach_frequent} return {beach=beach, beach_frequent=beach_frequent}
end end
end end
if standing_in_water then if standing_in_water then
if music then if music then
return {water_surface=water_surface, music=music} return {water_surface=water_surface, music=music}
else else
return {water_surface} return {water_surface}
end end
end end
local desert_in_range = (nodes_in_range(pos, 6, "default:desert_sand")+nodes_in_range(pos, 6, "default:desert_stone")) local desert_in_range = (nodes_in_range(pos, 6, "default:desert_sand")+nodes_in_range(pos, 6, "default:desert_stone"))
--minetest.chat_send_all("desertcount: " .. desert_in_range .. ",".. pos.y ) --minetest.chat_send_all("desertcount: " .. desert_in_range .. ",".. pos.y )
if desert_in_range >250 then if desert_in_range >250 then
@ -456,12 +456,12 @@ local get_ambience = function(player)
else else
return {desert=desert, desert_frequent=desert_frequent} return {desert=desert, desert_frequent=desert_frequent}
end end
end end
-- pos.y = pos.y-2 -- pos.y = pos.y-2
-- nodename = minetest.get_node(pos).name -- nodename = minetest.get_node(pos).name
-- minetest.chat_send_all("Found " .. nodename .. pos.y ) -- minetest.chat_send_all("Found " .. nodename .. pos.y )
if player:getpos().y < 0 then if player:getpos().y < 0 then
if music then if music then
@ -491,7 +491,7 @@ local play_sound = function(player, list, number, is_music)
if list.handler[player_name] == nil then if list.handler[player_name] == nil then
local gain = 1.0 local gain = 1.0
if list[number].gain ~= nil then if list[number].gain ~= nil then
if is_music then if is_music then
gain = list[number].gain*soundset.get_gain(player_name, "music") gain = list[number].gain*soundset.get_gain(player_name, "music")
--minetest.chat_send_all("gain music: " .. gain ) --minetest.chat_send_all("gain music: " .. gain )
else else
@ -666,7 +666,7 @@ local stop_sound = function(still_playing, player)
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
end end
end end
if still_playing.lava2 == nil then if still_playing.lava2 == nil then
local list = lava2 local list = lava2
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
@ -676,7 +676,7 @@ local stop_sound = function(still_playing, player)
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
end end
end end
if still_playing.water == nil then if still_playing.water == nil then
local list = water local list = water
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
@ -690,7 +690,7 @@ local stop_sound = function(still_playing, player)
if still_playing.water_surface == nil then if still_playing.water_surface == nil then
local list = water_surface local list = water_surface
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
played_on_start = false played_on_start = false
end end
@ -701,9 +701,9 @@ local stop_sound = function(still_playing, player)
if still_playing.water_frequent == nil then if still_playing.water_frequent == nil then
local list = water_frequent local list = water_frequent
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
-- minetest.chat_send_all("list.on_stop " .. list.on_stop ) -- minetest.chat_send_all("list.on_stop " .. list.on_stop )
played_on_start = false played_on_start = false
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
@ -723,7 +723,7 @@ local stop_sound = function(still_playing, player)
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
end end
end end
if still_playing.splashing_water == nil then if still_playing.splashing_water == nil then
local list = splashing_water local list = splashing_water
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
@ -733,8 +733,8 @@ local stop_sound = function(still_playing, player)
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
end end
end end
end end
local timer = 0 local timer = 0
@ -749,7 +749,7 @@ minetest.register_globalstep(function(dtime)
ambiences = get_ambience(player) ambiences = get_ambience(player)
stop_sound(ambiences, player) stop_sound(ambiences, player)
for _,ambience in pairs(ambiences) do for _,ambience in pairs(ambiences) do
if math.random(1, 1000) <= ambience.frequency then if math.random(1, 1000) <= ambience.frequency then
-- if(played_on_start) then -- if(played_on_start) then
-- -- minetest.chat_send_all("playedOnStart " ) -- -- minetest.chat_send_all("playedOnStart " )
-- else -- else
@ -762,7 +762,7 @@ minetest.register_globalstep(function(dtime)
-- minetest.chat_send_all("ambience: " ..ambience ) -- minetest.chat_send_all("ambience: " ..ambience )
-- if ambience.on_start ~= nil and played_on_start_flying == false then -- if ambience.on_start ~= nil and played_on_start_flying == false then
-- played_on_start_flying = true -- played_on_start_flying = true
-- minetest.sound_play(ambience.on_start, {to_player=player:get_player_name()}) -- minetest.sound_play(ambience.on_start, {to_player=player:get_player_name()})
-- end -- end
local is_music =false local is_music =false
if ambience.is_music ~= nil then if ambience.is_music ~= nil then
@ -816,8 +816,8 @@ minetest.register_chatcommand("mvol", {
MUSICVOLUME = tonumber(param) MUSICVOLUME = tonumber(param)
-- local player = minetest.get_player_by_name(name) -- local player = minetest.get_player_by_name(name)
-- stop_sound({}, player) -- stop_sound({}, player)
-- ambiences = get_ambience(player) -- ambiences = get_ambience(player)
minetest.chat_send_player(name, "Music volume set to " .. param .. ".") minetest.chat_send_player(name, "Music volume set to " .. param .. ".")
end, }) end, })
]] ]]

View File

@ -572,14 +572,14 @@ minetest.register_craft({
} }
}) })
if not minetest.get_modpath("technic") then if not minetest.get_modpath("technic") then
minetest.register_node( ":technic:granite", { minetest.register_node( ":technic:granite", {
description = "Granite", description = "Granite",
tiles = { "technic_granite.png" }, tiles = { "technic_granite.png" },
is_ground_content = true, is_ground_content = true,
groups = {cracky=1}, groups = {cracky=1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "technic:granite 9", output = "technic:granite 9",

View File

@ -1,6 +1,6 @@
local shapes = { local shapes = {
{ { x = {0, 1, 0, 1}, y = {0, 0, 1, 1} } }, { { x = {0, 1, 0, 1}, y = {0, 0, 1, 1} } },
{ { x = {1, 1, 1, 1}, y = {0, 1, 2, 3} }, { { x = {1, 1, 1, 1}, y = {0, 1, 2, 3} },
{ x = {0, 1, 2, 3}, y = {1, 1, 1, 1} } }, { x = {0, 1, 2, 3}, y = {1, 1, 1, 1} } },
@ -70,7 +70,7 @@ end
local function step(pos, fields) local function step(pos, fields)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local t = minetest.deserialize(meta:get_string("tetris")) local t = minetest.deserialize(meta:get_string("tetris"))
local function new_game(pos) local function new_game(pos)
local nex = math.random(7) local nex = math.random(7)
@ -81,7 +81,7 @@ local function step(pos, fields)
score = 0, score = 0,
cur = math.random(7), cur = math.random(7),
nex = nex, nex = nex,
x=4, y=0, rot=1 x=4, y=0, rot=1
} }
local timer = minetest.get_node_timer(pos) local timer = minetest.get_node_timer(pos)
@ -99,7 +99,7 @@ local function step(pos, fields)
i*sizey+boardy, semi, i*sizey+boardy, semi,
size, comma, size, semi, size, comma, size, semi,
colors[tile[2]], close } colors[tile[2]], close }
ins = ins + 1 ins = ins + 1
scr[ins] = concat(tmp) scr[ins] = concat(tmp)
end end
@ -138,9 +138,9 @@ local function step(pos, fields)
for i=1,4 do for i=1,4 do
local cx, cy = d.x[i]+x, d.y[i]+y local cx, cy = d.x[i]+x, d.y[i]+y
if cx < 0 or cx > 9 or cy < 0 or cy > 19 then if cx < 0 or cx > 9 or cy < 0 or cy > 19 then
return false return false
end end
for _, tile in pairs(t.board[ cy ] or {}) do for _, tile in pairs(t.board[ cy ] or {}) do
@ -157,7 +157,7 @@ local function step(pos, fields)
end end
local function tick() local function tick()
if stuck() then if stuck() then
if t.y <= 0 then if t.y <= 0 then
return false end return false end
add() add()
@ -170,7 +170,7 @@ local function step(pos, fields)
t.y = t.y + 1 t.y = t.y + 1
end end
return true return true
end end
local function move(dx, dy) local function move(dx, dy)
local newx, newy = t.x+dx, t.y+dy local newx, newy = t.x+dx, t.y+dy
@ -225,10 +225,10 @@ local function step(pos, fields)
end end
if t then if t then
local scr = { formsize, background, local scr = { formsize, background,
t.boardstring, t.previewstring, t.boardstring, t.previewstring,
draw_shape(t.cur, t.x, t.y, t.rot, boardx, boardy), draw_shape(t.cur, t.x, t.y, t.rot, boardx, boardy),
"label[3.8,0.1;Next...]label[3.8,2.7;Score: ", "label[3.8,0.1;Next...]label[3.8,2.7;Score: ",
t.score, close, buttons } t.score, close, buttons }

View File

@ -37,7 +37,7 @@ local function start_smoke(pos, node, clicker, chimney)
s_handle = minetest.sound_play("fire_small", { s_handle = minetest.sound_play("fire_small", {
pos = pos, pos = pos,
max_hear_distance = 5, max_hear_distance = 5,
loop = true loop = true
}) })
this_spawner_meta:set_int("smoky", id) this_spawner_meta:set_int("smoky", id)
this_spawner_meta:set_int("sound", s_handle) this_spawner_meta:set_int("sound", s_handle)
@ -81,7 +81,7 @@ for _, f in ipairs(flame_types) do
light_source = 14, light_source = 14,
waving = 1, waving = 1,
tiles = { tiles = {
{name=f.."_fire_animated.png", animation={type="vertical_frames", {name=f.."_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}}, aspect_w=16, aspect_h=16, length=1.5}},
}, },
on_rightclick = function (pos, node, clicker) on_rightclick = function (pos, node, clicker)
@ -111,7 +111,7 @@ minetest.register_node("fake_fire:fancy_fire", {
damage_per_second = 4, damage_per_second = 4,
on_rotate = screwdriver.rotate_simple, on_rotate = screwdriver.rotate_simple,
tiles = { tiles = {
{name="fake_fire_animated.png", {name="fake_fire_animated.png",
animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='fake_fire_logs.png'}}, animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='fake_fire_logs.png'}},
on_rightclick = function (pos, node, clicker) on_rightclick = function (pos, node, clicker)
start_smoke(pos, node, clicker) start_smoke(pos, node, clicker)
@ -169,7 +169,7 @@ for _, m in ipairs(materials) do
stop_smoke(pos) stop_smoke(pos)
end end
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = 'fake_fire:chimney_top_'..m, output = 'fake_fire:chimney_top_'..m,

View File

@ -7,7 +7,7 @@ local toilet_sbox = {
local toilet_cbox = { local toilet_cbox = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-6/16, -8/16, -8/16, 6/16, 1/16, 8/16 }, {-6/16, -8/16, -8/16, 6/16, 1/16, 8/16 },
{-6/16, -8/16, 4/16, 6/16, 9/16, 8/16 } {-6/16, -8/16, 4/16, 6/16, 9/16, 8/16 }
} }

View File

@ -19,7 +19,7 @@ local bed_sbox = {
local bed_cbox = { local bed_cbox = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -0.5, -0.5, -0.5, 0.5, -0.05, 1.5 }, { -0.5, -0.5, -0.5, 0.5, -0.05, 1.5 },
{ -0.5, -0.5, 1.44, 0.5, 0.5, 1.5 }, { -0.5, -0.5, 1.44, 0.5, 0.5, 1.5 },
{ -0.5, -0.5, -0.5, 0.5, 0.18, -0.44 }, { -0.5, -0.5, -0.5, 0.5, 0.18, -0.44 },
@ -33,7 +33,7 @@ local kbed_sbox = {
local kbed_cbox = { local kbed_cbox = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -0.5, -0.5, -0.5, 1.5, -0.05, 1.5 }, { -0.5, -0.5, -0.5, 1.5, -0.05, 1.5 },
{ -0.5, -0.5, 1.44, 1.5, 0.5, 1.5 }, { -0.5, -0.5, 1.44, 1.5, 0.5, 1.5 },
{ -0.5, -0.5, -0.5, 1.5, 0.18, -0.44 }, { -0.5, -0.5, -0.5, 1.5, 0.18, -0.44 },

View File

@ -137,7 +137,7 @@ local door_model_list = {
tiles = { tiles = {
"homedecor_door_exterior_fancy.png", "homedecor_door_exterior_fancy.png",
"homedecor_door_exterior_fancy_insert.png" "homedecor_door_exterior_fancy_insert.png"
}, },
usealpha = true usealpha = true
}, },

View File

@ -52,7 +52,7 @@ local kc_cbox = {
local ac_cbox = { local ac_cbox = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5 }, {-0.5, -0.5, -0.5, 0.5, 0, 0.5 },
{-0.5, -0.5, 0.4, 0.5, 0.5, 0.5 } {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
} }

View File

@ -93,7 +93,7 @@ local wl_cbox = {
homedecor.register("wall_lamp", { homedecor.register("wall_lamp", {
description = S("Wall Lamp"), description = S("Wall Lamp"),
mesh = "homedecor_wall_lamp.obj", mesh = "homedecor_wall_lamp.obj",
tiles = {"homedecor_generic_metal_black.png^[brighten", "homedecor_generic_wood_luxury.png^[colorize:#000000:30", tiles = {"homedecor_generic_metal_black.png^[brighten", "homedecor_generic_wood_luxury.png^[colorize:#000000:30",
"homedecor_light.png", "homedecor_generic_metal_wrought_iron.png"}, "homedecor_light.png", "homedecor_generic_metal_wrought_iron.png"},
use_texture_alpha = true, use_texture_alpha = true,
inventory_image = "homedecor_wall_lamp_inv.png", inventory_image = "homedecor_wall_lamp_inv.png",

View File

@ -143,7 +143,7 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, color)
return true return true
end end
if minetest.is_protected(forwardpos, placer_name) then if minetest.is_protected(forwardpos, placer_name) then
minetest.chat_send_player( placer:get_player_name(), "Someone already owns the spot where the headboard goes." ) minetest.chat_send_player( placer:get_player_name(), "Someone already owns the spot where the headboard goes." )
return true return true
end end
@ -169,7 +169,7 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, color)
minetest.set_node(rightpos, {name = "air"}) minetest.set_node(rightpos, {name = "air"})
minetest.set_node(pos, { name = newname, param2 = fdir}) minetest.set_node(pos, { name = newname, param2 = fdir})
end end
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}) local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
local bottomnode = minetest.get_node({x=pos.x, y=pos.y-1.0, z=pos.z}) local bottomnode = minetest.get_node({x=pos.x, y=pos.y-1.0, z=pos.z})
@ -202,7 +202,7 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
if def.on_rightclick then if def.on_rightclick then
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack) return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
end end
local fdir = minetest.dir_to_facedir(placer:get_look_dir()) local fdir = minetest.dir_to_facedir(placer:get_look_dir())
@ -217,7 +217,7 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
return return
end end
if minetest.is_protected(abovepos, placer_name) then if minetest.is_protected(abovepos, placer_name) then
minetest.chat_send_player(placer_name, "Someone already owns that spot." ) minetest.chat_send_player(placer_name, "Someone already owns that spot." )
return return
end end
@ -242,7 +242,7 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
local right_fwd_below_pos = { x=pos.x+rxd+fxd, y=pos.y-1, z=pos.z+rzd+fzd } local right_fwd_below_pos = { x=pos.x+rxd+fxd, y=pos.y-1, z=pos.z+rzd+fzd }
local left_fwd_below_pos = { x=pos.x+lxd+fxd, y=pos.y-1, z=pos.z+lzd+fzd } local left_fwd_below_pos = { x=pos.x+lxd+fxd, y=pos.y-1, z=pos.z+lzd+fzd }
local below_node = minetest.get_node(below_pos) local below_node = minetest.get_node(below_pos)
local fwd_node = minetest.get_node(fwd_pos) local fwd_node = minetest.get_node(fwd_pos)
local left_node = minetest.get_node(left_pos) local left_node = minetest.get_node(left_pos)
local right_node = minetest.get_node(right_pos) local right_node = minetest.get_node(right_pos)
@ -280,12 +280,12 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
-- try to place a horizontal in-line with the nearest diagonal, at the top -- try to place a horizontal in-line with the nearest diagonal, at the top
elseif left_fwd_below_node and string.find(left_fwd_below_node.name, "homedecor:banister_.*_diagonal") elseif left_fwd_below_node and string.find(left_fwd_below_node.name, "homedecor:banister_.*_diagonal")
and is_buildable_to(placer_name, fwd_pos, nil, fwd_pos) then and is_buildable_to(placer_name, fwd_pos, nil, fwd_pos) then
fdir = left_fwd_below_node.param2 fdir = left_fwd_below_node.param2
pos = fwd_pos pos = fwd_pos
new_place_name = string.gsub(left_fwd_below_node.name, "_diagonal_.-$", "_horizontal") new_place_name = string.gsub(left_fwd_below_node.name, "_diagonal_.-$", "_horizontal")
elseif right_fwd_below_node and string.find(right_fwd_below_node.name, "homedecor:banister_.*_diagonal") elseif right_fwd_below_node and string.find(right_fwd_below_node.name, "homedecor:banister_.*_diagonal")
and is_buildable_to(placer_name, fwd_pos, nil, fwd_pos) then and is_buildable_to(placer_name, fwd_pos, nil, fwd_pos) then
fdir = right_fwd_below_node.param2 fdir = right_fwd_below_node.param2
pos = fwd_pos pos = fwd_pos
new_place_name = string.gsub(right_fwd_below_node.name, "_diagonal_.-$", "_horizontal") new_place_name = string.gsub(right_fwd_below_node.name, "_diagonal_.-$", "_horizontal")
@ -299,13 +299,13 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
new_place_name = string.gsub(right_node.name, "_diagonal_.-$", "_horizontal") new_place_name = string.gsub(right_node.name, "_diagonal_.-$", "_horizontal")
-- try to place a horizontal in-line with the nearest diagonal, at the bottom -- try to place a horizontal in-line with the nearest diagonal, at the bottom
elseif left_fwd_node and string.find(left_fwd_node.name, "homedecor:banister_.*_diagonal") elseif left_fwd_node and string.find(left_fwd_node.name, "homedecor:banister_.*_diagonal")
and is_buildable_to(placer_name, fwd_pos, nil, fwd_pos) then and is_buildable_to(placer_name, fwd_pos, nil, fwd_pos) then
fdir = left_fwd_node.param2 fdir = left_fwd_node.param2
pos = fwd_pos pos = fwd_pos
new_place_name = string.gsub(left_fwd_node.name, "_diagonal_.-$", "_horizontal") new_place_name = string.gsub(left_fwd_node.name, "_diagonal_.-$", "_horizontal")
elseif right_fwd_node and string.find(right_fwd_node.name, "homedecor:banister_.*_diagonal") elseif right_fwd_node and string.find(right_fwd_node.name, "homedecor:banister_.*_diagonal")
and is_buildable_to(placer_name, fwd_pos, nil, fwd_pos) then and is_buildable_to(placer_name, fwd_pos, nil, fwd_pos) then
fdir = right_fwd_node.param2 fdir = right_fwd_node.param2
pos = fwd_pos pos = fwd_pos
new_place_name = string.gsub(right_fwd_node.name, "_diagonal_.-$", "_horizontal") new_place_name = string.gsub(right_fwd_node.name, "_diagonal_.-$", "_horizontal")

View File

@ -158,7 +158,7 @@ homedecor.register("plasma_ball", {
"homedecor_plasma_ball_glass.png" "homedecor_plasma_ball_glass.png"
}, },
inventory_image = "homedecor_plasma_ball_inv.png", inventory_image = "homedecor_plasma_ball_inv.png",
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.1875, -0.5, -0.1875, 0.1875, 0, 0.1875 } fixed = { -0.1875, -0.5, -0.1875, 0.1875, 0, 0.1875 }
}, },
@ -357,7 +357,7 @@ homedecor.register("ceiling_lantern", {
use_texture_alpha = true, use_texture_alpha = true,
inventory_image = "homedecor_ceiling_lantern_inv.png", inventory_image = "homedecor_ceiling_lantern_inv.png",
description = "Ceiling Lantern", description = "Ceiling Lantern",
groups = {snappy=3}, groups = {snappy=3},
light_source = 11, light_source = 11,
selection_box = cl_cbox, selection_box = cl_cbox,
walkable = false walkable = false
@ -508,7 +508,7 @@ local dlamp_cbox = {
local dlamp_colors = { "red","blue","green","violet" } local dlamp_colors = { "red","blue","green","violet" }
for _, color in ipairs(dlamp_colors) do for _, color in ipairs(dlamp_colors) do
homedecor.register("desk_lamp_"..color, { homedecor.register("desk_lamp_"..color, {
description = S("Desk Lamp ("..color..")"), description = S("Desk Lamp ("..color..")"),
mesh = "homedecor_desk_lamp.obj", mesh = "homedecor_desk_lamp.obj",

View File

@ -41,7 +41,7 @@ for i in ipairs(rug_types) do
if type(m) == "table" then if type(m) == "table" then
mesh = nil mesh = nil
nodebox = { nodebox = {
type = "fixed", type = "fixed",
fixed = m fixed = m
} }
tiles = { tiles = {
@ -94,7 +94,7 @@ for i in ipairs(flowers_list) do
local flowerdesc = flowers_list[i][1] local flowerdesc = flowers_list[i][1]
local flower = flowers_list[i][2] local flower = flowers_list[i][2]
local craftwith = flowers_list[i][3] local craftwith = flowers_list[i][3]
homedecor.register("potted_"..flower, { homedecor.register("potted_"..flower, {
description = S("Potted flower ("..flowerdesc..")"), description = S("Potted flower ("..flowerdesc..")"),
mesh = "homedecor_flowerpot_small.obj", mesh = "homedecor_flowerpot_small.obj",

View File

@ -27,7 +27,7 @@ if minetest.get_modpath("vessels")
paramtype2 = "facedir", paramtype2 = "facedir",
use_texture_alpha = true use_texture_alpha = true
}) })
local sbox = { local sbox = {
type = "fixed", type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, -0.1, 0.15 } fixed = { -0.15, -0.5, -0.15, 0.15, -0.1, 0.15 }

View File

@ -1,6 +1,6 @@
local lavalamps_list = { local lavalamps_list = {
{ "Red Lava Lamp", "red"}, { "Red Lava Lamp", "red"},
{ "Orange Lava Lamp", "orange"}, { "Orange Lava Lamp", "orange"},
{ "Yellow Lava Lamp", "yellow"}, { "Yellow Lava Lamp", "yellow"},
{ "Green Lava Lamp", "green"}, { "Green Lava Lamp", "green"},
{ "Blue Lava Lamp", "blue"}, { "Blue Lava Lamp", "blue"},
@ -52,7 +52,7 @@ for i in ipairs(lavalamps_list) do
tiles = { tiles = {
"lavalamp_metal.png", "lavalamp_metal.png",
"lavalamp_lamp_off.png", "lavalamp_lamp_off.png",
}, },
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
@ -78,5 +78,5 @@ for i in ipairs(lavalamps_list) do
{"", "wool:black", "", } {"", "wool:black", "", }
} }
}) })
end end

View File

@ -12,7 +12,7 @@ local armchairs_list = {
local armchair_cbox = { local armchair_cbox = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5 }, {-0.5, -0.5, -0.5, 0.5, 0, 0.5 },
{-0.5, -0.5, 0.4, 0.5, 0.5, 0.5 } {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
} }

View File

@ -17,7 +17,7 @@ local longsofa_sbox = {
local longsofa_cbox = { local longsofa_cbox = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 2.5 }, {-0.5, -0.5, -0.5, 0.5, 0, 2.5 },
{-0.5, -0.5, 0.5, -0.4, 0.5, 2.5 } {-0.5, -0.5, 0.5, -0.4, 0.5, 2.5 }
} }

View File

@ -17,7 +17,7 @@ local sofa_sbox = {
local sofa_cbox = { local sofa_cbox = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 1.5 }, {-0.5, -0.5, -0.5, 0.5, 0, 1.5 },
{-0.5, -0.5, 0.5, -0.4, 0.5, 1.5 } {-0.5, -0.5, 0.5, -0.4, 0.5, 1.5 }
} }

View File

@ -85,7 +85,7 @@ local function checkwall(pos)
end end
local node5 = minetest.get_node({x=pos.x+dxr, y=pos.y+1, z=pos.z+dzr}) local node5 = minetest.get_node({x=pos.x+dxr, y=pos.y+1, z=pos.z+dzr})
if not node5 or not minetest.registered_nodes[node5.name] if not node5 or not minetest.registered_nodes[node5.name]
or not minetest.registered_nodes[node5.name].buildable_to then or not minetest.registered_nodes[node5.name].buildable_to then
return false return false
end end

View File

@ -567,7 +567,7 @@ signs_lib.update_sign = function(pos, fields, owner)
elseif signnode.name == "signs:sign_hanging" then elseif signnode.name == "signs:sign_hanging" then
sign_info = signs_lib.hanging_sign_model.textpos[minetest.get_node(pos).param2 + 1] sign_info = signs_lib.hanging_sign_model.textpos[minetest.get_node(pos).param2 + 1]
elseif string.find(signnode.name, "sign_wall") then elseif string.find(signnode.name, "sign_wall") then
if signnode.name == "default:sign_wall" if signnode.name == "default:sign_wall"
or signnode.name == "locked_sign:sign_wall_locked" then or signnode.name == "locked_sign:sign_wall_locked" then
sign_info = signs_lib.regular_wall_sign_model.textpos[minetest.get_node(pos).param2 + 1] sign_info = signs_lib.regular_wall_sign_model.textpos[minetest.get_node(pos).param2 + 1]
else else

View File

@ -105,7 +105,7 @@ function msg_meta:fromRFC1459(line)
local pos local pos
self.command, pos = line:match("(%S+)()") self.command, pos = line:match("(%S+)()")
-- /MFF BEGIN -- /MFF BEGIN
if not pos then if not pos then
minetest.log("error", "[IRC] This crash message was intended to see the value of a breaking variable. line = " .. (line or "nil")) minetest.log("error", "[IRC] This crash message was intended to see the value of a breaking variable. line = " .. (line or "nil"))
return return
end end

View File

@ -13,7 +13,7 @@ end
function set:add(connection) function set:add(connection)
local socket = connection.socket local socket = connection.socket
insert(self.sockets, socket) insert(self.sockets, socket)
self.connections[socket] = connection self.connections[socket] = connection
insert(self.connections, connection) insert(self.connections, connection)
end end
@ -32,13 +32,13 @@ end
function set:select() function set:select()
local read, write, err = select(self.sockets, nil, self.timeout) local read, write, err = select(self.sockets, nil, self.timeout)
if read then if read then
for k, socket in ipairs(read) do for k, socket in ipairs(read) do
read[k] = self.connections[socket] read[k] = self.connections[socket]
end end
end end
return read, err return read, err
end end

View File

@ -30,7 +30,7 @@
-- action_change = function -- action_change = function
-- rules = rules/get_rules -- rules = rules/get_rules
-- }, -- },
-- conductor = -- conductor =
-- { -- {
-- state = mesecon.state.on/off -- state = mesecon.state.on/off
-- offstate = opposite state (for state = on only) -- offstate = opposite state (for state = on only)

View File

@ -496,7 +496,7 @@ function mesecon.find_receptor_on(pos, link)
end end
end end
end end
end end
depth = depth + 1 depth = depth + 1
end end
@ -533,7 +533,7 @@ function mesecon.rules_link_rule_all(output, rule)
return {} return {}
end end
local rules = {} local rules = {}
for _, inputrule in ipairs(mesecon.flattenrules(inputrules)) do for _, inputrule in ipairs(mesecon.flattenrules(inputrules)) do
-- Check if input accepts from output -- Check if input accepts from output
if mesecon.cmpPos(mesecon.addPosRule(input, inputrule), output) then if mesecon.cmpPos(mesecon.addPosRule(input, inputrule), output) then
@ -552,7 +552,7 @@ function mesecon.rules_link_rule_all_inverted(input, rule)
return {} return {}
end end
local rules = {} local rules = {}
for _, outputrule in ipairs(mesecon.flattenrules(outputrules)) do for _, outputrule in ipairs(mesecon.flattenrules(outputrules)) do
if mesecon.cmpPos(mesecon.addPosRule(output, outputrule), input) then if mesecon.cmpPos(mesecon.addPosRule(output, outputrule), input) then
table.insert(rules, mesecon.invertRule(outputrule)) table.insert(rules, mesecon.invertRule(outputrule))
@ -607,8 +607,8 @@ function mesecon.rotate_rules_right(rules)
local nr = {} local nr = {}
for i, rule in ipairs(rules) do for i, rule in ipairs(rules) do
table.insert(nr, { table.insert(nr, {
x = -rule.z, x = -rule.z,
y = rule.y, y = rule.y,
z = rule.x, z = rule.x,
name = rule.name}) name = rule.name})
end end
@ -619,8 +619,8 @@ function mesecon.rotate_rules_left(rules)
local nr = {} local nr = {}
for i, rule in ipairs(rules) do for i, rule in ipairs(rules) do
table.insert(nr, { table.insert(nr, {
x = rule.z, x = rule.z,
y = rule.y, y = rule.y,
z = -rule.x, z = -rule.x,
name = rule.name}) name = rule.name})
end end
@ -631,8 +631,8 @@ function mesecon.rotate_rules_down(rules)
local nr = {} local nr = {}
for i, rule in ipairs(rules) do for i, rule in ipairs(rules) do
table.insert(nr, { table.insert(nr, {
x = -rule.y, x = -rule.y,
y = rule.x, y = rule.x,
z = rule.z, z = rule.z,
name = rule.name}) name = rule.name})
end end
@ -643,8 +643,8 @@ function mesecon.rotate_rules_up(rules)
local nr = {} local nr = {}
for i, rule in ipairs(rules) do for i, rule in ipairs(rules) do
table.insert(nr, { table.insert(nr, {
x = rule.y, x = rule.y,
y = -rule.x, y = -rule.x,
z = rule.z, z = rule.z,
name = rule.name}) name = rule.name})
end end

View File

@ -21,7 +21,7 @@ mesecon.rules.buttonlike =
{{x = 1, y = 0, z = 0}, {{x = 1, y = 0, z = 0},
{x = 1, y = 1, z = 0}, {x = 1, y = 1, z = 0},
{x = 1, y =-1, z = 0}, {x = 1, y =-1, z = 0},
{x = 1, y =-1, z = 1}, {x = 1, y =-1, z = 1},
{x = 1, y =-1, z =-1}, {x = 1, y =-1, z =-1},
{x = 2, y = 0, z = 0}} {x = 2, y = 0, z = 0}}
@ -38,7 +38,7 @@ mesecon.rules.alldirs =
{x= 0, y=-1, z= 0}, {x= 0, y=-1, z= 0},
{x= 0, y= 0, z= 1}, {x= 0, y= 0, z= 1},
{x= 0, y= 0, z=-1}} {x= 0, y= 0, z=-1}}
mesecon.rules.buttonlike_get = function(node) mesecon.rules.buttonlike_get = function(node)
local rules = mesecon.rules.buttonlike local rules = mesecon.rules.buttonlike
if node.param2 == 2 then if node.param2 == 2 then

View File

@ -129,7 +129,7 @@ function mesecon.set_bit(binary,bit,value)
end end
end end
return binary return binary
end end
function mesecon.invertRule(r) function mesecon.invertRule(r)
@ -203,7 +203,7 @@ function mesecon.flipstate(pos, node)
local newstate local newstate
if (nodedef.__mesecon_state == "on") then newstate = "off" end if (nodedef.__mesecon_state == "on") then newstate = "off" end
if (nodedef.__mesecon_state == "off") then newstate = "on" end if (nodedef.__mesecon_state == "off") then newstate = "on" end
minetest.swap_node(pos, {name = nodedef.__mesecon_basename .. "_" .. newstate, minetest.swap_node(pos, {name = nodedef.__mesecon_basename .. "_" .. newstate,
param2 = node.param2}) param2 = node.param2})

View File

@ -135,7 +135,7 @@ nid_inc = function (nid)
end end
-- BUT: Skip impossible nodeids: -- BUT: Skip impossible nodeids:
if ((nid[0] == 0 and nid[4] == 1) or (nid[1] == 0 and nid[5] == 1) if ((nid[0] == 0 and nid[4] == 1) or (nid[1] == 0 and nid[5] == 1)
or (nid[2] == 0 and nid[6] == 1) or (nid[3] == 0 and nid[7] == 1)) then or (nid[2] == 0 and nid[6] == 1) or (nid[3] == 0 and nid[7] == 1)) then
return nid_inc(nid) return nid_inc(nid)
end end

View File

@ -15,7 +15,7 @@ end
minetest.register_node("mesecons_button:button_off", { minetest.register_node("mesecons_button:button_off", {
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"jeija_wall_button_sides.png", "jeija_wall_button_sides.png",
"jeija_wall_button_sides.png", "jeija_wall_button_sides.png",
"jeija_wall_button_sides.png", "jeija_wall_button_sides.png",
"jeija_wall_button_sides.png", "jeija_wall_button_sides.png",
@ -32,7 +32,7 @@ minetest.register_node("mesecons_button:button_off", {
fixed = { -6/16, -6/16, 5/16, 6/16, 6/16, 8/16 } fixed = { -6/16, -6/16, 5/16, 6/16, 6/16, 8/16 }
}, },
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -6/16, -6/16, 6/16, 6/16, 6/16, 8/16 }, -- the thin plate behind the button { -6/16, -6/16, 6/16, 6/16, 6/16, 8/16 }, -- the thin plate behind the button
{ -4/16, -2/16, 4/16, 4/16, 2/16, 6/16 } -- the button itself { -4/16, -2/16, 4/16, 4/16, 2/16, 6/16 } -- the button itself

View File

@ -35,7 +35,7 @@ end
for i = 1, 4 do for i = 1, 4 do
local groups = {} local groups = {}
if i == 1 then if i == 1 then
groups = {bendy=2,snappy=1,dig_immediate=2} groups = {bendy=2,snappy=1,dig_immediate=2}
else else
groups = {bendy=2,snappy=1,dig_immediate=2, not_in_creative_inventory=1} groups = {bendy=2,snappy=1,dig_immediate=2, not_in_creative_inventory=1}

View File

@ -182,10 +182,10 @@ minetest.register_node("mesecons_detector:node_detector_off", {
on_receive_fields = node_detector_on_receive_fields, on_receive_fields = node_detector_on_receive_fields,
after_place_node = function (pos, placer) after_place_node = function (pos, placer)
local placer_pos = placer:getpos() local placer_pos = placer:getpos()
--correct for the player's height --correct for the player's height
if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end
--correct for 6d facedir --correct for 6d facedir
if placer_pos then if placer_pos then
local dir = { local dir = {
@ -217,10 +217,10 @@ minetest.register_node("mesecons_detector:node_detector_on", {
on_receive_fields = node_detector_on_receive_fields, on_receive_fields = node_detector_on_receive_fields,
after_place_node = function (pos, placer) after_place_node = function (pos, placer)
local placer_pos = placer:getpos() local placer_pos = placer:getpos()
--correct for the player's height --correct for the player's height
if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end
--correct for 6d facedir --correct for 6d facedir
if placer_pos then if placer_pos then
local dir = { local dir = {

View File

@ -10,7 +10,7 @@ local corner_selectionbox = {
} }
local corner_get_rules = function (node) local corner_get_rules = function (node)
local rules = local rules =
{{x = 1, y = 0, z = 0}, {{x = 1, y = 0, z = 0},
{x = 0, y = 0, z = -1}} {x = 0, y = 0, z = -1}}
@ -39,7 +39,7 @@ minetest.register_node("mesecons_extrawires:corner_on", {
node_box = corner_nodebox, node_box = corner_nodebox,
groups = {dig_immediate = 3, not_in_creative_inventory = 1}, groups = {dig_immediate = 3, not_in_creative_inventory = 1},
drop = "mesecons_extrawires:corner_off", drop = "mesecons_extrawires:corner_off",
mesecons = {conductor = mesecons = {conductor =
{ {
state = mesecon.state.on, state = mesecon.state.on,
rules = corner_get_rules, rules = corner_get_rules,
@ -65,7 +65,7 @@ minetest.register_node("mesecons_extrawires:corner_off", {
selection_box = corner_selectionbox, selection_box = corner_selectionbox,
node_box = corner_nodebox, node_box = corner_nodebox,
groups = {dig_immediate = 3}, groups = {dig_immediate = 3},
mesecons = {conductor = mesecons = {conductor =
{ {
state = mesecon.state.off, state = mesecon.state.off,
rules = corner_get_rules, rules = corner_get_rules,

View File

@ -10,7 +10,7 @@ local tjunction_selectionbox = {
} }
local tjunction_get_rules = function (node) local tjunction_get_rules = function (node)
local rules = local rules =
{{x = 0, y = 0, z = 1}, {{x = 0, y = 0, z = 1},
{x = 1, y = 0, z = 0}, {x = 1, y = 0, z = 0},
{x = 0, y = 0, z = -1}} {x = 0, y = 0, z = -1}}
@ -40,7 +40,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", {
node_box = tjunction_nodebox, node_box = tjunction_nodebox,
groups = {dig_immediate = 3, not_in_creative_inventory = 1}, groups = {dig_immediate = 3, not_in_creative_inventory = 1},
drop = "mesecons_extrawires:tjunction_off", drop = "mesecons_extrawires:tjunction_off",
mesecons = {conductor = mesecons = {conductor =
{ {
state = mesecon.state.on, state = mesecon.state.on,
rules = tjunction_get_rules, rules = tjunction_get_rules,
@ -66,7 +66,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
selection_box = tjunction_selectionbox, selection_box = tjunction_selectionbox,
node_box = tjunction_nodebox, node_box = tjunction_nodebox,
groups = {dig_immediate = 3}, groups = {dig_immediate = 3},
mesecons = {conductor = mesecons = {conductor =
{ {
state = mesecon.state.off, state = mesecon.state.off,
rules = tjunction_get_rules, rules = tjunction_get_rules,

View File

@ -247,7 +247,7 @@ end
local safe_globals = { local safe_globals = {
"assert", "error", "ipairs", "next", "pairs", "pcall", "select", "assert", "error", "ipairs", "next", "pairs", "pcall", "select",
"tonumber", "tostring", "type", "unpack", "_VERSION", "xpcall", "tonumber", "tostring", "type", "unpack", "_VERSION", "xpcall",
} }
local function create_environment(pos, mem, event) local function create_environment(pos, mem, event)
-- Gather variables for the environment -- Gather variables for the environment

View File

@ -262,7 +262,7 @@ function parse_get_command(code, starti)
if s == "(" then if s == "(" then
return string.sub(code, starti, i-1), i + 1 -- i: ( i+1 after ( return string.sub(code, starti, i-1), i + 1 -- i: ( i+1 after (
end end
if s == ";" and starti == i then if s == ";" and starti == i then
starti = starti + 1 starti = starti + 1
i = starti i = starti
elseif s == ">" then elseif s == ">" then
@ -410,7 +410,7 @@ function yc_command_sbi(params, eeprom, L, Lv)
--is an eeprom address --is an eeprom address
local new_eeprom = ""; local new_eeprom = "";
for i=1, #eeprom do for i=1, #eeprom do
if tonumber(params[1])==i then if tonumber(params[1])==i then
new_eeprom = new_eeprom..status new_eeprom = new_eeprom..status
else else
new_eeprom = new_eeprom..eeprom:sub(i, i) new_eeprom = new_eeprom..eeprom:sub(i, i)
@ -476,7 +476,7 @@ function yc_command_if_getcondition(code, starti)
local brackets = 1 --1 Bracket to close local brackets = 1 --1 Bracket to close
while s ~= "" do while s ~= "" do
s = string.sub(code, i, i) s = string.sub(code, i, i)
if s == ")" then if s == ")" then
brackets = brackets - 1 brackets = brackets - 1
end end
@ -539,7 +539,7 @@ function yc_command_parsecondition(cond, L, eeprom)
i = i + 1 i = i + 1
end end
local i = 2 local i = 2
local l = string.len(cond) local l = string.len(cond)
while i<=l do while i<=l do
local s = cond:sub(i,i) local s = cond:sub(i,i)
@ -612,12 +612,12 @@ function yc_action_setports(pos, L, Lv)
if L.b == true then mesecon.receptor_on(pos, rules) if L.b == true then mesecon.receptor_on(pos, rules)
else mesecon.receptor_off(pos, rules) end else mesecon.receptor_off(pos, rules) end
end end
if Lv.c ~= L.c then if Lv.c ~= L.c then
rules = microc_rules[name.."0100"] rules = microc_rules[name.."0100"]
if L.c == true then mesecon.receptor_on(pos, rules) if L.c == true then mesecon.receptor_on(pos, rules)
else mesecon.receptor_off(pos, rules) end else mesecon.receptor_off(pos, rules) end
end end
if Lv.d ~= L.d then if Lv.d ~= L.d then
rules = microc_rules[name.."1000"] rules = microc_rules[name.."1000"]
if L.d == true then mesecon.receptor_on(pos, rules) if L.d == true then mesecon.receptor_on(pos, rules)
else mesecon.receptor_off(pos, rules) end else mesecon.receptor_off(pos, rules) end

View File

@ -74,7 +74,7 @@ function mesecon.register_movestone(name, def, is_sticky)
local maxpush = mesecon.setting("movestone_max_push", 50) local maxpush = mesecon.setting("movestone_max_push", 50)
local maxpull = mesecon.setting("movestone_max_pull", 50) local maxpull = mesecon.setting("movestone_max_pull", 50)
local success, stack, oldstack = mesecon.mvps_push(frontpos, direction, maxpush) local success, stack, oldstack = mesecon.mvps_push(frontpos, direction, maxpush)
if success then if success then
mesecon.mvps_process_stack(stack) mesecon.mvps_process_stack(stack)
mesecon.mvps_move_objects(frontpos, direction, oldstack) mesecon.mvps_move_objects(frontpos, direction, oldstack)
-- Too large stack/stopper in the way: try again very soon -- Too large stack/stopper in the way: try again very soon

View File

@ -160,11 +160,11 @@ local pistonspec_normal = {
minetest.register_node("mesecons_pistons:piston_normal_off", { minetest.register_node("mesecons_pistons:piston_normal_off", {
description = "Piston", description = "Piston",
tiles = { tiles = {
"mesecons_piston_top.png", "mesecons_piston_top.png",
"mesecons_piston_bottom.png", "mesecons_piston_bottom.png",
"mesecons_piston_left.png", "mesecons_piston_left.png",
"mesecons_piston_right.png", "mesecons_piston_right.png",
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_pusher_front.png" "mesecons_piston_pusher_front.png"
}, },
groups = {cracky = 3}, groups = {cracky = 3},
@ -182,11 +182,11 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
minetest.register_node("mesecons_pistons:piston_normal_on", { minetest.register_node("mesecons_pistons:piston_normal_on", {
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"mesecons_piston_top.png", "mesecons_piston_top.png",
"mesecons_piston_bottom.png", "mesecons_piston_bottom.png",
"mesecons_piston_left.png", "mesecons_piston_left.png",
"mesecons_piston_right.png", "mesecons_piston_right.png",
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_on_front.png" "mesecons_piston_on_front.png"
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
@ -241,11 +241,11 @@ local pistonspec_sticky = {
minetest.register_node("mesecons_pistons:piston_sticky_off", { minetest.register_node("mesecons_pistons:piston_sticky_off", {
description = "Sticky Piston", description = "Sticky Piston",
tiles = { tiles = {
"mesecons_piston_top.png", "mesecons_piston_top.png",
"mesecons_piston_bottom.png", "mesecons_piston_bottom.png",
"mesecons_piston_left.png", "mesecons_piston_left.png",
"mesecons_piston_right.png", "mesecons_piston_right.png",
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_pusher_front_sticky.png" "mesecons_piston_pusher_front_sticky.png"
}, },
groups = {cracky = 3}, groups = {cracky = 3},
@ -263,11 +263,11 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
minetest.register_node("mesecons_pistons:piston_sticky_on", { minetest.register_node("mesecons_pistons:piston_sticky_on", {
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"mesecons_piston_top.png", "mesecons_piston_top.png",
"mesecons_piston_bottom.png", "mesecons_piston_bottom.png",
"mesecons_piston_left.png", "mesecons_piston_left.png",
"mesecons_piston_right.png", "mesecons_piston_right.png",
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_on_front.png" "mesecons_piston_on_front.png"
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
@ -340,11 +340,11 @@ local pistonspec_normal_up = {
minetest.register_node("mesecons_pistons:piston_up_normal_off", { minetest.register_node("mesecons_pistons:piston_up_normal_off", {
tiles = { tiles = {
"mesecons_piston_pusher_front.png", "mesecons_piston_pusher_front.png",
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_left.png^[transformR270", "mesecons_piston_left.png^[transformR270",
"mesecons_piston_right.png^[transformR90", "mesecons_piston_right.png^[transformR90",
"mesecons_piston_bottom.png", "mesecons_piston_bottom.png",
"mesecons_piston_top.png^[transformR180", "mesecons_piston_top.png^[transformR180",
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
wield_image = "mesecons_piston_top.png", wield_image = "mesecons_piston_top.png",
@ -363,11 +363,11 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", {
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"mesecons_piston_on_front.png", "mesecons_piston_on_front.png",
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_left.png^[transformR270", "mesecons_piston_left.png^[transformR270",
"mesecons_piston_right.png^[transformR90", "mesecons_piston_right.png^[transformR90",
"mesecons_piston_bottom.png", "mesecons_piston_bottom.png",
"mesecons_piston_top.png^[transformR180", "mesecons_piston_top.png^[transformR180",
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
wield_image = "mesecons_piston_top.png", wield_image = "mesecons_piston_top.png",
@ -422,11 +422,11 @@ local pistonspec_sticky_up = {
minetest.register_node("mesecons_pistons:piston_up_sticky_off", { minetest.register_node("mesecons_pistons:piston_up_sticky_off", {
tiles = { tiles = {
"mesecons_piston_pusher_front_sticky.png", "mesecons_piston_pusher_front_sticky.png",
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_left.png^[transformR270", "mesecons_piston_left.png^[transformR270",
"mesecons_piston_right.png^[transformR90", "mesecons_piston_right.png^[transformR90",
"mesecons_piston_bottom.png", "mesecons_piston_bottom.png",
"mesecons_piston_top.png^[transformR180", "mesecons_piston_top.png^[transformR180",
"mesecons_piston_tb.png" "mesecons_piston_tb.png"
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
@ -447,11 +447,11 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", {
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"mesecons_piston_on_front.png", "mesecons_piston_on_front.png",
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_left.png^[transformR270", "mesecons_piston_left.png^[transformR270",
"mesecons_piston_right.png^[transformR90", "mesecons_piston_right.png^[transformR90",
"mesecons_piston_bottom.png", "mesecons_piston_bottom.png",
"mesecons_piston_top.png^[transformR180", "mesecons_piston_top.png^[transformR180",
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
wield_image = "mesecons_piston_top.png", wield_image = "mesecons_piston_top.png",
@ -524,12 +524,12 @@ local pistonspec_normal_down = {
-- offstate -- offstate
minetest.register_node("mesecons_pistons:piston_down_normal_off", { minetest.register_node("mesecons_pistons:piston_down_normal_off", {
tiles = { tiles = {
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_pusher_front.png", "mesecons_piston_pusher_front.png",
"mesecons_piston_left.png^[transformR90", "mesecons_piston_left.png^[transformR90",
"mesecons_piston_right.png^[transformR270", "mesecons_piston_right.png^[transformR270",
"mesecons_piston_bottom.png^[transformR180", "mesecons_piston_bottom.png^[transformR180",
"mesecons_piston_top.png", "mesecons_piston_top.png",
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
wield_image = "mesecons_piston_top.png", wield_image = "mesecons_piston_top.png",
@ -548,12 +548,12 @@ minetest.register_node("mesecons_pistons:piston_down_normal_off", {
minetest.register_node("mesecons_pistons:piston_down_normal_on", { minetest.register_node("mesecons_pistons:piston_down_normal_on", {
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_on_front.png", "mesecons_piston_on_front.png",
"mesecons_piston_left.png^[transformR90", "mesecons_piston_left.png^[transformR90",
"mesecons_piston_right.png^[transformR270", "mesecons_piston_right.png^[transformR270",
"mesecons_piston_bottom.png^[transformR180", "mesecons_piston_bottom.png^[transformR180",
"mesecons_piston_top.png", "mesecons_piston_top.png",
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
wield_image = "mesecons_piston_top.png", wield_image = "mesecons_piston_top.png",
@ -604,12 +604,12 @@ local pistonspec_sticky_down = {
-- offstate -- offstate
minetest.register_node("mesecons_pistons:piston_down_sticky_off", { minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
tiles = { tiles = {
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_pusher_front_sticky.png", "mesecons_piston_pusher_front_sticky.png",
"mesecons_piston_left.png^[transformR90", "mesecons_piston_left.png^[transformR90",
"mesecons_piston_right.png^[transformR270", "mesecons_piston_right.png^[transformR270",
"mesecons_piston_bottom.png^[transformR180", "mesecons_piston_bottom.png^[transformR180",
"mesecons_piston_top.png", "mesecons_piston_top.png",
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
wield_image = "mesecons_piston_top.png", wield_image = "mesecons_piston_top.png",
@ -628,12 +628,12 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
minetest.register_node("mesecons_pistons:piston_down_sticky_on", { minetest.register_node("mesecons_pistons:piston_down_sticky_on", {
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"mesecons_piston_back.png", "mesecons_piston_back.png",
"mesecons_piston_on_front.png", "mesecons_piston_on_front.png",
"mesecons_piston_left.png^[transformR90", "mesecons_piston_left.png^[transformR90",
"mesecons_piston_right.png^[transformR270", "mesecons_piston_right.png^[transformR270",
"mesecons_piston_bottom.png^[transformR180", "mesecons_piston_bottom.png^[transformR180",
"mesecons_piston_top.png", "mesecons_piston_top.png",
}, },
inventory_image = "mesecons_piston_top.png", inventory_image = "mesecons_piston_top.png",
wield_image = "mesecons_piston_top.png", wield_image = "mesecons_piston_top.png",

View File

@ -1,5 +1,5 @@
rcvboxes = { rcvboxes = {
{ -3/16, -3/16, -8/16 , 3/16, 3/16 , -13/32 }, -- the smaller bump { -3/16, -3/16, -8/16 , 3/16, 3/16 , -13/32 }, -- the smaller bump
{ -1/32, -1/32, -3/2 , 1/32, 1/32 , -1/2 }, -- the wire through the block { -1/32, -1/32, -3/2 , 1/32, 1/32 , -1/2 }, -- the wire through the block
{ -2/32, -1/2 , -.5 , 2/32, 0 , -.5002+3/32 }, -- the vertical wire bit { -2/32, -1/2 , -.5 , 2/32, 0 , -.5002+3/32 }, -- the vertical wire bit
{ -2/32, -1/2 , -7/16+0.002 , 2/32, -14/32, 16/32+0.001 } -- the horizontal wire { -2/32, -1/2 , -7/16+0.002 , 2/32, -14/32, 16/32+0.001 } -- the horizontal wire

View File

@ -81,7 +81,7 @@ function stairsplus:register_6dfacedir_conversion(modname, material)
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2 or 0 local fdir = node.param2 or 0
if flip_upside_down and not flip_to_wall then if flip_upside_down and not flip_to_wall then
nfdir = dirs1[fdir + 2] nfdir = dirs1[fdir + 2]
elseif flip_to_wall and not flip_upside_down then elseif flip_to_wall and not flip_upside_down then
nfdir = dirs2[fdir + 1] nfdir = dirs2[fdir + 1]
@ -125,7 +125,7 @@ function stairsplus:register_6dfacedir_conversion(modname, material)
local fdir = node.param2 local fdir = node.param2
local nfdir = 20 local nfdir = 20
if flip_upside_down and not flip_to_wall then if flip_upside_down and not flip_to_wall then
nfdir = dirs1[fdir + 1] nfdir = dirs1[fdir + 1]
elseif flip_to_wall and not flip_upside_down then elseif flip_to_wall and not flip_upside_down then
nfdir = dirs2[fdir + 2] nfdir = dirs2[fdir + 2]

View File

@ -83,39 +83,39 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields)
end end
minetest.register_alias(modname.. ":micro_" ..subname.. "_bottom", modname.. ":micro_" ..subname) minetest.register_alias(modname.. ":micro_" ..subname.. "_bottom", modname.. ":micro_" ..subname)
-- Some saw-less recipes: -- Some saw-less recipes:
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":micro_" .. subname .. " 7", output = modname .. ":micro_" .. subname .. " 7",
recipe = {modname .. ":stair_" .. subname .. "_inner"}, recipe = {modname .. ":stair_" .. subname .. "_inner"},
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":micro_" .. subname .. " 6", output = modname .. ":micro_" .. subname .. " 6",
type = "shapeless", type = "shapeless",
recipe = {modname .. ":stair_" .. subname}, recipe = {modname .. ":stair_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":micro_" .. subname .. " 5", output = modname .. ":micro_" .. subname .. " 5",
recipe = {modname .. ":stair_" .. subname .. "_outer"}, recipe = {modname .. ":stair_" .. subname .. "_outer"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":micro_" .. subname .. " 4", output = modname .. ":micro_" .. subname .. " 4",
recipe = {modname .. ":slab_" .. subname}, recipe = {modname .. ":slab_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":micro_" .. subname .. " 2", output = modname .. ":micro_" .. subname .. " 2",
recipe = {modname .. ":panel_" .. subname}, recipe = {modname .. ":panel_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = recipeitem, output = recipeitem,

View File

@ -82,7 +82,7 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
minetest.register_node(":" ..modname.. ":panel_" ..subname..alternate, def) minetest.register_node(":" ..modname.. ":panel_" ..subname..alternate, def)
end end
minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname) minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname)
-- Some saw-less recipes: -- Some saw-less recipes:
minetest.register_craft({ minetest.register_craft({
@ -92,7 +92,7 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
{recipeitem, recipeitem}, {recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":panel_" .. subname .. " 12", output = modname .. ":panel_" .. subname .. " 12",
recipe = { recipe = {
@ -100,13 +100,13 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
{recipeitem, recipeitem}, {recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":panel_" .. subname, output = modname .. ":panel_" .. subname,
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = recipeitem, output = recipeitem,

View File

@ -59,18 +59,18 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
output = modname .. ":slab_" .. subname .. " 6", output = modname .. ":slab_" .. subname .. " 6",
recipe = {{recipeitem, recipeitem, recipeitem}}, recipe = {{recipeitem, recipeitem, recipeitem}},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slab_" .. subname, output = modname .. ":slab_" .. subname,
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slab_" .. subname, output = modname .. ":slab_" .. subname,
recipe = {{modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}}, recipe = {{modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}},
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slab_" .. subname, output = modname .. ":slab_" .. subname,
recipe = { recipe = {
@ -84,7 +84,7 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
output = recipeitem, output = recipeitem,
recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname}, recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slab_" .. subname .. " 3", output = modname .. ":slab_" .. subname .. " 3",

View File

@ -129,7 +129,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
mesh = "moreblocks_slope.obj", mesh = "moreblocks_slope.obj",
collision_box = box_slope, collision_box = box_slope,
selection_box = box_slope, selection_box = box_slope,
}, },
["_half"] = { ["_half"] = {
mesh = "moreblocks_slope_half.obj", mesh = "moreblocks_slope_half.obj",
@ -141,9 +141,9 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
collision_box = box_slope_half_raised, collision_box = box_slope_half_raised,
selection_box = box_slope_half_raised, selection_box = box_slope_half_raised,
}, },
--============================================================== --==============================================================
["_inner"] = { ["_inner"] = {
mesh = "moreblocks_slope_inner.obj", mesh = "moreblocks_slope_inner.obj",
collision_box = box_slope_inner, collision_box = box_slope_inner,
@ -159,9 +159,9 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
collision_box = box_slope_inner_half_raised, collision_box = box_slope_inner_half_raised,
selection_box = box_slope_inner_half_raised, selection_box = box_slope_inner_half_raised,
}, },
--============================================================== --==============================================================
["_outer"] = { ["_outer"] = {
mesh = "moreblocks_slope_outer.obj", mesh = "moreblocks_slope_outer.obj",
collision_box = box_slope_outer, collision_box = box_slope_outer,
@ -177,9 +177,9 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
collision_box = box_slope_outer_half_raised, collision_box = box_slope_outer_half_raised,
selection_box = box_slope_outer_half_raised, selection_box = box_slope_outer_half_raised,
}, },
--============================================================== --==============================================================
["_outer_cut"] = { ["_outer_cut"] = {
mesh = "moreblocks_slope_outer_cut.obj", mesh = "moreblocks_slope_outer_cut.obj",
collision_box = box_slope_outer, collision_box = box_slope_outer,
@ -214,7 +214,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
end end
-- Some saw-less recipes: -- Some saw-less recipes:
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. " 7", output = modname .. ":slope_" .. subname .. " 7",
recipe = { recipe = {
@ -232,7 +232,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{modname .. ":panel_" .. subname, recipeitem, recipeitem}, {modname .. ":panel_" .. subname, recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. "_half 10", output = modname .. ":slope_" .. subname .. "_half 10",
recipe = { recipe = {
@ -248,7 +248,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{modname .. ":panel_" .. subname, recipeitem, recipeitem}, {modname .. ":panel_" .. subname, recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. "_half_raised 7", output = modname .. ":slope_" .. subname .. "_half_raised 7",
recipe = { recipe = {
@ -257,7 +257,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{recipeitem, recipeitem, recipeitem}, {recipeitem, recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. "_half_raised 7", output = modname .. ":slope_" .. subname .. "_half_raised 7",
recipe = { recipe = {
@ -266,7 +266,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{recipeitem, recipeitem, recipeitem}, {recipeitem, recipeitem, recipeitem},
}, },
}) })
--===================================================== Inner == --===================================================== Inner ==
minetest.register_craft({ minetest.register_craft({
@ -286,7 +286,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{modname .. ":stair_" .. subname .. "_half", recipeitem, recipeitem}, {modname .. ":stair_" .. subname .. "_half", recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. "_inner_half 10", output = modname .. ":slope_" .. subname .. "_inner_half 10",
recipe = { recipe = {
@ -302,7 +302,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{modname .. ":stair_" .. subname .. "_half", recipeitem, recipeitem}, {modname .. ":stair_" .. subname .. "_half", recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. "_inner_half_raised 7", output = modname .. ":slope_" .. subname .. "_inner_half_raised 7",
recipe = { recipe = {
@ -311,7 +311,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{recipeitem, recipeitem, recipeitem}, {recipeitem, recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. "_inner_half_raised 7", output = modname .. ":slope_" .. subname .. "_inner_half_raised 7",
recipe = { recipe = {
@ -320,7 +320,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{recipeitem, recipeitem, recipeitem}, {recipeitem, recipeitem, recipeitem},
}, },
}) })
--===================================================== Outer == --===================================================== Outer ==
minetest.register_craft({ minetest.register_craft({
@ -340,7 +340,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{modname .. ":micro_" .. subname, recipeitem, recipeitem}, {modname .. ":micro_" .. subname, recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. "_outer_half 10", output = modname .. ":slope_" .. subname .. "_outer_half 10",
recipe = { recipe = {
@ -356,7 +356,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{modname .. ":micro_" .. subname, recipeitem, recipeitem}, {modname .. ":micro_" .. subname, recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. "_outer_half_raised 7", output = modname .. ":slope_" .. subname .. "_outer_half_raised 7",
recipe = { recipe = {
@ -365,7 +365,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{recipeitem, recipeitem, recipeitem}, {recipeitem, recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
output = modname .. ":slope_" .. subname .. "_outer_half_raised 7", output = modname .. ":slope_" .. subname .. "_outer_half_raised 7",
recipe = { recipe = {
@ -374,83 +374,83 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
{recipeitem, recipeitem, recipeitem}, {recipeitem, recipeitem, recipeitem},
}, },
}) })
--================================================= Shapeless == --================================================= Shapeless ==
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = recipeitem, output = recipeitem,
recipe = {modname .. ":slope_" .. subname, modname .. ":slope_" .. subname}, recipe = {modname .. ":slope_" .. subname, modname .. ":slope_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = recipeitem, output = recipeitem,
recipe = {modname .. ":slope_" .. subname .. "_outer_cut", modname .. ":slope_" .. subname .. "_outer_cut"}, recipe = {modname .. ":slope_" .. subname .. "_outer_cut", modname .. ":slope_" .. subname .. "_outer_cut"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = recipeitem, output = recipeitem,
recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half_raised"}, recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half_raised"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = recipeitem, output = recipeitem,
recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half", recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"}, modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slab_" .. subname, output = modname .. ":slab_" .. subname,
recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"}, recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slope_" .. subname .. "_half_raised", output = modname .. ":slope_" .. subname .. "_half_raised",
recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half", recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
modname .. ":slope_" .. subname .. "_half"}, modname .. ":slope_" .. subname .. "_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slope_" .. subname .. "_half_raised", output = modname .. ":slope_" .. subname .. "_half_raised",
recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_half"}, recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slope_" .. subname .. "_inner_half_raised", output = modname .. ":slope_" .. subname .. "_inner_half_raised",
recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_half"}, recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slope_" .. subname .. "_outer_half_raised", output = modname .. ":slope_" .. subname .. "_outer_half_raised",
recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_half"}, recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slope_" .. subname .. "_outer_cut_half_raised", output = modname .. ":slope_" .. subname .. "_outer_cut_half_raised",
recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_cut_half"}, recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_cut_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slope_" .. subname .. "_outer_cut", output = modname .. ":slope_" .. subname .. "_outer_cut",
recipe = {modname .. ":slope_" .. subname .. "_outer"}, recipe = {modname .. ":slope_" .. subname .. "_outer"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slope_" .. subname .. "_outer_cut_half", output = modname .. ":slope_" .. subname .. "_outer_cut_half",
recipe = {modname .. ":slope_" .. subname .. "_outer_half"}, recipe = {modname .. ":slope_" .. subname .. "_outer_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":slope_" .. subname .. "_outer_cut_half_raised", output = modname .. ":slope_" .. subname .. "_outer_cut_half_raised",

View File

@ -124,7 +124,7 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
minetest.register_alias("stairs:stair_" .. subname, modname .. ":stair_" .. subname) minetest.register_alias("stairs:stair_" .. subname, modname .. ":stair_" .. subname)
-- Some saw-less recipes: -- Some saw-less recipes:
minetest.register_craft({ minetest.register_craft({
output = modname .. ":stair_" .. subname .. " 8", output = modname .. ":stair_" .. subname .. " 8",
recipe = { recipe = {
@ -142,73 +142,73 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
{recipeitem, recipeitem, recipeitem}, {recipeitem, recipeitem, recipeitem},
}, },
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname, output = modname .. ":stair_" .. subname,
recipe = {modname .. ":panel_" .. subname, modname .. ":slab_" .. subname}, recipe = {modname .. ":panel_" .. subname, modname .. ":slab_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname, output = modname .. ":stair_" .. subname,
recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname .. "_outer", output = modname .. ":stair_" .. subname .. "_outer",
recipe = {modname .. ":micro_" .. subname, modname .. ":slab_" .. subname}, recipe = {modname .. ":micro_" .. subname, modname .. ":slab_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname .. "_half", output = modname .. ":stair_" .. subname .. "_half",
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname .. "_half", output = modname .. ":stair_" .. subname .. "_half",
recipe = {modname .. ":panel_" .. subname, modname .. ":micro_" .. subname}, recipe = {modname .. ":panel_" .. subname, modname .. ":micro_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname .. "_right_half", output = modname .. ":stair_" .. subname .. "_right_half",
recipe = {modname .. ":stair_" .. subname .. "_half"}, recipe = {modname .. ":stair_" .. subname .. "_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname .. "_half", output = modname .. ":stair_" .. subname .. "_half",
recipe = {modname .. ":stair_" .. subname .. "_right_half"}, recipe = {modname .. ":stair_" .. subname .. "_right_half"},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname, output = modname .. ":stair_" .. subname,
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname .. "_inner", output = modname .. ":stair_" .. subname .. "_inner",
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname .. "_outer", output = modname .. ":stair_" .. subname .. "_outer",
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname}, recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = modname .. ":stair_" .. subname, output = modname .. ":stair_" .. subname,
recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}, recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
}) })
minetest.register_craft({ -- See mirrored variation of the recipe below. minetest.register_craft({ -- See mirrored variation of the recipe below.
output = modname .. ":stair_" .. subname .. "_alt", output = modname .. ":stair_" .. subname .. "_alt",
recipe = { recipe = {
@ -216,7 +216,7 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
{"" , modname .. ":panel_" .. subname}, {"" , modname .. ":panel_" .. subname},
}, },
}) })
minetest.register_craft({ -- Mirrored variation of the recipe above. minetest.register_craft({ -- Mirrored variation of the recipe above.
output = modname .. ":stair_" .. subname .. "_alt", output = modname .. ":stair_" .. subname .. "_alt",
recipe = { recipe = {

View File

@ -860,7 +860,7 @@ function nether.grow_tree(pos, generated)
local emerged_pos1, emerged_pos2 = manip:read_from_map(min, max) local emerged_pos1, emerged_pos2 = manip:read_from_map(min, max)
local area = VoxelArea:new({MinEdge=emerged_pos1, MaxEdge=emerged_pos2}) local area = VoxelArea:new({MinEdge=emerged_pos1, MaxEdge=emerged_pos2})
local nodes = manip:get_data() local nodes = manip:get_data()
local param2s = manip:get_param2_data() local param2s = manip:get_param2_data()
for _,p in pairs(leaf_ps) do for _,p in pairs(leaf_ps) do
p = area:indexp(p) p = area:indexp(p)

View File

@ -366,7 +366,7 @@ minetest.register_node("nether:apple", {
if nether_port(user, vector.round(user:getpos())) then if nether_port(user, vector.round(user:getpos())) then
return itemstack return itemstack
end end
local p_hunger = tonumber(hud.hunger[user:get_player_name()]) local p_hunger = tonumber(hud.hunger[user:get_player_name()])
if not p_hunger then if not p_hunger then
return return
@ -428,7 +428,7 @@ minetest.register_node("nether:vine", {
minetest.node_dig(p, nn, digger) minetest.node_dig(p, nn, digger)
end end
end end
end end
}) })

View File

@ -305,14 +305,14 @@ local function check_portal(p1, p2)
else else
return false return false
end end
if not move_check(p1, p2.y, "y") then if not move_check(p1, p2.y, "y") then
return false return false
end end
if not move_check(p2, p1.y, "y") then if not move_check(p2, p1.y, "y") then
return false return false
end end
return true return true
end end
@ -343,7 +343,7 @@ local function make_portal(pos)
print("[nether] aborted, obsidian portals can't be used to get out") print("[nether] aborted, obsidian portals can't be used to get out")
return return
end end
for d=1,2 do for d=1,2 do
for y=p1.y+1,p2.y-1 do for y=p1.y+1,p2.y-1 do
local p local p
@ -357,18 +357,18 @@ local function make_portal(pos)
end end
end end
end end
local param2 local param2
if p1.z == p2.z then if p1.z == p2.z then
param2 = 0 param2 = 0
else else
param2 = 1 param2 = 1
end end
local target = {x=p1.x, y=p1.y, z=p1.z} local target = {x=p1.x, y=p1.y, z=p1.z}
target.x = target.x + 1 target.x = target.x + 1
target.y = portal_target + math.random(4) target.y = portal_target + math.random(4)
for d=0,3 do for d=0,3 do
for y=p1.y,p2.y do for y=p1.y,p2.y do
local p = {} local p = {}

View File

@ -4,15 +4,15 @@
-- bush leaf textures are cc-by-sa 3.0. from VannessaE's moretrees mod. (Leaf texture created by RealBadAngel or VanessaE) -- bush leaf textures are cc-by-sa 3.0. from VannessaE's moretrees mod. (Leaf texture created by RealBadAngel or VanessaE)
-- Branch textures created by Neuromancer. -- Branch textures created by Neuromancer.
-- Licence for Code and Non-Bush leaf code is WTFPL. -- Licence for Code and Non-Bush leaf code is WTFPL.
abstract_bushes = {} abstract_bushes = {}
minetest.register_node("bushes:youngtree2_bottom", { minetest.register_node("bushes:youngtree2_bottom", {
description = "Young Tree 2 (bottom)", description = "Young Tree 2 (bottom)",
drawtype="nodebox", drawtype="nodebox",
tiles = {"bushes_youngtree2trunk.png"}, tiles = {"bushes_youngtree2trunk.png"},
inventory_image = "bushes_youngtree2trunk_inv.png", inventory_image = "bushes_youngtree2trunk_inv.png",
wield_image = "bushes_youngtree2trunk_inv.png", wield_image = "bushes_youngtree2trunk_inv.png",
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
is_ground_content = true, is_ground_content = true,
@ -27,7 +27,7 @@ node_box = {
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'default:stick' drop = 'default:stick'
}) })
local BushBranchCenter = { {1,1}, {3,2} } local BushBranchCenter = { {1,1}, {3,2} }
for i in pairs(BushBranchCenter) do for i in pairs(BushBranchCenter) do
local Num = BushBranchCenter[i][1] local Num = BushBranchCenter[i][1]
@ -56,8 +56,8 @@ for i in pairs(BushBranchCenter) do
sunlight_propagates = true, sunlight_propagates = true,
groups = { groups = {
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks -- tree=1, -- MM: disabled because some recipes use group:tree for trunks
snappy=3, snappy=3,
flammable=2, flammable=2,
leaves=1 leaves=1
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -77,8 +77,8 @@ for i in pairs(BushBranchSide) do
--[[bottom]]"bushes_branches_center_"..TexNum..".png", --[[bottom]]"bushes_branches_center_"..TexNum..".png",
--[[right]] "bushes_branches_left_"..TexNum..".png", --[[right]] "bushes_branches_left_"..TexNum..".png",
--[[left]] "bushes_branches_right_"..TexNum..".png", -- MM: We could also mirror the previous here, --[[left]] "bushes_branches_right_"..TexNum..".png", -- MM: We could also mirror the previous here,
--[[back]] "bushes_branches_center_"..TexNum..".png",-- unless U really want 'em 2 B different --[[back]] "bushes_branches_center_"..TexNum..".png",-- unless U really want 'em 2 B different
--[[front]] "bushes_branches_right_"..TexNum..".png" --[[front]] "bushes_branches_right_"..TexNum..".png"
}, },
node_box = { node_box = {
type = "fixed", type = "fixed",
@ -99,8 +99,8 @@ for i in pairs(BushBranchSide) do
sunlight_propagates = true, sunlight_propagates = true,
groups = { groups = {
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks -- tree=1, -- MM: disabled because some recipes use group:tree for trunks
snappy=3, snappy=3,
flammable=2, flammable=2,
leaves=1 leaves=1
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -110,23 +110,23 @@ end
local BushLeafNode = { {1}, {2}} local BushLeafNode = { {1}, {2}}
for i in pairs(BushLeafNode) do for i in pairs(BushLeafNode) do
local Num = BushLeafNode[i][1] local Num = BushLeafNode[i][1]
minetest.register_node("bushes:BushLeaves"..Num, { minetest.register_node("bushes:BushLeaves"..Num, {
description = "Bush Leaves "..Num, description = "Bush Leaves "..Num,
drawtype = "allfaces_optional", drawtype = "allfaces_optional",
tiles = {"bushes_leaves_"..Num..".png"}, tiles = {"bushes_leaves_"..Num..".png"},
paramtype = "light", paramtype = "light",
groups = { -- MM: Should we add leafdecay? groups = { -- MM: Should we add leafdecay?
snappy=3, snappy=3,
flammable=2, flammable=2,
attached_node=1 attached_node=1
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
}) })
end end
abstract_bushes.grow_bush = function(pos) abstract_bushes.grow_bush = function(pos)
local leaf_type = math.random(1,2) local leaf_type = math.random(1,2)
local bush_side_height = math.random(0,1) local bush_side_height = math.random(0,1)
local chance_of_bush_node_right = math.random(1,10) local chance_of_bush_node_right = math.random(1,10)
if chance_of_bush_node_right> 5 then if chance_of_bush_node_right> 5 then
@ -144,25 +144,25 @@ abstract_bushes.grow_bush = function(pos)
bush_side_height = math.random(0,1) bush_side_height = math.random(0,1)
local front_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z+1} local front_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z+1}
abstract_bushes.grow_bush_node(front_pos,2,leaf_type) abstract_bushes.grow_bush_node(front_pos,2,leaf_type)
end end
local chance_of_bush_node_back = math.random(1,10) local chance_of_bush_node_back = math.random(1,10)
if chance_of_bush_node_back> 5 then if chance_of_bush_node_back> 5 then
bush_side_height = math.random(0,1) bush_side_height = math.random(0,1)
local back_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z-1} local back_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z-1}
abstract_bushes.grow_bush_node(back_pos,0,leaf_type) abstract_bushes.grow_bush_node(back_pos,0,leaf_type)
end end
abstract_bushes.grow_bush_node(pos,5,leaf_type) abstract_bushes.grow_bush_node(pos,5,leaf_type)
end end
abstract_bushes.grow_bush_node = function(pos,dir, leaf_type) abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z} local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z}
local bush_branch_type = 2 local bush_branch_type = 2
-- MM: I'm not sure if it's slower now than before... -- MM: I'm not sure if it's slower now than before...
if dir ~= 5 and leaf_type == 1 then if dir ~= 5 and leaf_type == 1 then
bush_branch_type = 2 bush_branch_type = 2
@ -178,7 +178,7 @@ abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
bush_branch_type = 3 bush_branch_type = 3
dir = 1 dir = 1
end end
if minetest.get_node(right_here).name == "air" -- instead of check_air = true, if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then or minetest.get_node(right_here).name == "default:junglegrass" then
minetest.set_node(right_here, {name="bushes:bushbranches"..bush_branch_type , param2=dir}) minetest.set_node(right_here, {name="bushes:bushbranches"..bush_branch_type , param2=dir})
@ -196,7 +196,7 @@ end
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
"sumpf:peat", "sumpf:peat",
"sumpf:sumpf" "sumpf:sumpf"
@ -207,21 +207,21 @@ plantslib:register_generate_plant({
plantlife_limit = -0.9, plantlife_limit = -0.9,
}, },
abstract_bushes.grow_bush abstract_bushes.grow_bush
) )
abstract_bushes.grow_youngtree2 = function(pos) abstract_bushes.grow_youngtree2 = function(pos)
local height = math.random(4,5) local height = math.random(4,5)
abstract_bushes.grow_youngtree_node2(pos,height) abstract_bushes.grow_youngtree_node2(pos,height)
end end
abstract_bushes.grow_youngtree_node2 = function(pos, height) abstract_bushes.grow_youngtree_node2 = function(pos, height)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z} local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z}
local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z} local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z}
local three_above_right_here = {x=pos.x, y=pos.y+4, z=pos.z} local three_above_right_here = {x=pos.x, y=pos.y+4, z=pos.z}
if minetest.get_node(right_here).name == "air" -- instead of check_air = true, if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then or minetest.get_node(right_here).name == "default:junglegrass" then
if height == 4 then if height == 4 then
@ -234,14 +234,14 @@ abstract_bushes.grow_youngtree_node2 = function(pos, height)
minetest.set_node(three_above_right_here, {name="bushes:BushLeaves1" }) minetest.set_node(three_above_right_here, {name="bushes:BushLeaves1" })
minetest.set_node(three_above_right_here_south, {name="bushes:BushLeaves1" }) minetest.set_node(three_above_right_here_south, {name="bushes:BushLeaves1" })
end end
end end
end end
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
"sumpf:peat", "sumpf:peat",
"sumpf:sumpf" "sumpf:sumpf"
@ -252,6 +252,6 @@ plantslib:register_generate_plant({
plantlife_limit = -0.9, plantlife_limit = -0.9,
}, },
abstract_bushes.grow_youngtree2 abstract_bushes.grow_youngtree2
) )
--http://dev.minetest.net/Node_Drawtypes --http://dev.minetest.net/Node_Drawtypes

View File

@ -16,7 +16,7 @@ minetest.register_craft({
if minetest.get_modpath("farming") and farming.mod == "redo" then if minetest.get_modpath("farming") and farming.mod == "redo" then
--[[ We really have nothing to do to use farming:sugar in the recipes --[[ We really have nothing to do to use farming:sugar in the recipes
because they use the generic group group:food_sugar because they use the generic group group:food_sugar
which is added to the groups list of farming:sugar by the mod "food". which is added to the groups list of farming:sugar by the mod "food".
--]] --]]
--Temporary alias to replace existing bushes:sugar in the world --Temporary alias to replace existing bushes:sugar in the world

View File

@ -11,7 +11,7 @@ plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
-- find out which bush type we are dealing with -- find out which bush type we are dealing with
local bush_name = "" local bush_name = ""
local can_harvest = false local can_harvest = false
if oldnode.name == "bushes:fruitless_bush" then if oldnode.name == "bushes:fruitless_bush" then
-- this bush has not grown fruits yet (but will eventually) -- this bush has not grown fruits yet (but will eventually)
bush_name = oldmetadata.fields.bush_type bush_name = oldmetadata.fields.bush_type

View File

@ -28,7 +28,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
break break
end end
end end
if ground_y then if ground_y then
local p = {x=x,y=ground_y+1,z=z} local p = {x=x,y=ground_y+1,z=z}
local nn = minetest.get_node(p).name local nn = minetest.get_node(p).name
@ -44,7 +44,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
end end
end end
end end
end end
end end

View File

@ -88,10 +88,10 @@ minetest.register_node("cavestuff:stalactite_1",{
{-0.037500,-0.837500,0.037500,0.037500,0.500000,-0.025000}, {-0.037500,-0.837500,0.037500,0.037500,0.500000,-0.025000},
} }
}, },
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local pt = pointed_thing local pt = pointed_thing
if minetest.get_node(pt.under).name=="default:stone" if minetest.get_node(pt.under).name=="default:stone"
and minetest.get_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}).name=="air" and minetest.get_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}).name=="air"
and minetest.get_node({x=pt.under.x, y=pt.under.y-2, z=pt.under.z}).name=="air" then and minetest.get_node({x=pt.under.x, y=pt.under.y-2, z=pt.under.z}).name=="air" then
minetest.set_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}, {name="cavestuff:stalactite_"..math.random(1,3)}) minetest.set_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}, {name="cavestuff:stalactite_"..math.random(1,3)})

View File

@ -6,7 +6,7 @@
-- License (everything): WTFPL -- License (everything): WTFPL
-- Contains code from: plants_lib -- Contains code from: plants_lib
-- Looked at code from: default -- Looked at code from: default
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
abstract_dryplants.grow_juncus = function(pos) abstract_dryplants.grow_juncus = function(pos)
@ -86,7 +86,7 @@ minetest.register_node("dryplants:juncus_02", {
-- near water or swamp -- near water or swamp
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
--"default:desert_sand", --"default:desert_sand",
--"default:sand", --"default:sand",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
@ -107,7 +107,7 @@ plantslib:register_generate_plant({
-- at dunes/beach -- at dunes/beach
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
--"default:dirt_with_grass", --"default:dirt_with_grass",
--"default:desert_sand", --"default:desert_sand",
"default:sand", "default:sand",
--"stoneage:grass_with_silex", --"stoneage:grass_with_silex",

View File

@ -5,7 +5,7 @@
-- License (everything): WTFPL -- License (everything): WTFPL
-- Contains code from: plants_lib -- Contains code from: plants_lib
-- Looked at code from: default -- Looked at code from: default
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
abstract_dryplants.grow_grass_variation = function(pos) abstract_dryplants.grow_grass_variation = function(pos)

View File

@ -6,7 +6,7 @@
-- License (everything): WTFPL -- License (everything): WTFPL
-- Contains code from: plants_lib -- Contains code from: plants_lib
-- Looked at code from: default, trees -- Looked at code from: default, trees
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- NOTES (from wikipedia, some of this might get implemented) -- NOTES (from wikipedia, some of this might get implemented)
@ -70,7 +70,7 @@ abstract_dryplants.grow_reedmace_water = function(pos)
minetest.set_node(pos_02, {name="dryplants:reedmace_height_3_spikes"}) minetest.set_node(pos_02, {name="dryplants:reedmace_height_3_spikes"})
else else
minetest.set_node(pos_02, {name="dryplants:reedmace_height_3"}) minetest.set_node(pos_02, {name="dryplants:reedmace_height_3"})
end end
end end
end end
end end
@ -212,8 +212,8 @@ minetest.register_node("dryplants:reedmace", {
after_destruct = function(pos,oldnode) after_destruct = function(pos,oldnode)
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if node.name == "dryplants:reedmace_top" if node.name == "dryplants:reedmace_top"
or node.name == "dryplants:reedmace_spikes" then or node.name == "dryplants:reedmace_spikes" then
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
minetest.add_item(pos,"dryplants:reedmace_sapling") minetest.add_item(pos,"dryplants:reedmace_sapling")
end end
end, end,
@ -241,10 +241,10 @@ minetest.register_node("dryplants:reedmace_bottom", {
}, },
after_destruct = function(pos,oldnode) after_destruct = function(pos,oldnode)
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if node.name == "dryplants:reedmace" if node.name == "dryplants:reedmace"
or node.name == "dryplants:reedmace_top" or node.name == "dryplants:reedmace_top"
or node.name == "dryplants:reedmace_spikes" then or node.name == "dryplants:reedmace_spikes" then
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
minetest.add_item(pos,"dryplants:reedmace_sapling") minetest.add_item(pos,"dryplants:reedmace_sapling")
end end
end, end,
@ -348,7 +348,7 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
-- near water or swamp -- near water or swamp
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"default:desert_sand", "default:desert_sand",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
"sumpf:peat", "sumpf:peat",
@ -370,7 +370,7 @@ plantslib:register_generate_plant({
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:dirt", "default:dirt",
"default:dirt_with_grass", "default:dirt_with_grass",
--"default:desert_sand", --"default:desert_sand",
--"stoneage:grass_with_silex", --"stoneage:grass_with_silex",
"stoneage:sand_with_silex", "stoneage:sand_with_silex",

View File

@ -5,7 +5,7 @@
-- License (everything): WTFPL -- License (everything): WTFPL
-- Contains code from: plants_lib -- Contains code from: plants_lib
-- Looked at code from: 4seasons, default -- Looked at code from: 4seasons, default
-- Supports: vines -- Supports: vines
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
assert(abstract_ferns.config.enable_giant_treefern == true) assert(abstract_ferns.config.enable_giant_treefern == true)
@ -21,7 +21,7 @@ abstract_ferns.grow_giant_tree_fern = function(pos)
end end
local size = math.random(12,16) -- min of range must be >= 4 local size = math.random(12,16) -- min of range must be >= 4
local leafchecks = { local leafchecks = {
{ {
direction = 3, direction = 3,
@ -238,8 +238,8 @@ minetest.register_node("ferns:fern_trunk_big", {
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
after_destruct = function(pos,oldnode) after_destruct = function(pos,oldnode)
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if node.name == "ferns:fern_trunk_big" or node.name == "ferns:fern_trunk_big_top" then if node.name == "ferns:fern_trunk_big" or node.name == "ferns:fern_trunk_big_top" then
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
minetest.add_item(pos,"ferns:fern_trunk_big") minetest.add_item(pos,"ferns:fern_trunk_big")
end end
end, end,

View File

@ -6,7 +6,7 @@
-- Contains code from: plants_lib -- Contains code from: plants_lib
-- Looked at code from: default, flowers, trees -- Looked at code from: default, flowers, trees
-- Dependencies: plants_lib -- Dependencies: plants_lib
-- Supports: dryplants, stoneage, sumpf -- Supports: dryplants, stoneage, sumpf
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
assert(abstract_ferns.config.enable_horsetails == true) assert(abstract_ferns.config.enable_horsetails == true)

View File

@ -4,7 +4,7 @@ local version = "0.2.0"
local mname = "ferns" -- former "archaeplantae" local mname = "ferns" -- former "archaeplantae"
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- (by Mossmanikin) -- (by Mossmanikin)
-- License (everything): WTFPL -- License (everything): WTFPL
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
abstract_ferns = {} abstract_ferns = {}

View File

@ -1,6 +1,6 @@
-- In case you don't wanna have errors: -- In case you don't wanna have errors:
-- Only change what's behind a "=" (or "--"). -- Only change what's behind a "=" (or "--").
-- Don't use caps (behind a "="). -- Don't use caps (behind a "=").
-- If there's a "false" (behind a "=") you can change it to "true" (and the other way around). -- If there's a "false" (behind a "=") you can change it to "true" (and the other way around).

View File

@ -4,7 +4,7 @@
-- by Mossmanikin -- by Mossmanikin
-- License (everything): WTFPL -- License (everything): WTFPL
-- Contains code from: plants_lib -- Contains code from: plants_lib
-- Looked at code from: default , trees -- Looked at code from: default , trees
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
assert(abstract_ferns.config.enable_treefern == true) assert(abstract_ferns.config.enable_treefern == true)
@ -17,10 +17,10 @@ abstract_ferns.grow_tree_fern = function(pos)
and minetest.get_node(pos_01).name ~= "default:junglegrass" then and minetest.get_node(pos_01).name ~= "default:junglegrass" then
return return
end end
local size = math.random(1, 5) local size = math.random(1, 5)
local crown = ({ "ferns:tree_fern_leaves", "ferns:tree_fern_leaves_02" })[math.random(1, 2)] local crown = ({ "ferns:tree_fern_leaves", "ferns:tree_fern_leaves_02" })[math.random(1, 2)]
local i = 1 local i = 1
while (i < size-1) do while (i < size-1) do
if minetest.get_node({x = pos.x, y = pos.y + i + 1, z = pos.z}).name ~= "air" then if minetest.get_node({x = pos.x, y = pos.y + i + 1, z = pos.z}).name ~= "air" then
@ -117,8 +117,8 @@ minetest.register_node("ferns:fern_trunk", {
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
after_destruct = function(pos,oldnode) after_destruct = function(pos,oldnode)
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if node.name == "ferns:fern_trunk" then if node.name == "ferns:fern_trunk" then
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
minetest.add_item(pos,"ferns:fern_trunk") minetest.add_item(pos,"ferns:fern_trunk")
end end
end, end,

View File

@ -42,7 +42,7 @@ for i in ipairs(lilies_list) do
minetest.register_node(":flowers:waterlily"..deg1, { minetest.register_node(":flowers:waterlily"..deg1, {
description = S("Waterlily"), description = S("Waterlily"),
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"flowers_waterlily"..deg2..".png", "flowers_waterlily"..deg2..".png",
"flowers_waterlily"..deg2..".png^[transformFY" "flowers_waterlily"..deg2..".png^[transformFY"
}, },
@ -79,7 +79,7 @@ for i in ipairs(lilies_list) do
if plantslib:get_nodedef_field(under_node.name, "buildable_to") then if plantslib:get_nodedef_field(under_node.name, "buildable_to") then
if under_node.name ~= "default:water_source" then if under_node.name ~= "default:water_source" then
place_pos = pt.under place_pos = pt.under
elseif top_node.name ~= "default:water_source" elseif top_node.name ~= "default:water_source"
and plantslib:get_nodedef_field(top_node.name, "buildable_to") then and plantslib:get_nodedef_field(top_node.name, "buildable_to") then
place_pos = top_pos place_pos = top_pos
else else
@ -138,11 +138,11 @@ for i in ipairs(algae_list) do
num = "_"..algae_list[i][1] num = "_"..algae_list[i][1]
algae_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 } algae_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 }
end end
minetest.register_node(":flowers:seaweed"..num, { minetest.register_node(":flowers:seaweed"..num, {
description = S("Seaweed"), description = S("Seaweed"),
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"flowers_seaweed"..num..".png", "flowers_seaweed"..num..".png",
"flowers_seaweed"..num..".png^[transformFY" "flowers_seaweed"..num..".png^[transformFY"
}, },
@ -161,9 +161,9 @@ for i in ipairs(algae_list) do
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 }, fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 },
}, },
buildable_to = true, buildable_to = true,
liquids_pointable = true, liquids_pointable = true,
drop = "flowers:seaweed", drop = "flowers:seaweed",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
@ -179,7 +179,7 @@ for i in ipairs(algae_list) do
if plantslib:get_nodedef_field(under_node.name, "buildable_to") then if plantslib:get_nodedef_field(under_node.name, "buildable_to") then
if under_node.name ~= "default:water_source" then if under_node.name ~= "default:water_source" then
place_pos = pt.under place_pos = pt.under
elseif top_node.name ~= "default:water_source" elseif top_node.name ~= "default:water_source"
and plantslib:get_nodedef_field(top_node.name, "buildable_to") then and plantslib:get_nodedef_field(top_node.name, "buildable_to") then
place_pos = top_pos place_pos = top_pos
else else
@ -240,7 +240,7 @@ for i in ipairs(flowers_list) do
local flowerdesc = flowers_list[i][1] local flowerdesc = flowers_list[i][1]
local flower = flowers_list[i][2] local flower = flowers_list[i][2]
local craftwith = flowers_list[i][3] local craftwith = flowers_list[i][3]
minetest.register_node(":flowers:potted_"..flower, { minetest.register_node(":flowers:potted_"..flower, {
description = S("Potted "..flowerdesc), description = S("Potted "..flowerdesc),
drawtype = "mesh", drawtype = "mesh",
@ -254,7 +254,7 @@ for i in ipairs(flowers_list) do
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -0.2, -0.5, -0.2, 0.2, 0.4, 0.2 }, fixed = { -0.2, -0.5, -0.2, 0.2, 0.4, 0.2 },
}, },
}) })
minetest.register_craft( { minetest.register_craft( {
@ -336,7 +336,7 @@ flowers_plus.grow_waterlily = function(pos)
if lilies_list[i][1] ~= nil then if lilies_list[i][1] ~= nil then
ext = "_"..lilies_list[i][1] ext = "_"..lilies_list[i][1]
end end
if chance == num then if chance == num then
minetest.set_node(right_here, {name="flowers:waterlily"..ext, param2=math.random(0,3)}) minetest.set_node(right_here, {name="flowers:waterlily"..ext, param2=math.random(0,3)})
end end
@ -529,7 +529,7 @@ minetest.register_craft( {
-- cotton wads -> string (can be crafted into wool blocks) -- cotton wads -> string (can be crafted into wool blocks)
-- potted cotton plants -> potted white dandelions -- potted cotton plants -> potted white dandelions
minetest.register_alias("flowers:cotton_plant", "farming:cotton_8") minetest.register_alias("flowers:cotton_plant", "farming:cotton_8")
minetest.register_alias("flowers:flower_cotton", "farming:cotton_8") minetest.register_alias("flowers:flower_cotton", "farming:cotton_8")
minetest.register_alias("flowers:flower_cotton_pot", "flowers:potted_dandelion_white") minetest.register_alias("flowers:flower_cotton_pot", "flowers:potted_dandelion_white")
minetest.register_alias("flowers:potted_cotton_plant", "flowers:potted_dandelion_white") minetest.register_alias("flowers:potted_cotton_plant", "flowers:potted_dandelion_white")

View File

@ -36,7 +36,7 @@ minetest.register_craftitem("mushroom:poison",{
minetest.register_craft( { minetest.register_craft( {
output = "mushroom:identifier", output = "mushroom:identifier",
recipe = { recipe = {
{ "", "default:torch", "" }, { "", "default:torch", "" },
{ "default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot" }, { "default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot" },
} }

View File

@ -175,7 +175,7 @@ minetest.register_abm({
chance = 300, -- Modif MFF chance = 300, -- Modif MFF
action = function(pos, node) action = function(pos, node)
local top_pos = {x=pos.x, y=pos.y+1, z=pos.z} local top_pos = {x=pos.x, y=pos.y+1, z=pos.z}
if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8 if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8
and minetest.find_node_near(pos, 1, trees_list) and minetest.find_node_near(pos, 1, trees_list)
and minetest.find_node_near(pos, 3, "default:water_source") then and minetest.find_node_near(pos, 3, "default:water_source") then
if math.random(0, 1) == 0 then if math.random(0, 1) == 0 then
@ -194,7 +194,7 @@ minetest.register_abm({
chance = 300, -- Modif MFF chance = 300, -- Modif MFF
action = function(pos, node) action = function(pos, node)
local top_pos = {x=pos.x, y=pos.y+1, z=pos.z} local top_pos = {x=pos.x, y=pos.y+1, z=pos.z}
if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8 if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8
and minetest.find_node_near(pos, 1, {"default:water_source"}) then and minetest.find_node_near(pos, 1, {"default:water_source"}) then
if math.random(0,1) == 0 then if math.random(0,1) == 0 then
minetest.set_node(top_pos, {name="mushroom:brown_natural"}) minetest.set_node(top_pos, {name="mushroom:brown_natural"})
@ -219,7 +219,7 @@ minetest.register_abm({
local soil_pos = {x=pos.x, y=pos.y-1, z=pos.z} local soil_pos = {x=pos.x, y=pos.y-1, z=pos.z}
local soil = minetest.get_node(soil_pos) local soil = minetest.get_node(soil_pos)
local woodsoil_str = "woodsoils:.+_with_leaves_?" local woodsoil_str = "woodsoils:.+_with_leaves_?"
if minetest.get_node_light(pos, nil) < 8 if minetest.get_node_light(pos, nil) < 8
and minetest.find_node_near(pos, 1, trees_list) then and minetest.find_node_near(pos, 1, trees_list) then
local spread_x = math.random(-1, 1) local spread_x = math.random(-1, 1)
local spread_z = math.random(-1, 1) local spread_z = math.random(-1, 1)
@ -228,10 +228,10 @@ minetest.register_abm({
if minetest.get_node(newpos).name == "air" if minetest.get_node(newpos).name == "air"
and (newsoil.name == "default:dirt_with_grass" and (newsoil.name == "default:dirt_with_grass"
or newsoil.name == "default:dirt" or newsoil.name == "default:dirt"
or string.match(newsoil.name, woodsoil_str)) or string.match(newsoil.name, woodsoil_str))
and minetest.find_node_near(newpos, 3, "default:water_source") then and minetest.find_node_near(newpos, 3, "default:water_source") then
minetest.set_node(newpos, {name=node.name}) minetest.set_node(newpos, {name=node.name})
end end
end end
end end
}) })

View File

@ -44,7 +44,7 @@ end
function nature:grow_node(pos, nodename) function nature:grow_node(pos, nodename)
if pos ~= nil then if pos ~= nil then
local light_enough = (minetest.get_node_light(pos, nil) or 0) local light_enough = (minetest.get_node_light(pos, nil) or 0)
>= nature.minimum_growth_light >= nature.minimum_growth_light
if is_not_young(pos) and light_enough then if is_not_young(pos) and light_enough then
minetest.remove_node(pos) minetest.remove_node(pos)

View File

@ -125,7 +125,7 @@ end
function plantslib:register_generate_plant(biomedef, nodes_or_function_or_model) function plantslib:register_generate_plant(biomedef, nodes_or_function_or_model)
-- if calling code passes an undefined node for a surface or -- if calling code passes an undefined node for a surface or
-- as a node to be spawned, don't register an action for it. -- as a node to be spawned, don't register an action for it.
if type(nodes_or_function_or_model) == "string" if type(nodes_or_function_or_model) == "string"
@ -140,7 +140,7 @@ function plantslib:register_generate_plant(biomedef, nodes_or_function_or_model)
plantslib:dbg("Warning: Registered function call using deprecated string method: "..dump(nodes_or_function_or_model)) plantslib:dbg("Warning: Registered function call using deprecated string method: "..dump(nodes_or_function_or_model))
end end
if biomedef.check_air == false then if biomedef.check_air == false then
plantslib:dbg("Register no-air-check mapgen hook: "..dump(nodes_or_function_or_model)) plantslib:dbg("Register no-air-check mapgen hook: "..dump(nodes_or_function_or_model))
plantslib.actionslist_no_aircheck[#plantslib.actionslist_no_aircheck + 1] = { biomedef, nodes_or_function_or_model } plantslib.actionslist_no_aircheck[#plantslib.actionslist_no_aircheck + 1] = { biomedef, nodes_or_function_or_model }
local s = biomedef.surface local s = biomedef.surface
@ -216,7 +216,7 @@ function plantslib:populate_surfaces(biome, nodes_or_function_or_model, snodes,
else else
if string.find(biome_surfaces_string, "group:") then if string.find(biome_surfaces_string, "group:") then
for j = 1, #biome.surface do for j = 1, #biome.surface do
if string.find(biome.surface[j], "^group:") if string.find(biome.surface[j], "^group:")
and minetest.get_item_group(dest_node.name, biome.surface[j]) then and minetest.get_item_group(dest_node.name, biome.surface[j]) then
surface_ok = true surface_ok = true
break break
@ -495,13 +495,13 @@ function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa)
chance = biome.spawn_chance, chance = biome.spawn_chance,
neighbors = biome.neighbors, neighbors = biome.neighbors,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } local p_top = { x = pos.x, y = pos.y + 1, z = pos.z }
local n_top = minetest.get_node(p_top) local n_top = minetest.get_node(p_top)
local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale)
local noise1 = perlin_fertile_area:get2d({x=p_top.x, y=p_top.z}) local noise1 = perlin_fertile_area:get2d({x=p_top.x, y=p_top.z})
local noise2 = plantslib.perlin_temperature:get2d({x=p_top.x, y=p_top.z}) local noise2 = plantslib.perlin_temperature:get2d({x=p_top.x, y=p_top.z})
local noise3 = plantslib.perlin_humidity:get2d({x=p_top.x+150, y=p_top.z+50}) local noise3 = plantslib.perlin_humidity:get2d({x=p_top.x+150, y=p_top.z+50})
if noise1 > biome.plantlife_limit if noise1 > biome.plantlife_limit
and noise2 <= biome.temp_min and noise2 <= biome.temp_min
and noise2 >= biome.temp_max and noise2 >= biome.temp_max
and noise3 <= biome.humidity_min and noise3 <= biome.humidity_min
@ -544,7 +544,7 @@ function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa)
elseif biome.spawn_on_side then elseif biome.spawn_on_side then
local onside = plantslib:find_open_side(pos) local onside = plantslib:find_open_side(pos)
if onside then if onside then
minetest.set_node(onside.newpos, { name = plant_to_spawn, param2 = onside.facedir }) minetest.set_node(onside.newpos, { name = plant_to_spawn, param2 = onside.facedir })
end end
elseif biome.spawn_on_bottom then elseif biome.spawn_on_bottom then
@ -650,7 +650,7 @@ function plantslib:find_adjacent_wall(pos, verticals, randomflag)
local verts = dump(verticals) local verts = dump(verticals)
if randomflag then if randomflag then
local walltab = {} local walltab = {}
if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 3 end if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 3 end
if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 2 end if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 2 end
if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then walltab[#walltab + 1] = 5 end if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then walltab[#walltab + 1] = 5 end

View File

@ -15,7 +15,7 @@ end
abstract_trunks.place_twig = function(pos) abstract_trunks.place_twig = function(pos)
local twig_size = math.random(1,27) local twig_size = math.random(1,27)
local right_here = {x=pos.x , y=pos.y+1, z=pos.z } local right_here = {x=pos.x , y=pos.y+1, z=pos.z }
local north = {x=pos.x , y=pos.y+1, z=pos.z+1} local north = {x=pos.x , y=pos.y+1, z=pos.z+1}
local north_east = {x=pos.x+1, y=pos.y+1, z=pos.z+1} local north_east = {x=pos.x+1, y=pos.y+1, z=pos.z+1}
@ -25,7 +25,7 @@ abstract_trunks.place_twig = function(pos)
local south_west = {x=pos.x-1, y=pos.y+1, z=pos.z-1} local south_west = {x=pos.x-1, y=pos.y+1, z=pos.z-1}
local west = {x=pos.x-1, y=pos.y+1, z=pos.z } local west = {x=pos.x-1, y=pos.y+1, z=pos.z }
local north_west = {x=pos.x-1, y=pos.y+1, z=pos.z+1} local north_west = {x=pos.x-1, y=pos.y+1, z=pos.z+1}
local node_here = minetest.get_node(right_here) local node_here = minetest.get_node(right_here)
local node_north = minetest.get_node(north) local node_north = minetest.get_node(north)
local node_n_e = minetest.get_node(north_east) local node_n_e = minetest.get_node(north_east)
@ -35,17 +35,17 @@ abstract_trunks.place_twig = function(pos)
local node_s_w = minetest.get_node(south_west) local node_s_w = minetest.get_node(south_west)
local node_west = minetest.get_node(west) local node_west = minetest.get_node(west)
local node_n_w = minetest.get_node(north_west) local node_n_w = minetest.get_node(north_west)
-- small twigs -- small twigs
if twig_size <= 16 then if twig_size <= 16 then
minetest.set_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)}) minetest.set_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)})
end end
-- big twigs -- big twigs
if Big_Twigs == true then if Big_Twigs == true then
-- big twig 1 -- big twig 1
if twig_size == 17 then if twig_size == 17 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to
or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to) then or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then if minetest.registered_nodes[node_here.name].buildable_to then
minetest.set_node(right_here, {name="trunks:twig_5"}) minetest.set_node(right_here, {name="trunks:twig_5"})
end end
@ -59,7 +59,7 @@ abstract_trunks.place_twig = function(pos)
elseif twig_size == 18 then elseif twig_size == 18 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to
or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to) then or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then if minetest.registered_nodes[node_here.name].buildable_to then
minetest.set_node(right_here, {name="trunks:twig_5", param2=1}) minetest.set_node(right_here, {name="trunks:twig_5", param2=1})
end end
@ -73,7 +73,7 @@ abstract_trunks.place_twig = function(pos)
elseif twig_size == 19 then elseif twig_size == 19 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to
or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to) then or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then if minetest.registered_nodes[node_here.name].buildable_to then
minetest.set_node(right_here, {name="trunks:twig_5", param2=2}) minetest.set_node(right_here, {name="trunks:twig_5", param2=2})
end end
@ -87,7 +87,7 @@ abstract_trunks.place_twig = function(pos)
elseif twig_size == 20 then elseif twig_size == 20 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to
or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to) then or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then if minetest.registered_nodes[node_here.name].buildable_to then
minetest.set_node(right_here, {name="trunks:twig_5", param2=3}) minetest.set_node(right_here, {name="trunks:twig_5", param2=3})
end end
@ -98,11 +98,11 @@ abstract_trunks.place_twig = function(pos)
minetest.set_node(north, {name="trunks:twig_8", param2=3}) minetest.set_node(north, {name="trunks:twig_8", param2=3})
end end
end end
-- big twig 2 -- big twig 2
elseif twig_size == 21 then elseif twig_size == 21 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to
or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to) then or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then if minetest.registered_nodes[node_here.name].buildable_to then
minetest.set_node(right_here, {name="trunks:twig_9"}) minetest.set_node(right_here, {name="trunks:twig_9"})
end end
@ -116,7 +116,7 @@ abstract_trunks.place_twig = function(pos)
elseif twig_size == 22 then elseif twig_size == 22 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to
or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to) then or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then if minetest.registered_nodes[node_here.name].buildable_to then
minetest.set_node(right_here, {name="trunks:twig_9", param2=1}) minetest.set_node(right_here, {name="trunks:twig_9", param2=1})
end end
@ -130,7 +130,7 @@ abstract_trunks.place_twig = function(pos)
elseif twig_size == 23 then elseif twig_size == 23 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to
or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z-1}).name].buildable_to) then or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z-1}).name].buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then if minetest.registered_nodes[node_here.name].buildable_to then
minetest.set_node(right_here, {name="trunks:twig_9", param2=2}) minetest.set_node(right_here, {name="trunks:twig_9", param2=2})
end end
@ -144,7 +144,7 @@ abstract_trunks.place_twig = function(pos)
elseif twig_size == 24 then elseif twig_size == 24 then
if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to
or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to) then or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to) then
if minetest.registered_nodes[node_here.name].buildable_to then if minetest.registered_nodes[node_here.name].buildable_to then
minetest.set_node(right_here, {name="trunks:twig_9", param2=3}) minetest.set_node(right_here, {name="trunks:twig_9", param2=3})
end end
@ -202,11 +202,11 @@ local TRuNKS = {
-- MoD TRuNK NR -- MoD TRuNK NR
{"default", "tree", 1}, {"default", "tree", 1},
{"default", "jungletree", 2}, {"default", "jungletree", 2},
{"trees", "tree_conifer", 3}, {"trees", "tree_conifer", 3},
{"trees", "tree_mangrove", 4}, {"trees", "tree_mangrove", 4},
{"trees", "tree_palm", 5}, {"trees", "tree_palm", 5},
{"moretrees", "apple_tree_trunk", 6}, {"moretrees", "apple_tree_trunk", 6},
{"moretrees", "beech_trunk", 7}, {"moretrees", "beech_trunk", 7},
{"moretrees", "birch_trunk", 8}, {"moretrees", "birch_trunk", 8},
@ -227,7 +227,7 @@ for i in pairs(TRuNKS) do
local TRuNK = TRuNKS[i][2] local TRuNK = TRuNKS[i][2]
local NR = TRuNKS[i][3] local NR = TRuNKS[i][3]
local trunkname = MoD..":"..TRuNK local trunkname = MoD..":"..TRuNK
if minetest.get_modpath(MoD) ~= nil if minetest.get_modpath(MoD) ~= nil
and NR < 6 -- moretrees trunks allready have facedir and NR < 6 -- moretrees trunks allready have facedir
and minetest.registered_nodes[trunkname] then -- the node being called exists. and minetest.registered_nodes[trunkname] then -- the node being called exists.
temptrunk = clone_node(trunkname) temptrunk = clone_node(trunkname)
@ -236,9 +236,9 @@ for i in pairs(TRuNKS) do
end end
end end
end end
abstract_trunks.place_trunk = function(pos) abstract_trunks.place_trunk = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z} local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local north = {x=pos.x, y=pos.y+1, z=pos.z+1} local north = {x=pos.x, y=pos.y+1, z=pos.z+1}
local north2 = {x=pos.x, y=pos.y+1, z=pos.z+2} local north2 = {x=pos.x, y=pos.y+1, z=pos.z+2}
@ -248,7 +248,7 @@ abstract_trunks.place_trunk = function(pos)
local west2 = {x=pos.x-2, y=pos.y+1, z=pos.z} local west2 = {x=pos.x-2, y=pos.y+1, z=pos.z}
local east = {x=pos.x+1, y=pos.y+1, z=pos.z} local east = {x=pos.x+1, y=pos.y+1, z=pos.z}
local east2 = {x=pos.x+2, y=pos.y+1, z=pos.z} local east2 = {x=pos.x+2, y=pos.y+1, z=pos.z}
local node_here = minetest.get_node(right_here) local node_here = minetest.get_node(right_here)
local node_north = minetest.get_node(north) local node_north = minetest.get_node(north)
local node_north2 = minetest.get_node(north2) local node_north2 = minetest.get_node(north2)
@ -278,7 +278,7 @@ abstract_trunks.place_trunk = function(pos)
if minetest.registered_nodes[node_north.name].buildable_to then if minetest.registered_nodes[node_north.name].buildable_to then
minetest.set_node(north, {name=MoD..":"..TRuNK, param2=4}) minetest.set_node(north, {name=MoD..":"..TRuNK, param2=4})
end end
if length >= 4 and minetest.registered_nodes[node_north2.name].buildable_to then if length >= 4 and minetest.registered_nodes[node_north2.name].buildable_to then
minetest.set_node(north2, {name=MoD..":"..TRuNK, param2=4}) minetest.set_node(north2, {name=MoD..":"..TRuNK, param2=4})
end end
@ -365,13 +365,13 @@ if Moss_on_ground == true then
abstract_trunks.grow_moss_on_ground = function(pos) abstract_trunks.grow_moss_on_ground = function(pos)
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z} local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
local moss_type = math.random(1,21) local moss_type = math.random(1,21)
if moss_type == 1 then if moss_type == 1 then
minetest.set_node(on_ground, {name="trunks:moss_fungus", param2=math.random(0,3)}) minetest.set_node(on_ground, {name="trunks:moss_fungus", param2=math.random(0,3)})
else else
minetest.set_node(on_ground, {name="trunks:moss", param2=math.random(0,3)}) minetest.set_node(on_ground, {name="trunks:moss", param2=math.random(0,3)})
end end
end end
plantslib:register_generate_plant({ plantslib:register_generate_plant({
@ -406,14 +406,14 @@ abstract_trunks.grow_moss_on_trunk = function(pos)
local at_side_s = {x=pos.x, y=pos.y, z=pos.z-1} local at_side_s = {x=pos.x, y=pos.y, z=pos.z-1}
local at_side_w = {x=pos.x-1, y=pos.y, z=pos.z} local at_side_w = {x=pos.x-1, y=pos.y, z=pos.z}
local undrneath = {x=pos.x, y=pos.y-1, z=pos.z} local undrneath = {x=pos.x, y=pos.y-1, z=pos.z}
local node_here = minetest.get_node(on_ground) local node_here = minetest.get_node(on_ground)
local node_north = minetest.get_node(at_side_n) local node_north = minetest.get_node(at_side_n)
local node_east = minetest.get_node(at_side_e) local node_east = minetest.get_node(at_side_e)
local node_south = minetest.get_node(at_side_s) local node_south = minetest.get_node(at_side_s)
local node_west = minetest.get_node(at_side_w) local node_west = minetest.get_node(at_side_w)
local node_under = minetest.get_node(undrneath) local node_under = minetest.get_node(undrneath)
--if minetest.get_item_group(node_under.name, "tree") < 1 then --if minetest.get_item_group(node_under.name, "tree") < 1 then
local moss_type = math.random(1,41) local moss_type = math.random(1,41)
if minetest.registered_nodes[node_here.name].buildable_to then -- instead of check_air = true, if minetest.registered_nodes[node_here.name].buildable_to then -- instead of check_air = true,
@ -491,20 +491,20 @@ plantslib:register_generate_plant({
end end
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- RooTS -- RooTS
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if Roots == true then -- see settings.txt if Roots == true then -- see settings.txt
abstract_trunks.grow_roots = function(pos) abstract_trunks.grow_roots = function(pos)
local twig_size = math.random(1,27) local twig_size = math.random(1,27)
local right_here = {x=pos.x , y=pos.y , z=pos.z } 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 below = {x=pos.x , y=pos.y-1, z=pos.z }
local north = {x=pos.x , y=pos.y , z=pos.z+1} local north = {x=pos.x , y=pos.y , z=pos.z+1}
local east = {x=pos.x+1, y=pos.y , z=pos.z } local east = {x=pos.x+1, y=pos.y , z=pos.z }
local south = {x=pos.x , y=pos.y , z=pos.z-1} local south = {x=pos.x , y=pos.y , z=pos.z-1}
local west = {x=pos.x-1, y=pos.y , z=pos.z } local west = {x=pos.x-1, y=pos.y , z=pos.z }
local node_here = minetest.get_node(right_here) local node_here = minetest.get_node(right_here)
local node_below = minetest.get_node(below) local node_below = minetest.get_node(below)
local node_north = minetest.get_node(north) local node_north = minetest.get_node(north)
@ -515,8 +515,8 @@ abstract_trunks.grow_roots = function(pos)
for i in pairs(TRuNKS) do for i in pairs(TRuNKS) do
local MoD = TRuNKS[i][1] local MoD = TRuNKS[i][1]
local TRuNK = TRuNKS[i][2] local TRuNK = TRuNKS[i][2]
if minetest.get_modpath(MoD) ~= nil if minetest.get_modpath(MoD) ~= nil
and node_here.name == MoD..":"..TRuNK and node_here.name == MoD..":"..TRuNK
and string.find(node_below.name, "dirt") and string.find(node_below.name, "dirt")
and node_here.param2 == 0 then and node_here.param2 == 0 then
if minetest.registered_nodes[node_north.name].buildable_to then if minetest.registered_nodes[node_north.name].buildable_to then

View File

@ -17,7 +17,7 @@ for i in pairs(NoDe) do
inventory_image = "trunks_twig_"..NR..".png", inventory_image = "trunks_twig_"..NR..".png",
wield_image = "trunks_twig_"..NR..".png", wield_image = "trunks_twig_"..NR..".png",
drawtype = "nodebox", drawtype = "nodebox",
tiles = { tiles = {
"trunks_twig_"..NR..".png", "trunks_twig_"..NR..".png",
"trunks_twig_"..NR..".png^[transformFY", -- mirror "trunks_twig_"..NR..".png^[transformFY", -- mirror
"trunks_twig_6.png" -- empty "trunks_twig_6.png" -- empty
@ -214,7 +214,7 @@ if Auto_Roof_Corner == true then
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos) action = function(pos)
local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z }) 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_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_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1})
@ -227,7 +227,7 @@ if Auto_Roof_Corner == true then
then then
minetest.set_node(pos, {name=corner, param2=0}) minetest.set_node(pos, {name=corner, param2=0})
end end
if ((node_north.name == roof and node_north.param2 == 1) if ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner and node_north.param2 == 2)) or (node_north.name == corner and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 0) and ((node_east.name == roof and node_east.param2 == 0)
@ -235,7 +235,7 @@ if Auto_Roof_Corner == true then
then then
minetest.set_node(pos, {name=corner, param2=1}) minetest.set_node(pos, {name=corner, param2=1})
end end
if ((node_east.name == roof and node_east.param2 == 2) if ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner and node_east.param2 == 3)) or (node_east.name == corner and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 1) and ((node_south.name == roof and node_south.param2 == 1)
@ -243,7 +243,7 @@ if Auto_Roof_Corner == true then
then then
minetest.set_node(pos, {name=corner, param2=2}) minetest.set_node(pos, {name=corner, param2=2})
end end
if ((node_south.name == roof and node_south.param2 == 3) if ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner and node_south.param2 == 0)) or (node_south.name == corner and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 2) and ((node_west.name == roof and node_west.param2 == 2)
@ -259,7 +259,7 @@ if Auto_Roof_Corner == true then
then then
minetest.set_node(pos, {name=corner_2, param2=0}) minetest.set_node(pos, {name=corner_2, param2=0})
end end
if ((node_north.name == roof and node_north.param2 == 3) if ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner_2 and node_north.param2 == 2)) or (node_north.name == corner_2 and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 2) and ((node_east.name == roof and node_east.param2 == 2)
@ -267,7 +267,7 @@ if Auto_Roof_Corner == true then
then then
minetest.set_node(pos, {name=corner_2, param2=1}) minetest.set_node(pos, {name=corner_2, param2=1})
end end
if ((node_east.name == roof and node_east.param2 == 0) if ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner_2 and node_east.param2 == 3)) or (node_east.name == corner_2 and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 3) and ((node_south.name == roof and node_south.param2 == 3)
@ -275,7 +275,7 @@ if Auto_Roof_Corner == true then
then then
minetest.set_node(pos, {name=corner_2, param2=2}) minetest.set_node(pos, {name=corner_2, param2=2})
end end
if ((node_south.name == roof and node_south.param2 == 1) if ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner_2 and node_south.param2 == 0)) or (node_south.name == corner_2 and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 0) and ((node_west.name == roof and node_west.param2 == 0)
@ -291,7 +291,7 @@ end
-- MM: The following stuff is just for testing purposes for now; no generating of roots. -- 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. -- I'm not satisfied with this; they should be either bigger or a different drawtype.
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- RooTS -- RooTS
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
if Roots == true then -- see settings.txt if Roots == true then -- see settings.txt
@ -303,11 +303,11 @@ local TRuNKS = {
-- MoD TRuNK -- MoD TRuNK
{"default", "tree" }, {"default", "tree" },
{"default", "jungletree" }, {"default", "jungletree" },
{"trees", "tree_conifer" }, {"trees", "tree_conifer" },
{"trees", "tree_mangrove" }, {"trees", "tree_mangrove" },
{"trees", "tree_palm" }, {"trees", "tree_palm" },
{"moretrees", "apple_tree_trunk" }, {"moretrees", "apple_tree_trunk" },
{"moretrees", "beech_trunk" }, {"moretrees", "beech_trunk" },
{"moretrees", "birch_trunk" }, {"moretrees", "birch_trunk" },
@ -326,9 +326,9 @@ for i in pairs(TRuNKS) do
local MoD = TRuNKS[i][1] local MoD = TRuNKS[i][1]
local TRuNK = TRuNKS[i][2] local TRuNK = TRuNKS[i][2]
if minetest.get_modpath(MoD) ~= nil then if minetest.get_modpath(MoD) ~= nil then
local des = minetest.registered_nodes[MoD..":"..TRuNK].description local des = minetest.registered_nodes[MoD..":"..TRuNK].description
minetest.register_node("trunks:"..TRuNK.."root", { minetest.register_node("trunks:"..TRuNK.."root", {
description = des.." Root", description = des.." Root",
paramtype = "light", paramtype = "light",
@ -350,12 +350,12 @@ for i in pairs(TRuNKS) do
choppy=2, choppy=2,
oddly_breakable_by_hand=1, oddly_breakable_by_hand=1,
flammable=2--, flammable=2--,
--not_in_creative_inventory=1 -- atm in inv for testing --not_in_creative_inventory=1 -- atm in inv for testing
}, },
--drop = "trunks:twig_1", -- not sure about this yet --drop = "trunks:twig_1", -- not sure about this yet
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
end end
end end
end end

View File

@ -123,7 +123,7 @@ vines.dig_vine = function( pos, node_name, user )
--only dig give the vine if shears are used --only dig give the vine if shears are used
if not user then return false end if not user then return false end
local wielded = user:get_wielded_item() local wielded = user:get_wielded_item()
if 'vines:shears' == wielded:get_name() then if 'vines:shears' == wielded:get_name() then
local inv = user:get_inventory() local inv = user:get_inventory()
if inv then if inv then
inv:add_item("main", ItemStack( node_name )) inv:add_item("main", ItemStack( node_name ))

View File

@ -26,7 +26,7 @@ local RaDiuS = {
} }
-- e = + , n = + -- e = + , n = +
abstract_woodsoils.place_soil = function(pos) abstract_woodsoils.place_soil = function(pos)
if minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name, "soil") > 0 if minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name, "soil") > 0
or minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z}).name, "soil") > 0 then or minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z}).name, "soil") > 0 then
for i in pairs(RaDiuS) do for i in pairs(RaDiuS) do

View File

@ -10,14 +10,14 @@ dofile(minetest.get_modpath("woodsoils").."/nodes.lua")
dofile(minetest.get_modpath("woodsoils").."/generating.lua") dofile(minetest.get_modpath("woodsoils").."/generating.lua")
-- felt like playing a bit :D -- felt like playing a bit :D
--[[print(" _____ __") --[[print(" _____ __")
print("_/ ____\\___________ ____ _______/ |_") print("_/ ____\\___________ ____ _______/ |_")
print("\\ __\\/ _ \\_ __ \\_/ __ \\ / ___/\\ __\\") print("\\ __\\/ _ \\_ __ \\_/ __ \\ / ___/\\ __\\")
print(" | | ( <_> ) | \\/\\ ___/ \\___ \\ | |") print(" | | ( <_> ) | \\/\\ ___/ \\___ \\ | |")
print(" |__| \\____/|__| \\___ >____ > |__|") print(" |__| \\____/|__| \\___ >____ > |__|")
print(" \\/ \\/") print(" \\/ \\/")
print(" .__.__") print(" .__.__")
print(" __________ |__| | ______") print(" __________ |__| | ______")
print(" / ___/ _ \\| | | / ___/") print(" / ___/ _ \\| | | / ___/")
print(" \\___ ( <_> ) | |__\\___ \\") print(" \\___ ( <_> ) | |__\\___ \\")

View File

@ -3,8 +3,8 @@
minetest.register_node("woodsoils:dirt_with_leaves_1", { minetest.register_node("woodsoils:dirt_with_leaves_1", {
description = "Forest Soil 1", description = "Forest Soil 1",
tiles = { tiles = {
"default_dirt.png^woodsoils_ground_cover.png", "default_dirt.png^woodsoils_ground_cover.png",
"default_dirt.png", "default_dirt.png",
"default_dirt.png^woodsoils_ground_cover_side.png"}, "default_dirt.png^woodsoils_ground_cover_side.png"},
is_ground_content = true, is_ground_content = true,
groups = { groups = {
@ -21,8 +21,8 @@ minetest.register_node("woodsoils:dirt_with_leaves_1", {
minetest.register_node("woodsoils:dirt_with_leaves_2", { minetest.register_node("woodsoils:dirt_with_leaves_2", {
description = "Forest Soil 2", description = "Forest Soil 2",
tiles = { tiles = {
"woodsoils_ground.png", "woodsoils_ground.png",
"default_dirt.png", "default_dirt.png",
"default_dirt.png^woodsoils_ground_side.png"}, "default_dirt.png^woodsoils_ground_side.png"},
is_ground_content = true, is_ground_content = true,
groups = { groups = {
@ -39,8 +39,8 @@ minetest.register_node("woodsoils:dirt_with_leaves_2", {
minetest.register_node("woodsoils:grass_with_leaves_1", { minetest.register_node("woodsoils:grass_with_leaves_1", {
description = "Forest Soil 3", description = "Forest Soil 3",
tiles = { tiles = {
"default_grass.png^woodsoils_ground_cover2.png", "default_grass.png^woodsoils_ground_cover2.png",
"default_dirt.png", "default_dirt.png",
"default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side2.png"}, "default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side2.png"},
is_ground_content = true, is_ground_content = true,
groups = { groups = {
@ -57,8 +57,8 @@ minetest.register_node("woodsoils:grass_with_leaves_1", {
minetest.register_node("woodsoils:grass_with_leaves_2", { minetest.register_node("woodsoils:grass_with_leaves_2", {
description = "Forest Soil 4", description = "Forest Soil 4",
tiles = { tiles = {
"default_grass.png^woodsoils_ground_cover.png", "default_grass.png^woodsoils_ground_cover.png",
"default_dirt.png", "default_dirt.png",
"default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side.png"}, "default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side.png"},
is_ground_content = true, is_ground_content = true,
groups = { groups = {

View File

@ -1,7 +1,7 @@
abstract_youngtrees = {} abstract_youngtrees = {}
minetest.register_node("youngtrees:bamboo", { minetest.register_node("youngtrees:bamboo", {
description = "Young Bamboo Tree", description = "Young Bamboo Tree",
drawtype="nodebox", drawtype="nodebox",
tiles = {"bamboo.png"}, tiles = {"bamboo.png"},
paramtype = "light", paramtype = "light",
@ -21,11 +21,11 @@ minetest.register_node("youngtrees:bamboo", {
}) })
minetest.register_node("youngtrees:youngtree2_middle",{ minetest.register_node("youngtrees:youngtree2_middle",{
description = "Young Tree 2 (middle)", description = "Young Tree 2 (middle)",
drawtype="nodebox", drawtype="nodebox",
tiles = {"youngtree2branch.png"}, tiles = {"youngtree2branch.png"},
inventory_image = "youngtree2branch.png", inventory_image = "youngtree2branch.png",
wield_image = "youngtree2branch.png", wield_image = "youngtree2branch.png",
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
is_ground_content = true, is_ground_content = true,
@ -60,7 +60,7 @@ minetest.register_node("youngtrees:youngtree_top", {
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })
minetest.register_node("youngtrees:youngtree_middle", { minetest.register_node("youngtrees:youngtree_middle", {
description = "Young Tree (middle)", description = "Young Tree (middle)",
drawtype = "plantlike", drawtype = "plantlike",
@ -80,7 +80,7 @@ minetest.register_node("youngtrees:youngtree_middle", {
}) })
minetest.register_node("youngtrees:youngtree_bottom", { minetest.register_node("youngtrees:youngtree_bottom", {
description = "Young Tree (bottom)", description = "Young Tree (bottom)",
drawtype = "plantlike", drawtype = "plantlike",
@ -98,19 +98,19 @@ minetest.register_node("youngtrees:youngtree_bottom", {
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })
abstract_youngtrees.grow_youngtree = function(pos) abstract_youngtrees.grow_youngtree = function(pos)
local height = math.random(1,3) local height = math.random(1,3)
abstract_youngtrees.grow_youngtree_node(pos,height) abstract_youngtrees.grow_youngtree_node(pos,height)
end end
abstract_youngtrees.grow_youngtree_node = function(pos, height) abstract_youngtrees.grow_youngtree_node = function(pos, height)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z} local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z}
if minetest.get_node(right_here).name == "air" -- instead of check_air = true, if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then or minetest.get_node(right_here).name == "default:junglegrass" then
if height == 1 then if height == 1 then
@ -119,20 +119,20 @@ abstract_youngtrees.grow_youngtree_node = function(pos, height)
if height == 2 then if height == 2 then
minetest.set_node(right_here, {name="youngtrees:youngtree_bottom"}) minetest.set_node(right_here, {name="youngtrees:youngtree_bottom"})
minetest.set_node(above_right_here, {name="youngtrees:youngtree_top"}) minetest.set_node(above_right_here, {name="youngtrees:youngtree_top"})
end end
if height == 3 then if height == 3 then
local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z} local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z}
minetest.set_node(right_here, {name="youngtrees:youngtree_bottom"}) minetest.set_node(right_here, {name="youngtrees:youngtree_bottom"})
minetest.set_node(above_right_here, {name="youngtrees:youngtree_middle"}) minetest.set_node(above_right_here, {name="youngtrees:youngtree_middle"})
minetest.set_node(two_above_right_here, {name="youngtrees:youngtree_top"}) minetest.set_node(two_above_right_here, {name="youngtrees:youngtree_top"})
end end
end end
end end
plantslib:register_generate_plant({ plantslib:register_generate_plant({
surface = { surface = {
"default:dirt_with_grass", "default:dirt_with_grass",
"stoneage:grass_with_silex", "stoneage:grass_with_silex",
"sumpf:peat", "sumpf:peat",
"sumpf:sumpf" "sumpf:sumpf"
@ -143,4 +143,4 @@ plantslib:register_generate_plant({
plantlife_limit = -0.9, plantlife_limit = -0.9,
}, },
abstract_youngtrees.grow_youngtree abstract_youngtrees.grow_youngtree
) )

View File

@ -35,7 +35,7 @@ minetest.register_node("clams:dirtalgae", {
} }
} }
}, },
sounds = default.node_sound_dirt_defaults, sounds = default.node_sound_dirt_defaults,
}) })
minetest.register_node("clams:sandalgaeused", { minetest.register_node("clams:sandalgaeused", {
@ -226,7 +226,7 @@ minetest.register_abm({
local y = {x = pos.x, y = pos.y + 1, z = pos.z } local y = {x = pos.x, y = pos.y + 1, z = pos.z }
local yy = {x = pos.x, y = pos.y + 2, z = pos.z } local yy = {x = pos.x, y = pos.y + 2, z = pos.z }
if minetest.get_node(y).name == "default:water_source" or if minetest.get_node(y).name == "default:water_source" or
minetest.get_node(y).name == "noairblocks:water_sourcex" then minetest.get_node(y).name == "noairblocks:water_sourcex" then
if minetest.get_node(yy).name == "default:water_source" or if minetest.get_node(yy).name == "default:water_source" or
minetest.get_node(yy).name == "noairblocks:water_sourcex" then minetest.get_node(yy).name == "noairblocks:water_sourcex" then
minetest.add_node(pos, {name = "clams:sandalgae"}) else minetest.add_node(pos, {name = "clams:sandalgae"}) else
@ -244,7 +244,7 @@ minetest.register_abm({
local y = {x = pos.x, y = pos.y + 1, z = pos.z } local y = {x = pos.x, y = pos.y + 1, z = pos.z }
local yy = {x = pos.x, y = pos.y + 2, z = pos.z } local yy = {x = pos.x, y = pos.y + 2, z = pos.z }
if minetest.get_node(y).name == "default:water_source" or if minetest.get_node(y).name == "default:water_source" or
minetest.get_node(y).name == "noairblocks:water_sourcex" then minetest.get_node(y).name == "noairblocks:water_sourcex" then
if minetest.get_node(yy).name == "default:water_source" or if minetest.get_node(yy).name == "default:water_source" or
minetest.get_node(yy).name == "noairblocks:water_sourcex" then minetest.get_node(yy).name == "noairblocks:water_sourcex" then
minetest.add_node(pos, {name = "clams:dirtalgae"}) else minetest.add_node(pos, {name = "clams:dirtalgae"}) else
@ -264,7 +264,7 @@ minetest.register_abm({
if (active_object_count_wider + active_object_count_wider) > 40 then if (active_object_count_wider + active_object_count_wider) > 40 then
return return
elseif (minetest.get_node(y).name == "default:water_source" or elseif (minetest.get_node(y).name == "default:water_source" or
minetest.get_node(y).name == "noairblocks:water_sourcex") then minetest.get_node(y).name == "noairblocks:water_sourcex") then
if (minetest.get_node(yy).name == "default:water_source" or if (minetest.get_node(yy).name == "default:water_source" or
minetest.get_node(yy).name == "noairblocks:water_sourcex") then minetest.get_node(yy).name == "noairblocks:water_sourcex") then
pos.y=pos.y + 1 pos.y=pos.y + 1
@ -284,7 +284,7 @@ minetest.register_abm({
if (active_object_count_wider + active_object_count_wider) > 40 then if (active_object_count_wider + active_object_count_wider) > 40 then
return return
elseif (minetest.get_node(y).name == "default:water_source" or elseif (minetest.get_node(y).name == "default:water_source" or
minetest.get_node(y).name == "noairblocks:water_sourcex") then minetest.get_node(y).name == "noairblocks:water_sourcex") then
if (minetest.get_node(yy).name == "default:water_source" or if (minetest.get_node(yy).name == "default:water_source" or
minetest.get_node(yy).name == "noairblocks:water_sourcex") then minetest.get_node(yy).name == "noairblocks:water_sourcex") then
pos.y=pos.y + 1 pos.y=pos.y + 1

View File

@ -84,11 +84,11 @@ action = function(pos, node, active_object_count, active_object_count_wider)
local xnyp= {x = pos.x - 1, y = pos.y + 1, z = pos.z} local xnyp= {x = pos.x - 1, y = pos.y + 1, z = pos.z}
if minetest.get_node(xn).name == "default:water_source" and if minetest.get_node(xn).name == "default:water_source" and
minetest.get_node(yp).name ~= "air" and minetest.get_node(yp).name ~= "air" and
minetest.get_node(xnyp).name ~= "air" then minetest.get_node(xnyp).name ~= "air" then
minetest.add_node(xn, {name = "noairblocks:water_sourcex"}) else minetest.add_node(xn, {name = "noairblocks:water_sourcex"}) else
if minetest.get_node(xn).name == "default:water_flowing" and if minetest.get_node(xn).name == "default:water_flowing" and
minetest.get_node(yp).name ~= "air" and minetest.get_node(yp).name ~= "air" and
minetest.get_node(xnyp).name ~= "air" then minetest.get_node(xnyp).name ~= "air" then
minetest.add_node(xn, {name = "noairblocks:water_flowingx"}) else minetest.add_node(xn, {name = "noairblocks:water_flowingx"}) else
return return
end end
@ -106,11 +106,11 @@ action = function(pos, node, active_object_count, active_object_count_wider)
local xpyp= {x = pos.x + 1, y = pos.y + 1, z = pos.z} local xpyp= {x = pos.x + 1, y = pos.y + 1, z = pos.z}
if minetest.get_node(xp).name == "default:water_source" and if minetest.get_node(xp).name == "default:water_source" and
minetest.get_node(yp).name ~= "air" and minetest.get_node(yp).name ~= "air" and
minetest.get_node(xpyp).name ~= "air" then minetest.get_node(xpyp).name ~= "air" then
minetest.add_node(xp, {name = "noairblocks:water_sourcex"}) else minetest.add_node(xp, {name = "noairblocks:water_sourcex"}) else
if minetest.get_node(xp).name == "default:water_flowing" and if minetest.get_node(xp).name == "default:water_flowing" and
minetest.get_node(yp).name ~= "air" and minetest.get_node(yp).name ~= "air" and
minetest.get_node(xpyp).name ~= "air" then minetest.get_node(xpyp).name ~= "air" then
minetest.add_node(xp, {name = "noairblocks:water_flowingx"}) else minetest.add_node(xp, {name = "noairblocks:water_flowingx"}) else
return return
end end
@ -128,11 +128,11 @@ action = function(pos, node, active_object_count, active_object_count_wider)
local znyp= {x = pos.x, y = pos.y + 1, z = pos.z - 1} local znyp= {x = pos.x, y = pos.y + 1, z = pos.z - 1}
if minetest.get_node(zn).name == "default:water_source" and if minetest.get_node(zn).name == "default:water_source" and
minetest.get_node(yp).name ~= "air" and minetest.get_node(yp).name ~= "air" and
minetest.get_node(znyp).name ~= "air" then minetest.get_node(znyp).name ~= "air" then
minetest.add_node(zn, {name = "noairblocks:water_sourcex"}) else minetest.add_node(zn, {name = "noairblocks:water_sourcex"}) else
if minetest.get_node(zn).name == "default:water_flowing" and if minetest.get_node(zn).name == "default:water_flowing" and
minetest.get_node(yp).name ~= "air" and minetest.get_node(yp).name ~= "air" and
minetest.get_node(znyp).name ~= "air" then minetest.get_node(znyp).name ~= "air" then
minetest.add_node(zn, {name = "noairblocks:water_flowingx"}) else minetest.add_node(zn, {name = "noairblocks:water_flowingx"}) else
return return
end end
@ -150,11 +150,11 @@ action = function(pos, node, active_object_count, active_object_count_wider)
local zpyp= {x = pos.x, y = pos.y + 1, z = pos.z + 1} local zpyp= {x = pos.x, y = pos.y + 1, z = pos.z + 1}
if minetest.get_node(zp).name == "default:water_source" and if minetest.get_node(zp).name == "default:water_source" and
minetest.get_node(yp).name ~= "air" and minetest.get_node(yp).name ~= "air" and
minetest.get_node(zpyp).name ~= "air" then minetest.get_node(zpyp).name ~= "air" then
minetest.add_node(zp, {name = "noairblocks:water_sourcex"}) else minetest.add_node(zp, {name = "noairblocks:water_sourcex"}) else
if minetest.get_node(zp).name == "default:water_flowing" and if minetest.get_node(zp).name == "default:water_flowing" and
minetest.get_node(yp).name ~= "air" and minetest.get_node(yp).name ~= "air" and
minetest.get_node(zpyp).name ~= "air" then minetest.get_node(zpyp).name ~= "air" then
minetest.add_node(zp, {name = "noairblocks:water_flowingx"}) else minetest.add_node(zp, {name = "noairblocks:water_flowingx"}) else
return return
end end
@ -168,7 +168,7 @@ interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local yp= {x = pos.x, y = pos.y + 1, z = pos.z} local yp= {x = pos.x, y = pos.y + 1, z = pos.z}
if minetest.get_node(yp).name == "default:water_source" then if minetest.get_node(yp).name == "default:water_source" then
minetest.add_node(yp, {name = "noairblocks:water_sourcex"}) else minetest.add_node(yp, {name = "noairblocks:water_sourcex"}) else
if minetest.get_node(yp).name == "default:water_flowing" then if minetest.get_node(yp).name == "default:water_flowing" then
minetest.add_node(yp, {name = "noairblocks:water_flowingx"}) else minetest.add_node(yp, {name = "noairblocks:water_flowingx"}) else
@ -186,10 +186,10 @@ action = function(pos, node, active_object_count, active_object_count_wider)
local yn = {x = pos.x, y = pos.y - 1, z = pos.z} local yn = {x = pos.x, y = pos.y - 1, z = pos.z}
local yp= {x = pos.x, y = pos.y + 1, z = pos.z} local yp= {x = pos.x, y = pos.y + 1, z = pos.z}
if minetest.get_node(yn).name == "default:water_source" and if minetest.get_node(yn).name == "default:water_source" and
minetest.get_node(yp).name ~= "air" then minetest.get_node(yp).name ~= "air" then
minetest.add_node(yn, {name = "noairblocks:water_sourcex"}) else minetest.add_node(yn, {name = "noairblocks:water_sourcex"}) else
if minetest.get_node(yn).name == "default:water_flowing" and if minetest.get_node(yn).name == "default:water_flowing" and
minetest.get_node(yp).name ~= "air" then minetest.get_node(yp).name ~= "air" then
minetest.add_node(yn, {name = "noairblocks:water_flowingx"}) else minetest.add_node(yn, {name = "noairblocks:water_flowingx"}) else
return return
end end

View File

@ -396,9 +396,9 @@ action = function(pos, node, active_object_count, active_object_count_wider)
minetest.get_node(yyp).name == "noairblocks:water_sourcex") then minetest.get_node(yyp).name == "noairblocks:water_sourcex") then
if (minetest.get_node(yyyp).name == "default:water_source" or if (minetest.get_node(yyyp).name == "default:water_source" or
minetest.get_node(yyyp).name == "noairblocks:water_sourcex") then minetest.get_node(yyyp).name == "noairblocks:water_sourcex") then
minetest.add_node(pos, {name = "seaplants:kelpgreenmiddle"}) minetest.add_node(pos, {name = "seaplants:kelpgreenmiddle"})
pos.y = pos.y + 1 pos.y = pos.y + 1
minetest.add_node(pos, {name = "seaplants:kelpgreen"}) minetest.add_node(pos, {name = "seaplants:kelpgreen"})
else else
return return
end end
@ -452,9 +452,9 @@ action = function(pos, node, active_object_count, active_object_count_wider)
minetest.get_node(yyp).name == "noairblocks:water_sourcex") then minetest.get_node(yyp).name == "noairblocks:water_sourcex") then
if (minetest.get_node(yyyp).name == "default:water_source" or if (minetest.get_node(yyyp).name == "default:water_source" or
minetest.get_node(yyyp).name == "noairblocks:water_sourcex") then minetest.get_node(yyyp).name == "noairblocks:water_sourcex") then
minetest.add_node(pos, {name = "seaplants:kelpbrownmiddle"}) minetest.add_node(pos, {name = "seaplants:kelpbrownmiddle"})
pos.y = pos.y + 1 pos.y = pos.y + 1
minetest.add_node(pos, {name = "seaplants:kelpbrown"}) minetest.add_node(pos, {name = "seaplants:kelpbrown"})
else else
return return
end end

View File

@ -77,7 +77,7 @@ minetest.register_node("seawrecks:ubootchest", {
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local kind_of_price = math.random(0,2) local kind_of_price = math.random(0,2)
local amount_of_price = math.random(1, 20) local amount_of_price = math.random(1, 20)
local ingot_price = {"default:steel_ingot","default:copper_ingot","default:gold_ingot","moreores:tin_ingot","moreores:silver_ingot"} local ingot_price = {"default:steel_ingot","default:copper_ingot","default:gold_ingot","moreores:tin_ingot","moreores:silver_ingot"}
@ -91,7 +91,7 @@ minetest.register_node("seawrecks:ubootchest", {
else else
price_group[2] = "" price_group[2] = ""
end end
meta:set_string("formspec", meta:set_string("formspec",
"size[8,9]".. "size[8,9]"..
"list[current_name;main;0,0;8,4;]".. "list[current_name;main;0,0;8,4;]"..
@ -203,7 +203,7 @@ interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local yp = {x = pos.x, y = pos.y + 3, z = pos.z} local yp = {x = pos.x, y = pos.y + 3, z = pos.z}
if minetest.get_node(pos).name == "seawrecks:woodship" and if minetest.get_node(pos).name == "seawrecks:woodship" and
(minetest.get_node(yp).name == "default:water_source" or (minetest.get_node(yp).name == "default:water_source" or
minetest.get_node(yp).name == "noairblocks:water_sourcex") then minetest.get_node(yp).name == "noairblocks:water_sourcex") then
minetest.add_node(pos, {name = "default:sand"}) minetest.add_node(pos, {name = "default:sand"})
@ -298,7 +298,7 @@ local yp = {x = pos.x, y = pos.y + 3, z = pos.z}
end end
pos.z = pos.z - 1 pos.z = pos.z - 1
pos.x = pos.x + 1 pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"}) minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z - 1 pos.z = pos.z - 1
@ -380,7 +380,7 @@ interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local yp = {x = pos.x, y = pos.y + 8, z = pos.z} local yp = {x = pos.x, y = pos.y + 8, z = pos.z}
if minetest.get_node(pos).name == "seawrecks:uboot" and if minetest.get_node(pos).name == "seawrecks:uboot" and
(minetest.get_node(yp).name == "default:water_source" or (minetest.get_node(yp).name == "default:water_source" or
minetest.get_node(yp).name == "noairblocks:water_sourcex") then minetest.get_node(yp).name == "noairblocks:water_sourcex") then
minetest.add_node(pos, {name = "default:dirt"}) minetest.add_node(pos, {name = "default:dirt"})

View File

@ -144,7 +144,7 @@ function stairsshine.register_slab(subname, recipeitem, groups, images, descript
end end
return itemstack return itemstack
end end
-- Upside down slabs -- Upside down slabs
if p0.y-1 == p1.y then if p0.y-1 == p1.y then
-- Turn into full block if pointing at a existing slab -- Turn into full block if pointing at a existing slab

View File

@ -101,14 +101,14 @@ local function leave_sled(self, player)
player:set_detach() player:set_detach()
default.player_attached[name] = false default.player_attached[name] = false
default.player_set_animation(player, "stand" , 30) default.player_set_animation(player, "stand" , 30)
player:set_physics_override({ player:set_physics_override({
speed = 1, speed = 1,
jump = 1, jump = 1,
}) })
player:hud_remove(self.HUD) -- And here is part 2. ~ LazyJ player:hud_remove(self.HUD) -- And here is part 2. ~ LazyJ
self.object:remove() self.object:remove()
--Give the sled back again --Give the sled back again
player:get_inventory():add_item("main", "snow:sled") player:get_inventory():add_item("main", "snow:sled")
end end
@ -205,7 +205,7 @@ minetest.register_craftitem("snow:sled", {
local pos = placer:getpos() local pos = placer:getpos()
if accelerating_possible(vector.round(pos)) then if accelerating_possible(vector.round(pos)) then
pos.y = pos.y+0.5 pos.y = pos.y+0.5
--Get on the sled and remove it from inventory. --Get on the sled and remove it from inventory.
minetest.add_entity(pos, "snow:sled"):right_click(placer) minetest.add_entity(pos, "snow:sled"):right_click(placer)
itemstack:take_item(); return itemstack itemstack:take_item(); return itemstack

View File

@ -51,12 +51,12 @@ unified_inventory.register_page("u_skins", {
if not u_skins.is_skin(u_skins.u_skins[name]) then if not u_skins.is_skin(u_skins.u_skins[name]) then
u_skins.u_skins[name] = u_skins.default u_skins.u_skins[name] = u_skins.default
end end
local formspec = ("background[0.06,0.99;7.92,7.52;ui_misc_form.png]" local formspec = ("background[0.06,0.99;7.92,7.52;ui_misc_form.png]"
.."image[0,.75;1,2;"..u_skins.u_skins[name].."_preview.png]" .."image[0,.75;1,2;"..u_skins.u_skins[name].."_preview.png]"
.."label[6,.5;Raw texture:]" .."label[6,.5;Raw texture:]"
.."image[6,1;2,1;"..u_skins.u_skins[name]..".png]") .."image[6,1;2,1;"..u_skins.u_skins[name]..".png]")
local meta = u_skins.meta[u_skins.u_skins[name]] local meta = u_skins.meta[u_skins.u_skins[name]]
if meta then if meta then
if meta.name ~= "" then if meta.name ~= "" then
@ -125,7 +125,7 @@ u_skins.generate_pages = function(texture)
.."button[0,3.8;1,.5;u_skins_page$"..page_prev..";<<]" .."button[0,3.8;1,.5;u_skins_page$"..page_prev..";<<]"
.."button[.75,3.8;6.5,.5;u_skins_null;Page "..page.."/"..total_pages.."]" .."button[.75,3.8;6.5,.5;u_skins_null;Page "..page.."/"..total_pages.."]"
.."button[7,3.8;1,.5;u_skins_page$"..page_next..";>>]") .."button[7,3.8;1,.5;u_skins_page$"..page_next..";>>]")
unified_inventory.register_page("u_skins_page$"..(page - 1), { unified_inventory.register_page("u_skins_page$"..(page - 1), {
get_formspec = function(player) get_formspec = function(player)
return {formspec=formspec} return {formspec=formspec}

View File

@ -10,14 +10,14 @@ while fetched_skip < 40 do
if file then if file then
local data = string.split(file:read("*all"), "\n", 3) local data = string.split(file:read("*all"), "\n", 3)
file:close() file:close()
u_skins.list[internal_id] = name u_skins.list[internal_id] = name
u_skins.meta[name] = {} u_skins.meta[name] = {}
u_skins.meta[name].name = data[1] u_skins.meta[name].name = data[1]
u_skins.meta[name].author = data[2] u_skins.meta[name].author = data[2]
u_skins.meta[name].license = data[3] u_skins.meta[name].license = data[3]
u_skins.meta[name].description = "" --what's that?? u_skins.meta[name].description = "" --what's that??
fetched_skip = 0 fetched_skip = 0
internal_id = internal_id + 1 internal_id = internal_id + 1
end end
@ -41,7 +41,7 @@ while fetched_skip < 40 do
u_skins.meta[name].author = data[2] u_skins.meta[name].author = data[2]
u_skins.meta[name].license = data[3] or "" u_skins.meta[name].license = data[3] or ""
u_skins.meta[name].description = "" u_skins.meta[name].description = ""
fetched_skip = 0 fetched_skip = 0
internal_id = internal_id + 1 internal_id = internal_id + 1
end end

View File

@ -104,7 +104,7 @@ function msg_meta:fromRFC1459(line)
local pos local pos
self.command, pos = line:match("(%S+)()") self.command, pos = line:match("(%S+)()")
-- /MFF BEGIN -- /MFF BEGIN
if not pos then if not pos then
minetest.log("error", "[IRC] This crash message was intended to see the value of a breaking variable. line = " .. (line or "nil")) minetest.log("error", "[IRC] This crash message was intended to see the value of a breaking variable. line = " .. (line or "nil"))
return return
end end

View File

@ -13,7 +13,7 @@ end
function set:add(connection) function set:add(connection)
local socket = connection.socket local socket = connection.socket
insert(self.sockets, socket) insert(self.sockets, socket)
self.connections[socket] = connection self.connections[socket] = connection
insert(self.connections, connection) insert(self.connections, connection)
end end
@ -32,13 +32,13 @@ end
function set:select() function set:select()
local read, write, err = select(self.sockets, nil, self.timeout) local read, write, err = select(self.sockets, nil, self.timeout)
if read then if read then
for k, socket in ipairs(read) do for k, socket in ipairs(read) do
read[k] = self.connections[socket] read[k] = self.connections[socket]
end end
end end
return read, err return read, err
end end

Some files were not shown because too many files have changed in this diff Show More