mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 01:30:38 +01:00
Removed all whitespaces (using new script)
This commit is contained in:
parent
f81b8ca677
commit
2913bcb93d
@ -17,7 +17,7 @@ function beds.register_bed(name, def)
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = def.selectionbox,
|
||||
|
||||
|
||||
},
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
local n = minetest.get_node_or_nil(pos)
|
||||
@ -35,7 +35,7 @@ function beds.register_bed(name, def)
|
||||
end
|
||||
minetest.set_node(p, {name = n.name:gsub("%_bottom", "_top"), param2 = n.param2})
|
||||
return false
|
||||
end,
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
local n = minetest.get_node_or_nil(pos)
|
||||
if not n then return end
|
||||
|
@ -64,7 +64,7 @@ beds.register_bed("beds:bed", {
|
||||
},
|
||||
top = {
|
||||
"beds_bed_top_top.png^[transformR90",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"beds_bed_side_top_r.png",
|
||||
"beds_bed_side_top_r.png^[transformfx",
|
||||
"beds_bed_side_top.png",
|
||||
|
@ -56,7 +56,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
||||
if skip then
|
||||
return
|
||||
end
|
||||
if p then
|
||||
if p then
|
||||
player:setpos(p)
|
||||
end
|
||||
|
||||
@ -100,7 +100,7 @@ local function update_formspecs(finished)
|
||||
"label[2.7,11; Good morning.]"
|
||||
else
|
||||
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
|
||||
form_n = form_n ..
|
||||
"button_exit[2,8;4,0.75;force;Force night skip]"
|
||||
|
@ -184,7 +184,7 @@ boats.register_boat = function(parameters)
|
||||
wield_image = "boats_"..parameters.name.."_wield.png",
|
||||
wield_scale = {x=2, y=2, z=1},
|
||||
liquids_pointable = true,
|
||||
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
|
@ -56,7 +56,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local node = minetest.get_node_or_nil(pointed_thing.under)
|
||||
local ndef
|
||||
if node then
|
||||
|
@ -122,7 +122,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if start_i >= creative_inventory.creative_inventory_size then
|
||||
start_i = start_i - 4*6
|
||||
end
|
||||
|
||||
|
||||
if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then
|
||||
start_i = 0
|
||||
end
|
||||
@ -150,11 +150,11 @@ if minetest.setting_getbool("creative_mode") then
|
||||
damage_groups = {fleshy = 10},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
|
||||
return
|
||||
end)
|
||||
|
||||
|
||||
function minetest.handle_node_drops(pos, drops, digger)
|
||||
if not digger or not digger:is_player() then
|
||||
return
|
||||
@ -169,5 +169,5 @@ if minetest.setting_getbool("creative_mode") then
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
@ -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
|
||||
local def = minetest.registered_nodes[nn]
|
||||
if not def then return end
|
||||
|
||||
|
||||
local textures = def.tiles
|
||||
local description = def.description
|
||||
if not textures then
|
||||
|
@ -176,7 +176,7 @@ local function cool_wf_vm(pos, node1, node2)
|
||||
nodes[i] = stone
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
manip:set_data(nodes)
|
||||
manip:write_to_map()
|
||||
-- minetest.log("action", "Lava cooling happened at (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ").")
|
||||
|
@ -4,7 +4,7 @@
|
||||
--
|
||||
|
||||
local function active_formspec(fuel_percent, item_percent)
|
||||
local formspec =
|
||||
local formspec =
|
||||
"size[8,8.5]"..
|
||||
default.gui_slots..
|
||||
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||
@ -94,9 +94,9 @@ minetest.register_node("default:furnace", {
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
|
||||
|
||||
can_dig = can_dig,
|
||||
|
||||
|
||||
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
||||
allow_metadata_inventory_take = allow_metadata_inventory_take,
|
||||
@ -126,9 +126,9 @@ minetest.register_node("default:furnace_active", {
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
|
||||
|
||||
can_dig = can_dig,
|
||||
|
||||
|
||||
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
||||
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 src_time = meta:get_float("src_time") or 0
|
||||
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
|
||||
|
||||
|
||||
--
|
||||
-- Inizialize inventory
|
||||
--
|
||||
@ -352,24 +352,24 @@ minetest.register_abm({
|
||||
local srclist = inv:get_list("src")
|
||||
local fuellist = inv:get_list("fuel")
|
||||
local dstlist = inv:get_list("dst")
|
||||
|
||||
|
||||
--
|
||||
-- Cooking
|
||||
--
|
||||
|
||||
|
||||
-- Check if we have cookable content
|
||||
local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||
local cookable = true
|
||||
|
||||
|
||||
if cooked.time == 0 then
|
||||
cookable = false
|
||||
end
|
||||
|
||||
|
||||
-- Check if we have enough fuel to burn
|
||||
if fuel_time < fuel_totaltime then
|
||||
-- The furnace is currently active and has enough fuel
|
||||
fuel_time = fuel_time + 1
|
||||
|
||||
|
||||
-- If there is a cookable item then check if it is ready yet
|
||||
if cookable then
|
||||
src_time = src_time + 1
|
||||
@ -387,7 +387,7 @@ minetest.register_abm({
|
||||
if cookable then
|
||||
-- We need to get new fuel
|
||||
local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
|
||||
|
||||
|
||||
if fuel.time == 0 then
|
||||
-- No valid fuel in fuel list
|
||||
fuel_totaltime = 0
|
||||
@ -396,10 +396,10 @@ minetest.register_abm({
|
||||
else
|
||||
-- Take fuel from fuel list
|
||||
inv:set_stack("fuel", 1, afterfuel.items[1])
|
||||
|
||||
|
||||
fuel_totaltime = fuel.time
|
||||
fuel_time = 0
|
||||
|
||||
|
||||
end
|
||||
else
|
||||
-- We don't need to get new fuel since there is no cookable item
|
||||
@ -408,7 +408,7 @@ minetest.register_abm({
|
||||
src_time = 0
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Update formspec, infotext and node
|
||||
--
|
||||
@ -425,7 +425,7 @@ minetest.register_abm({
|
||||
item_state = "Not cookable"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local fuel_state = "Empty"
|
||||
local active = "inactive "
|
||||
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
|
||||
@ -440,9 +440,9 @@ minetest.register_abm({
|
||||
end
|
||||
swap_node(pos, "default:furnace")
|
||||
end
|
||||
|
||||
|
||||
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
|
||||
|
||||
|
||||
--
|
||||
-- Set meta values
|
||||
--
|
||||
@ -475,13 +475,13 @@ minetest.register_abm({
|
||||
|
||||
local srclist = inv:get_list("src")
|
||||
local cooked = nil
|
||||
|
||||
|
||||
if srclist then
|
||||
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||
end
|
||||
|
||||
|
||||
local was_active = false
|
||||
|
||||
|
||||
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
|
||||
was_active = true
|
||||
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
|
||||
@ -501,12 +501,12 @@ minetest.register_abm({
|
||||
meta:set_string("src_time", 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local item_percent = 0
|
||||
if cooked then
|
||||
item_percent = meta:get_float("src_time") * 100 / cooked.time
|
||||
end
|
||||
|
||||
|
||||
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
|
||||
local percent = math.floor(meta:get_float("fuel_time") /
|
||||
meta:get_float("fuel_totaltime") * 100)
|
||||
@ -520,7 +520,7 @@ minetest.register_abm({
|
||||
local cooked = nil
|
||||
local fuellist = inv:get_list("fuel")
|
||||
local srclist = inv:get_list("src")
|
||||
|
||||
|
||||
if srclist then
|
||||
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||
end
|
||||
@ -546,7 +546,7 @@ minetest.register_abm({
|
||||
|
||||
meta:set_string("fuel_totaltime", fuel.time)
|
||||
meta:set_string("fuel_time", 0)
|
||||
|
||||
|
||||
local stack = inv:get_stack("fuel", 1)
|
||||
stack:take_item()
|
||||
inv:set_stack("fuel", 1, stack)
|
||||
|
@ -387,7 +387,7 @@ function default.register_ores()
|
||||
end
|
||||
|
||||
-- Underground springs:
|
||||
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "default:water_source",
|
||||
@ -721,7 +721,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if ground_y then
|
||||
local p = {x=x,y =ground_y+1,z=z}
|
||||
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 nn == "default:desert_sand" then
|
||||
minetest.set_node(p,{name = "default:dry_shrub"})
|
||||
|
||||
|
||||
-- If dirt with grass, add grass
|
||||
elseif nn == "default:dirt_with_grass" then
|
||||
minetest.set_node(p,{name = "default:grass_" .. pr:next(1, 5)})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -989,7 +989,7 @@ end
|
||||
--
|
||||
|
||||
function default.register_blobs()
|
||||
minetest.register_ore({
|
||||
minetest.register_ore({
|
||||
ore_type = "blob",
|
||||
ore = "default:sand",
|
||||
wherein = {"default:stone"},
|
||||
|
@ -1613,7 +1613,7 @@ minetest.register_node("default:meze", {
|
||||
drop = "",
|
||||
groups = {cracky = 1, level = 2, fall_damage_add_percent = -75},
|
||||
sounds = default.node_sound_wood_defaults(), -- Intended.
|
||||
|
||||
|
||||
on_dig = function(pos, node, digger)
|
||||
if digger and minetest.setting_getbool("enable_damage") and not minetest.setting_getbool("creative_mode") then
|
||||
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_diamond", {tiles = {"default_mineral_diamond.png"}})
|
||||
minetest.override_item("default:stone_with_coin", {tiles = {"maptools_gold_coin.png"}})
|
||||
|
||||
|
||||
-- Nodes to hide:
|
||||
minetest.override_item("default:stone", {drawtype = "airlike", pointable = false,})
|
||||
minetest.override_item("default:dirt", {drawtype = "airlike", pointable = false,})
|
||||
|
@ -95,7 +95,7 @@ minetest.register_on_joinplayer(function(player)
|
||||
default.player_attached[player:get_player_name()] = false
|
||||
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)
|
||||
|
||||
|
||||
-- set GUI
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
player:set_inventory_formspec(default.gui_survival_form)
|
||||
|
@ -57,13 +57,13 @@ minetest.register_abm({
|
||||
if not can_grow(pos) then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
minetest.log("action", "A pine sapling grows into a tree at "..
|
||||
minetest.pos_to_string(pos))
|
||||
default.grow_pine_tree(pos)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
-- Appletree, jungletree function
|
||||
|
||||
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_ignore = minetest.get_content_id("ignore")
|
||||
local c_apple = minetest.get_content_id("default:apple")
|
||||
|
||||
|
||||
-- Trunk
|
||||
for y_dist = 0, height - 1 do
|
||||
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 c_tree = minetest.get_content_id("default:tree")
|
||||
local c_leaves = minetest.get_content_id("default:leaves")
|
||||
|
||||
|
||||
local vm = minetest.get_voxel_manip()
|
||||
local minp, maxp = vm:read_from_map(
|
||||
{x = pos.x - 2, y = pos.y, z = pos.z - 2},
|
||||
@ -410,15 +410,15 @@ minetest.register_abm({
|
||||
interval = 80,
|
||||
chance = 3,
|
||||
action = function(pos, node)
|
||||
|
||||
|
||||
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")
|
||||
|
||||
|
||||
if is_soil == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
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")
|
||||
end,
|
||||
|
@ -25,7 +25,7 @@ function doors.register_door(name, def)
|
||||
if not def.sound_open_door then
|
||||
def.sound_open_door = "doors_door_open"
|
||||
end
|
||||
|
||||
|
||||
minetest.register_craftitem(name, {
|
||||
description = def.description,
|
||||
inventory_image = def.inventory_image,
|
||||
@ -99,7 +99,7 @@ function doors.register_door(name, def)
|
||||
|
||||
local tt = def.tiles_top
|
||||
local tb = def.tiles_bottom
|
||||
|
||||
|
||||
local function after_dig_node(pos, name, digger)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == name then
|
||||
@ -114,16 +114,16 @@ function doors.register_door(name, def)
|
||||
end
|
||||
local p2 = minetest.get_node(pos).param2
|
||||
p2 = params[p2+1]
|
||||
|
||||
|
||||
minetest.swap_node(pos, {name=replace_dir, param2=p2})
|
||||
|
||||
|
||||
pos.y = pos.y-dir
|
||||
minetest.swap_node(pos, {name=replace, param2=p2})
|
||||
|
||||
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
|
||||
snd_1 = def.sound_open_door
|
||||
snd_1 = def.sound_open_door
|
||||
snd_2 = def.sound_close_door
|
||||
end
|
||||
|
||||
@ -158,18 +158,18 @@ function doors.register_door(name, def)
|
||||
fixed = def.selection_box_bottom
|
||||
},
|
||||
groups = def.groups,
|
||||
|
||||
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
pos.y = pos.y+1
|
||||
after_dig_node(pos, name.."_t_1", digger)
|
||||
end,
|
||||
|
||||
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if check_player_priv(pos, clicker) then
|
||||
on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
can_dig = check_player_priv,
|
||||
sounds = def.sounds,
|
||||
sunlight_propagates = def.sunlight
|
||||
@ -190,18 +190,18 @@ function doors.register_door(name, def)
|
||||
fixed = def.selection_box_top
|
||||
},
|
||||
groups = def.groups,
|
||||
|
||||
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
pos.y = pos.y-1
|
||||
after_dig_node(pos, name.."_b_1", digger)
|
||||
end,
|
||||
|
||||
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if check_player_priv(pos, clicker) then
|
||||
on_rightclick(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2", {1,2,3,0})
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
can_dig = check_player_priv,
|
||||
sounds = def.sounds,
|
||||
sunlight_propagates = def.sunlight,
|
||||
@ -222,18 +222,18 @@ function doors.register_door(name, def)
|
||||
fixed = def.selection_box_bottom
|
||||
},
|
||||
groups = def.groups,
|
||||
|
||||
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
pos.y = pos.y+1
|
||||
after_dig_node(pos, name.."_t_2", digger)
|
||||
end,
|
||||
|
||||
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if check_player_priv(pos, clicker) then
|
||||
on_rightclick(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2})
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
can_dig = check_player_priv,
|
||||
sounds = def.sounds,
|
||||
sunlight_propagates = def.sunlight
|
||||
@ -254,18 +254,18 @@ function doors.register_door(name, def)
|
||||
fixed = def.selection_box_top
|
||||
},
|
||||
groups = def.groups,
|
||||
|
||||
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
pos.y = pos.y-1
|
||||
after_dig_node(pos, name.."_b_2", digger)
|
||||
end,
|
||||
|
||||
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if check_player_priv(pos, clicker) then
|
||||
on_rightclick(pos, -1, name.."_b_2", name.."_t_1", name.."_b_1", {3,0,1,2})
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
can_dig = check_player_priv,
|
||||
sounds = def.sounds,
|
||||
sunlight_propagates = def.sunlight
|
||||
|
@ -15,11 +15,11 @@ minetest.register_node("fire:basic_flame", {
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
damage_per_second = 4,
|
||||
|
||||
|
||||
on_construct = function(pos, placer)
|
||||
fire.on_flame_add_at(pos)
|
||||
end,
|
||||
|
||||
|
||||
on_destruct = function(pos, oldnode, oldmetadata, digger)
|
||||
fire.on_flame_remove_at(pos)
|
||||
end,
|
||||
|
@ -95,23 +95,23 @@ minetest.register_abm({
|
||||
elseif under.name ~= "default:dirt_with_grass" then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local light = minetest.get_node_light(pos)
|
||||
if not light or light < 13 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
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}
|
||||
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora")
|
||||
if #flowers > 3 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass")
|
||||
if #seedling > 0 then
|
||||
seedling = seedling[math.random(#seedling)]
|
||||
|
@ -138,7 +138,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
-- Upside down slabs
|
||||
if p0.y-1 == p1.y then
|
||||
-- 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 Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("sandstonebrick", "default:sandstonebrick",
|
||||
{crumbly=2,cracky=2},
|
||||
{"default_sandstone_brick.png"},
|
||||
|
@ -50,7 +50,7 @@ minetest.register_node("vessels:shelf", {
|
||||
local stack = inv:get_stack(from_list, from_index)
|
||||
local to_stack = inv:get_stack(to_list, to_index)
|
||||
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
|
||||
return 1
|
||||
else
|
||||
|
@ -16,7 +16,7 @@ ARMOR_MATERIALS = {
|
||||
mithril = "moreores:mithril_ingot",
|
||||
crystal = "ethereal:crystal_ingot",
|
||||
-- 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"
|
||||
-- Wizard armors
|
||||
--armor = "xxx",
|
||||
@ -255,7 +255,7 @@ armor.update_armor = function(self, player, dtime)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if hp <= 0 or hp == self.player_hp[name] then
|
||||
return
|
||||
end
|
||||
@ -463,7 +463,7 @@ minetest.register_on_joinplayer(function(player)
|
||||
for i=1, 6 do
|
||||
local stack = player_inv:get_stack("armor", i)
|
||||
armor_inv:set_stack("armor", i, stack)
|
||||
end
|
||||
end
|
||||
|
||||
-- Legacy support, import player's armor from old inventory format
|
||||
for _,v in pairs(armor.elements) do
|
||||
|
@ -124,4 +124,4 @@ minetest.after(0, function()
|
||||
table.insert(armor.elements, "shield")
|
||||
end)
|
||||
|
||||
|
||||
|
||||
|
@ -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 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_volume = 0.9
|
||||
local night_frequency = 20 --owls, wolves
|
||||
local night_volume = 0.9
|
||||
local night_frequent_frequency = 150 --crickets
|
||||
local night_frequent_volume = 0.9
|
||||
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_volume = 0.18
|
||||
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_volume = 1.0
|
||||
local cave_frequent_volume = 1.0
|
||||
local beach_frequency = 20 --seagulls
|
||||
local beach_volume = 1.0
|
||||
local beach_volume = 1.0
|
||||
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_volume = 1.0
|
||||
local water_frequent_volume = 1.0
|
||||
local desert_frequency = 20 --coyote
|
||||
local desert_volume = 1.0
|
||||
local desert_volume = 1.0
|
||||
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_volume = 1.0
|
||||
local swimming_frequent_volume = 1.0
|
||||
local water_surface_volume = 1.0 -- sloshing water
|
||||
local lava_volume = 1.0 --lava
|
||||
local flowing_water_volume = .4 --waterfall
|
||||
local splashing_water_volume = 1
|
||||
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
|
||||
----------------------------------------------------------------------------------------------------
|
||||
@ -269,7 +269,7 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
|
||||
totalnodes = totalnodes + #nodes
|
||||
maxp = {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 .. ")")
|
||||
if #nodes >= threshold then
|
||||
return true
|
||||
@ -277,8 +277,8 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
|
||||
totalnodes = totalnodes + #nodes
|
||||
maxp = {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)
|
||||
-- minetest.chat_send_all("x+Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
|
||||
-- minetest.chat_send_all("x+Found (" .. node_name .. ": " .. #nodes .. ")")
|
||||
if #nodes >= threshold then
|
||||
return true
|
||||
end
|
||||
@ -286,7 +286,7 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
|
||||
-- minetest.chat_send_all("Found total(" .. totalnodes .. ")")
|
||||
if totalnodes >= threshold*2 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
@ -298,11 +298,11 @@ local get_immediate_nodes = function(pos)
|
||||
pos.y = pos.y+3
|
||||
pos.y = pos.y+2.2
|
||||
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
|
||||
pos.y = pos.y+0.99
|
||||
pos.y = pos.y+0.99
|
||||
--minetest.chat_send_all("node_under_feet(" .. nodename .. ")")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local get_ambience = function(player)
|
||||
@ -315,19 +315,19 @@ local get_ambience = function(player)
|
||||
local player_name = player:get_player_name()
|
||||
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
|
||||
player_is_moving_horiz = true
|
||||
player_is_moving_horiz = true
|
||||
end
|
||||
if pos.y > players_pos[player_name]["last_y_pos"]+.5 then
|
||||
player_is_climbing = true
|
||||
end
|
||||
if pos.y < players_pos[player_name]["last_y_pos"]-.5 then
|
||||
player_is_descending = true
|
||||
player_is_descending = true
|
||||
end
|
||||
|
||||
|
||||
players_pos[player_name]["last_x_pos"] = pos.x
|
||||
players_pos[player_name]["last_z_pos"] = pos.z
|
||||
players_pos[player_name]["last_y_pos"] = pos.y
|
||||
|
||||
|
||||
if string.find(node_at_upper_body, "default:water") then
|
||||
if music then
|
||||
return {water=water, water_frequent=water_frequent, music=music}
|
||||
@ -342,20 +342,20 @@ local get_ambience = function(player)
|
||||
--swimming w, m swimming
|
||||
--walking in water nw, m splashing
|
||||
--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 string.find(node_under_feet, "default:water") then
|
||||
if music then
|
||||
return {swimming_frequent=swimming_frequent, music=music}
|
||||
else
|
||||
return {swimming_frequent}
|
||||
end
|
||||
else --didn't find water under feet: walking in water
|
||||
end
|
||||
else --didn't find water under feet: walking in water
|
||||
if music then
|
||||
return {splashing_water=splashing_water, music=music}
|
||||
else
|
||||
return {splashing_water}
|
||||
end
|
||||
end
|
||||
end
|
||||
else--player is not moving: treading water
|
||||
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}
|
||||
else
|
||||
return {water_surface}
|
||||
end
|
||||
else --didn't find water under feet
|
||||
end
|
||||
else --didn't find water under feet
|
||||
standing_in_water = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- minetest.chat_send_all("----------")
|
||||
-- if not player_is_moving_horiz then
|
||||
-- minetest.chat_send_all("not moving horiz")
|
||||
-- else
|
||||
-- minetest.chat_send_all("moving horiz")
|
||||
-- end
|
||||
-- end
|
||||
-- minetest.chat_send_all("nub:" ..node_at_upper_body)
|
||||
-- minetest.chat_send_all("nlb:" ..node_at_lower_body)
|
||||
-- minetest.chat_send_all("nuf:" ..node_under_feet)
|
||||
-- minetest.chat_send_all("----------")
|
||||
|
||||
|
||||
|
||||
|
||||
-- if player_is_moving_horiz then
|
||||
-- minetest.chat_send_all("playermoving")
|
||||
-- end
|
||||
@ -392,7 +392,7 @@ local get_ambience = function(player)
|
||||
-- minetest.chat_send_all("nlb:" ..node_at_lower_body)
|
||||
-- minetest.chat_send_all("nuf:" ..node_under_feet)
|
||||
-- minetest.chat_send_all("n3uf:" ..node_3_under_feet)
|
||||
--
|
||||
--
|
||||
local air_or_ignore = {air=true,ignore=true}
|
||||
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}
|
||||
@ -405,19 +405,19 @@ local get_ambience = function(player)
|
||||
-- minetest.chat_send_all("counter: (" .. counter .. "-----------------)")
|
||||
--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]
|
||||
-- and air_or_ignore[node_under_feet] and air_plus_ignore_under == 196 and not player_is_descending then
|
||||
--minetest.chat_send_all("flying!!!!")
|
||||
-- and air_or_ignore[node_under_feet] and air_plus_ignore_under == 196 and not player_is_descending then
|
||||
--minetest.chat_send_all("flying!!!!")
|
||||
-- if music then
|
||||
-- return {flying=flying, music=music}
|
||||
-- else
|
||||
--- return {flying}
|
||||
-- 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 music then
|
||||
return {lava=lava, lava2=lava2, music=music}
|
||||
return {lava=lava, lava2=lava2, music=music}
|
||||
else
|
||||
return {lava=lava}
|
||||
end
|
||||
@ -428,7 +428,7 @@ local get_ambience = function(player)
|
||||
else
|
||||
return {flowing_water=flowing_water, flowing_water2=flowing_water2}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--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}
|
||||
else
|
||||
return {beach=beach, beach_frequent=beach_frequent}
|
||||
end
|
||||
end
|
||||
end
|
||||
if standing_in_water then
|
||||
if music then
|
||||
return {water_surface=water_surface, music=music}
|
||||
else
|
||||
return {water_surface}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
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 )
|
||||
if desert_in_range >250 then
|
||||
@ -456,12 +456,12 @@ local get_ambience = function(player)
|
||||
else
|
||||
return {desert=desert, desert_frequent=desert_frequent}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- pos.y = pos.y-2
|
||||
-- pos.y = pos.y-2
|
||||
-- nodename = minetest.get_node(pos).name
|
||||
-- minetest.chat_send_all("Found " .. nodename .. pos.y )
|
||||
|
||||
|
||||
|
||||
if player:getpos().y < 0 then
|
||||
if music then
|
||||
@ -491,7 +491,7 @@ local play_sound = function(player, list, number, is_music)
|
||||
if list.handler[player_name] == nil then
|
||||
local gain = 1.0
|
||||
if list[number].gain ~= nil then
|
||||
if is_music then
|
||||
if is_music then
|
||||
gain = list[number].gain*soundset.get_gain(player_name, "music")
|
||||
--minetest.chat_send_all("gain music: " .. gain )
|
||||
else
|
||||
@ -666,7 +666,7 @@ local stop_sound = function(still_playing, player)
|
||||
minetest.sound_stop(list.handler[player_name])
|
||||
list.handler[player_name] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
if still_playing.lava2 == nil then
|
||||
local list = lava2
|
||||
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])
|
||||
list.handler[player_name] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
if still_playing.water == nil then
|
||||
local list = water
|
||||
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
|
||||
local list = water_surface
|
||||
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")})
|
||||
played_on_start = false
|
||||
end
|
||||
@ -701,9 +701,9 @@ local stop_sound = function(still_playing, player)
|
||||
if still_playing.water_frequent == nil then
|
||||
local list = water_frequent
|
||||
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.chat_send_all("list.on_stop " .. list.on_stop )
|
||||
-- minetest.chat_send_all("list.on_stop " .. list.on_stop )
|
||||
played_on_start = false
|
||||
end
|
||||
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])
|
||||
list.handler[player_name] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
if still_playing.splashing_water == nil then
|
||||
local list = splashing_water
|
||||
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])
|
||||
list.handler[player_name] = nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local timer = 0
|
||||
@ -749,7 +749,7 @@ minetest.register_globalstep(function(dtime)
|
||||
ambiences = get_ambience(player)
|
||||
stop_sound(ambiences, player)
|
||||
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
|
||||
-- -- minetest.chat_send_all("playedOnStart " )
|
||||
-- else
|
||||
@ -762,7 +762,7 @@ minetest.register_globalstep(function(dtime)
|
||||
-- minetest.chat_send_all("ambience: " ..ambience )
|
||||
-- if ambience.on_start ~= nil and played_on_start_flying == false then
|
||||
-- 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
|
||||
local is_music =false
|
||||
if ambience.is_music ~= nil then
|
||||
@ -816,8 +816,8 @@ minetest.register_chatcommand("mvol", {
|
||||
MUSICVOLUME = tonumber(param)
|
||||
-- local player = minetest.get_player_by_name(name)
|
||||
-- stop_sound({}, player)
|
||||
-- ambiences = get_ambience(player)
|
||||
-- ambiences = get_ambience(player)
|
||||
minetest.chat_send_player(name, "Music volume set to " .. param .. ".")
|
||||
end, })
|
||||
end, })
|
||||
]]
|
||||
|
||||
|
@ -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", {
|
||||
description = "Granite",
|
||||
tiles = { "technic_granite.png" },
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "technic:granite 9",
|
||||
|
@ -1,6 +1,6 @@
|
||||
local shapes = {
|
||||
{ { x = {0, 1, 0, 1}, y = {0, 0, 1, 1} } },
|
||||
|
||||
|
||||
{ { x = {1, 1, 1, 1}, y = {0, 1, 2, 3} },
|
||||
{ x = {0, 1, 2, 3}, y = {1, 1, 1, 1} } },
|
||||
|
||||
@ -70,7 +70,7 @@ end
|
||||
local function step(pos, fields)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local t = minetest.deserialize(meta:get_string("tetris"))
|
||||
|
||||
|
||||
local function new_game(pos)
|
||||
local nex = math.random(7)
|
||||
|
||||
@ -81,7 +81,7 @@ local function step(pos, fields)
|
||||
score = 0,
|
||||
cur = math.random(7),
|
||||
nex = nex,
|
||||
x=4, y=0, rot=1
|
||||
x=4, y=0, rot=1
|
||||
}
|
||||
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
@ -99,7 +99,7 @@ local function step(pos, fields)
|
||||
i*sizey+boardy, semi,
|
||||
size, comma, size, semi,
|
||||
colors[tile[2]], close }
|
||||
|
||||
|
||||
ins = ins + 1
|
||||
scr[ins] = concat(tmp)
|
||||
end
|
||||
@ -138,9 +138,9 @@ local function step(pos, fields)
|
||||
|
||||
for i=1,4 do
|
||||
local cx, cy = d.x[i]+x, d.y[i]+y
|
||||
|
||||
|
||||
if cx < 0 or cx > 9 or cy < 0 or cy > 19 then
|
||||
return false
|
||||
return false
|
||||
end
|
||||
|
||||
for _, tile in pairs(t.board[ cy ] or {}) do
|
||||
@ -157,7 +157,7 @@ local function step(pos, fields)
|
||||
end
|
||||
|
||||
local function tick()
|
||||
if stuck() then
|
||||
if stuck() then
|
||||
if t.y <= 0 then
|
||||
return false end
|
||||
add()
|
||||
@ -170,7 +170,7 @@ local function step(pos, fields)
|
||||
t.y = t.y + 1
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local function move(dx, dy)
|
||||
local newx, newy = t.x+dx, t.y+dy
|
||||
@ -225,10 +225,10 @@ local function step(pos, fields)
|
||||
end
|
||||
|
||||
if t then
|
||||
local scr = { formsize, background,
|
||||
local scr = { formsize, background,
|
||||
t.boardstring, t.previewstring,
|
||||
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 }
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ local function start_smoke(pos, node, clicker, chimney)
|
||||
s_handle = minetest.sound_play("fire_small", {
|
||||
pos = pos,
|
||||
max_hear_distance = 5,
|
||||
loop = true
|
||||
loop = true
|
||||
})
|
||||
this_spawner_meta:set_int("smoky", id)
|
||||
this_spawner_meta:set_int("sound", s_handle)
|
||||
@ -81,7 +81,7 @@ for _, f in ipairs(flame_types) do
|
||||
light_source = 14,
|
||||
waving = 1,
|
||||
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}},
|
||||
},
|
||||
on_rightclick = function (pos, node, clicker)
|
||||
@ -111,7 +111,7 @@ minetest.register_node("fake_fire:fancy_fire", {
|
||||
damage_per_second = 4,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
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'}},
|
||||
on_rightclick = function (pos, node, clicker)
|
||||
start_smoke(pos, node, clicker)
|
||||
@ -169,7 +169,7 @@ for _, m in ipairs(materials) do
|
||||
stop_smoke(pos)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'fake_fire:chimney_top_'..m,
|
||||
|
@ -7,7 +7,7 @@ local toilet_sbox = {
|
||||
|
||||
local toilet_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
fixed = {
|
||||
{-6/16, -8/16, -8/16, 6/16, 1/16, 8/16 },
|
||||
{-6/16, -8/16, 4/16, 6/16, 9/16, 8/16 }
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ local bed_sbox = {
|
||||
|
||||
local bed_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
fixed = {
|
||||
{ -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, -0.5, 0.5, 0.18, -0.44 },
|
||||
@ -33,7 +33,7 @@ local kbed_sbox = {
|
||||
|
||||
local kbed_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
fixed = {
|
||||
{ -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, -0.5, 1.5, 0.18, -0.44 },
|
||||
|
@ -137,7 +137,7 @@ local door_model_list = {
|
||||
tiles = {
|
||||
"homedecor_door_exterior_fancy.png",
|
||||
"homedecor_door_exterior_fancy_insert.png"
|
||||
},
|
||||
},
|
||||
usealpha = true
|
||||
},
|
||||
|
||||
|
@ -52,7 +52,7 @@ local kc_cbox = {
|
||||
|
||||
local ac_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5 },
|
||||
{-0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ local wl_cbox = {
|
||||
homedecor.register("wall_lamp", {
|
||||
description = S("Wall Lamp"),
|
||||
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"},
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "homedecor_wall_lamp_inv.png",
|
||||
|
@ -143,7 +143,7 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, color)
|
||||
return true
|
||||
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." )
|
||||
return true
|
||||
end
|
||||
@ -169,7 +169,7 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, color)
|
||||
minetest.set_node(rightpos, {name = "air"})
|
||||
minetest.set_node(pos, { name = newname, param2 = fdir})
|
||||
end
|
||||
|
||||
|
||||
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})
|
||||
|
||||
@ -202,7 +202,7 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
|
||||
|
||||
if def.on_rightclick then
|
||||
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())
|
||||
|
||||
@ -217,7 +217,7 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
|
||||
return
|
||||
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." )
|
||||
return
|
||||
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 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 left_node = minetest.get_node(left_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
|
||||
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
|
||||
pos = fwd_pos
|
||||
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")
|
||||
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
|
||||
pos = fwd_pos
|
||||
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")
|
||||
|
||||
-- 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")
|
||||
and is_buildable_to(placer_name, fwd_pos, nil, fwd_pos) then
|
||||
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
|
||||
fdir = left_fwd_node.param2
|
||||
pos = fwd_pos
|
||||
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")
|
||||
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
|
||||
pos = fwd_pos
|
||||
new_place_name = string.gsub(right_fwd_node.name, "_diagonal_.-$", "_horizontal")
|
||||
|
@ -158,7 +158,7 @@ homedecor.register("plasma_ball", {
|
||||
"homedecor_plasma_ball_glass.png"
|
||||
},
|
||||
inventory_image = "homedecor_plasma_ball_inv.png",
|
||||
selection_box = {
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.1875, -0.5, -0.1875, 0.1875, 0, 0.1875 }
|
||||
},
|
||||
@ -357,7 +357,7 @@ homedecor.register("ceiling_lantern", {
|
||||
use_texture_alpha = true,
|
||||
inventory_image = "homedecor_ceiling_lantern_inv.png",
|
||||
description = "Ceiling Lantern",
|
||||
groups = {snappy=3},
|
||||
groups = {snappy=3},
|
||||
light_source = 11,
|
||||
selection_box = cl_cbox,
|
||||
walkable = false
|
||||
@ -508,7 +508,7 @@ local dlamp_cbox = {
|
||||
|
||||
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, {
|
||||
description = S("Desk Lamp ("..color..")"),
|
||||
mesh = "homedecor_desk_lamp.obj",
|
||||
|
@ -41,7 +41,7 @@ for i in ipairs(rug_types) do
|
||||
if type(m) == "table" then
|
||||
mesh = nil
|
||||
nodebox = {
|
||||
type = "fixed",
|
||||
type = "fixed",
|
||||
fixed = m
|
||||
}
|
||||
tiles = {
|
||||
@ -94,7 +94,7 @@ for i in ipairs(flowers_list) do
|
||||
local flowerdesc = flowers_list[i][1]
|
||||
local flower = flowers_list[i][2]
|
||||
local craftwith = flowers_list[i][3]
|
||||
|
||||
|
||||
homedecor.register("potted_"..flower, {
|
||||
description = S("Potted flower ("..flowerdesc..")"),
|
||||
mesh = "homedecor_flowerpot_small.obj",
|
||||
|
@ -27,7 +27,7 @@ if minetest.get_modpath("vessels")
|
||||
paramtype2 = "facedir",
|
||||
use_texture_alpha = true
|
||||
})
|
||||
|
||||
|
||||
local sbox = {
|
||||
type = "fixed",
|
||||
fixed = { -0.15, -0.5, -0.15, 0.15, -0.1, 0.15 }
|
||||
|
@ -1,6 +1,6 @@
|
||||
local lavalamps_list = {
|
||||
{ "Red Lava Lamp", "red"},
|
||||
{ "Orange Lava Lamp", "orange"},
|
||||
{ "Orange Lava Lamp", "orange"},
|
||||
{ "Yellow Lava Lamp", "yellow"},
|
||||
{ "Green Lava Lamp", "green"},
|
||||
{ "Blue Lava Lamp", "blue"},
|
||||
@ -52,7 +52,7 @@ for i in ipairs(lavalamps_list) do
|
||||
tiles = {
|
||||
"lavalamp_metal.png",
|
||||
"lavalamp_lamp_off.png",
|
||||
},
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
@ -78,5 +78,5 @@ for i in ipairs(lavalamps_list) do
|
||||
{"", "wool:black", "", }
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
end
|
||||
|
@ -12,7 +12,7 @@ local armchairs_list = {
|
||||
|
||||
local armchair_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5 },
|
||||
{-0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ local longsofa_sbox = {
|
||||
|
||||
local longsofa_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0, 2.5 },
|
||||
{-0.5, -0.5, 0.5, -0.4, 0.5, 2.5 }
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ local sofa_sbox = {
|
||||
|
||||
local sofa_cbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0, 1.5 },
|
||||
{-0.5, -0.5, 0.5, -0.4, 0.5, 1.5 }
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ local function checkwall(pos)
|
||||
end
|
||||
|
||||
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
|
||||
return false
|
||||
end
|
||||
|
@ -567,7 +567,7 @@ signs_lib.update_sign = function(pos, fields, owner)
|
||||
elseif signnode.name == "signs:sign_hanging" then
|
||||
sign_info = signs_lib.hanging_sign_model.textpos[minetest.get_node(pos).param2 + 1]
|
||||
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
|
||||
sign_info = signs_lib.regular_wall_sign_model.textpos[minetest.get_node(pos).param2 + 1]
|
||||
else
|
||||
|
@ -105,7 +105,7 @@ function msg_meta:fromRFC1459(line)
|
||||
local pos
|
||||
self.command, pos = line:match("(%S+)()")
|
||||
-- /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"))
|
||||
return
|
||||
end
|
||||
|
@ -13,7 +13,7 @@ end
|
||||
function set:add(connection)
|
||||
local socket = connection.socket
|
||||
insert(self.sockets, socket)
|
||||
|
||||
|
||||
self.connections[socket] = connection
|
||||
insert(self.connections, connection)
|
||||
end
|
||||
@ -32,13 +32,13 @@ end
|
||||
|
||||
function set:select()
|
||||
local read, write, err = select(self.sockets, nil, self.timeout)
|
||||
|
||||
|
||||
if read then
|
||||
for k, socket in ipairs(read) do
|
||||
read[k] = self.connections[socket]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return read, err
|
||||
end
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
-- action_change = function
|
||||
-- rules = rules/get_rules
|
||||
-- },
|
||||
-- conductor =
|
||||
-- conductor =
|
||||
-- {
|
||||
-- state = mesecon.state.on/off
|
||||
-- offstate = opposite state (for state = on only)
|
||||
|
@ -496,7 +496,7 @@ function mesecon.find_receptor_on(pos, link)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
depth = depth + 1
|
||||
end
|
||||
@ -533,7 +533,7 @@ function mesecon.rules_link_rule_all(output, rule)
|
||||
return {}
|
||||
end
|
||||
local rules = {}
|
||||
|
||||
|
||||
for _, inputrule in ipairs(mesecon.flattenrules(inputrules)) do
|
||||
-- Check if input accepts from output
|
||||
if mesecon.cmpPos(mesecon.addPosRule(input, inputrule), output) then
|
||||
@ -552,7 +552,7 @@ function mesecon.rules_link_rule_all_inverted(input, rule)
|
||||
return {}
|
||||
end
|
||||
local rules = {}
|
||||
|
||||
|
||||
for _, outputrule in ipairs(mesecon.flattenrules(outputrules)) do
|
||||
if mesecon.cmpPos(mesecon.addPosRule(output, outputrule), input) then
|
||||
table.insert(rules, mesecon.invertRule(outputrule))
|
||||
@ -607,8 +607,8 @@ function mesecon.rotate_rules_right(rules)
|
||||
local nr = {}
|
||||
for i, rule in ipairs(rules) do
|
||||
table.insert(nr, {
|
||||
x = -rule.z,
|
||||
y = rule.y,
|
||||
x = -rule.z,
|
||||
y = rule.y,
|
||||
z = rule.x,
|
||||
name = rule.name})
|
||||
end
|
||||
@ -619,8 +619,8 @@ function mesecon.rotate_rules_left(rules)
|
||||
local nr = {}
|
||||
for i, rule in ipairs(rules) do
|
||||
table.insert(nr, {
|
||||
x = rule.z,
|
||||
y = rule.y,
|
||||
x = rule.z,
|
||||
y = rule.y,
|
||||
z = -rule.x,
|
||||
name = rule.name})
|
||||
end
|
||||
@ -631,8 +631,8 @@ function mesecon.rotate_rules_down(rules)
|
||||
local nr = {}
|
||||
for i, rule in ipairs(rules) do
|
||||
table.insert(nr, {
|
||||
x = -rule.y,
|
||||
y = rule.x,
|
||||
x = -rule.y,
|
||||
y = rule.x,
|
||||
z = rule.z,
|
||||
name = rule.name})
|
||||
end
|
||||
@ -643,8 +643,8 @@ function mesecon.rotate_rules_up(rules)
|
||||
local nr = {}
|
||||
for i, rule in ipairs(rules) do
|
||||
table.insert(nr, {
|
||||
x = rule.y,
|
||||
y = -rule.x,
|
||||
x = rule.y,
|
||||
y = -rule.x,
|
||||
z = rule.z,
|
||||
name = rule.name})
|
||||
end
|
||||
|
@ -21,7 +21,7 @@ mesecon.rules.buttonlike =
|
||||
{{x = 1, y = 0, 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 = 2, y = 0, z = 0}}
|
||||
|
||||
@ -38,7 +38,7 @@ mesecon.rules.alldirs =
|
||||
{x= 0, y=-1, z= 0},
|
||||
{x= 0, y= 0, z= 1},
|
||||
{x= 0, y= 0, z=-1}}
|
||||
|
||||
|
||||
mesecon.rules.buttonlike_get = function(node)
|
||||
local rules = mesecon.rules.buttonlike
|
||||
if node.param2 == 2 then
|
||||
|
@ -129,7 +129,7 @@ function mesecon.set_bit(binary,bit,value)
|
||||
end
|
||||
end
|
||||
return binary
|
||||
|
||||
|
||||
end
|
||||
|
||||
function mesecon.invertRule(r)
|
||||
@ -203,7 +203,7 @@ function mesecon.flipstate(pos, node)
|
||||
local newstate
|
||||
if (nodedef.__mesecon_state == "on") then newstate = "off" end
|
||||
if (nodedef.__mesecon_state == "off") then newstate = "on" end
|
||||
|
||||
|
||||
minetest.swap_node(pos, {name = nodedef.__mesecon_basename .. "_" .. newstate,
|
||||
param2 = node.param2})
|
||||
|
||||
|
@ -135,7 +135,7 @@ nid_inc = function (nid)
|
||||
end
|
||||
|
||||
-- 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
|
||||
return nid_inc(nid)
|
||||
end
|
||||
|
@ -15,7 +15,7 @@ end
|
||||
minetest.register_node("mesecons_button:button_off", {
|
||||
drawtype = "nodebox",
|
||||
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",
|
||||
@ -32,7 +32,7 @@ minetest.register_node("mesecons_button:button_off", {
|
||||
fixed = { -6/16, -6/16, 5/16, 6/16, 6/16, 8/16 }
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -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
|
||||
|
@ -35,7 +35,7 @@ end
|
||||
|
||||
for i = 1, 4 do
|
||||
local groups = {}
|
||||
if i == 1 then
|
||||
if i == 1 then
|
||||
groups = {bendy=2,snappy=1,dig_immediate=2}
|
||||
else
|
||||
groups = {bendy=2,snappy=1,dig_immediate=2, not_in_creative_inventory=1}
|
||||
|
@ -182,10 +182,10 @@ minetest.register_node("mesecons_detector:node_detector_off", {
|
||||
on_receive_fields = node_detector_on_receive_fields,
|
||||
after_place_node = function (pos, placer)
|
||||
local placer_pos = placer:getpos()
|
||||
|
||||
|
||||
--correct for the player's height
|
||||
if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end
|
||||
|
||||
|
||||
--correct for 6d facedir
|
||||
if placer_pos then
|
||||
local dir = {
|
||||
@ -217,10 +217,10 @@ minetest.register_node("mesecons_detector:node_detector_on", {
|
||||
on_receive_fields = node_detector_on_receive_fields,
|
||||
after_place_node = function (pos, placer)
|
||||
local placer_pos = placer:getpos()
|
||||
|
||||
|
||||
--correct for the player's height
|
||||
if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end
|
||||
|
||||
|
||||
--correct for 6d facedir
|
||||
if placer_pos then
|
||||
local dir = {
|
||||
|
@ -10,7 +10,7 @@ local corner_selectionbox = {
|
||||
}
|
||||
|
||||
local corner_get_rules = function (node)
|
||||
local rules =
|
||||
local rules =
|
||||
{{x = 1, y = 0, z = 0},
|
||||
{x = 0, y = 0, z = -1}}
|
||||
|
||||
@ -39,7 +39,7 @@ minetest.register_node("mesecons_extrawires:corner_on", {
|
||||
node_box = corner_nodebox,
|
||||
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
|
||||
drop = "mesecons_extrawires:corner_off",
|
||||
mesecons = {conductor =
|
||||
mesecons = {conductor =
|
||||
{
|
||||
state = mesecon.state.on,
|
||||
rules = corner_get_rules,
|
||||
@ -65,7 +65,7 @@ minetest.register_node("mesecons_extrawires:corner_off", {
|
||||
selection_box = corner_selectionbox,
|
||||
node_box = corner_nodebox,
|
||||
groups = {dig_immediate = 3},
|
||||
mesecons = {conductor =
|
||||
mesecons = {conductor =
|
||||
{
|
||||
state = mesecon.state.off,
|
||||
rules = corner_get_rules,
|
||||
|
@ -10,7 +10,7 @@ local tjunction_selectionbox = {
|
||||
}
|
||||
|
||||
local tjunction_get_rules = function (node)
|
||||
local rules =
|
||||
local rules =
|
||||
{{x = 0, y = 0, z = 1},
|
||||
{x = 1, y = 0, z = 0},
|
||||
{x = 0, y = 0, z = -1}}
|
||||
@ -40,7 +40,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", {
|
||||
node_box = tjunction_nodebox,
|
||||
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
|
||||
drop = "mesecons_extrawires:tjunction_off",
|
||||
mesecons = {conductor =
|
||||
mesecons = {conductor =
|
||||
{
|
||||
state = mesecon.state.on,
|
||||
rules = tjunction_get_rules,
|
||||
@ -66,7 +66,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
|
||||
selection_box = tjunction_selectionbox,
|
||||
node_box = tjunction_nodebox,
|
||||
groups = {dig_immediate = 3},
|
||||
mesecons = {conductor =
|
||||
mesecons = {conductor =
|
||||
{
|
||||
state = mesecon.state.off,
|
||||
rules = tjunction_get_rules,
|
||||
|
@ -247,7 +247,7 @@ end
|
||||
|
||||
local safe_globals = {
|
||||
"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)
|
||||
-- Gather variables for the environment
|
||||
|
@ -262,7 +262,7 @@ function parse_get_command(code, starti)
|
||||
if s == "(" then
|
||||
return string.sub(code, starti, i-1), i + 1 -- i: ( i+1 after (
|
||||
end
|
||||
if s == ";" and starti == i then
|
||||
if s == ";" and starti == i then
|
||||
starti = starti + 1
|
||||
i = starti
|
||||
elseif s == ">" then
|
||||
@ -410,7 +410,7 @@ function yc_command_sbi(params, eeprom, L, Lv)
|
||||
--is an eeprom address
|
||||
local new_eeprom = "";
|
||||
for i=1, #eeprom do
|
||||
if tonumber(params[1])==i then
|
||||
if tonumber(params[1])==i then
|
||||
new_eeprom = new_eeprom..status
|
||||
else
|
||||
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
|
||||
while s ~= "" do
|
||||
s = string.sub(code, i, i)
|
||||
|
||||
|
||||
if s == ")" then
|
||||
brackets = brackets - 1
|
||||
end
|
||||
@ -539,7 +539,7 @@ function yc_command_parsecondition(cond, L, eeprom)
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
local i = 2
|
||||
local i = 2
|
||||
local l = string.len(cond)
|
||||
while i<=l do
|
||||
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)
|
||||
else mesecon.receptor_off(pos, rules) end
|
||||
end
|
||||
if Lv.c ~= L.c then
|
||||
if Lv.c ~= L.c then
|
||||
rules = microc_rules[name.."0100"]
|
||||
if L.c == true then mesecon.receptor_on(pos, rules)
|
||||
else mesecon.receptor_off(pos, rules) end
|
||||
end
|
||||
if Lv.d ~= L.d then
|
||||
if Lv.d ~= L.d then
|
||||
rules = microc_rules[name.."1000"]
|
||||
if L.d == true then mesecon.receptor_on(pos, rules)
|
||||
else mesecon.receptor_off(pos, rules) end
|
||||
|
@ -74,7 +74,7 @@ function mesecon.register_movestone(name, def, is_sticky)
|
||||
local maxpush = mesecon.setting("movestone_max_push", 50)
|
||||
local maxpull = mesecon.setting("movestone_max_pull", 50)
|
||||
local success, stack, oldstack = mesecon.mvps_push(frontpos, direction, maxpush)
|
||||
if success then
|
||||
if success then
|
||||
mesecon.mvps_process_stack(stack)
|
||||
mesecon.mvps_move_objects(frontpos, direction, oldstack)
|
||||
-- Too large stack/stopper in the way: try again very soon
|
||||
|
@ -160,11 +160,11 @@ local pistonspec_normal = {
|
||||
minetest.register_node("mesecons_pistons:piston_normal_off", {
|
||||
description = "Piston",
|
||||
tiles = {
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_pusher_front.png"
|
||||
},
|
||||
groups = {cracky = 3},
|
||||
@ -182,11 +182,11 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
|
||||
minetest.register_node("mesecons_pistons:piston_normal_on", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_on_front.png"
|
||||
},
|
||||
inventory_image = "mesecons_piston_top.png",
|
||||
@ -241,11 +241,11 @@ local pistonspec_sticky = {
|
||||
minetest.register_node("mesecons_pistons:piston_sticky_off", {
|
||||
description = "Sticky Piston",
|
||||
tiles = {
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_pusher_front_sticky.png"
|
||||
},
|
||||
groups = {cracky = 3},
|
||||
@ -263,11 +263,11 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
|
||||
minetest.register_node("mesecons_pistons:piston_sticky_on", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_on_front.png"
|
||||
},
|
||||
inventory_image = "mesecons_piston_top.png",
|
||||
@ -340,11 +340,11 @@ local pistonspec_normal_up = {
|
||||
minetest.register_node("mesecons_pistons:piston_up_normal_off", {
|
||||
tiles = {
|
||||
"mesecons_piston_pusher_front.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_left.png^[transformR270",
|
||||
"mesecons_piston_right.png^[transformR90",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_top.png^[transformR180",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_left.png^[transformR270",
|
||||
"mesecons_piston_right.png^[transformR90",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_top.png^[transformR180",
|
||||
},
|
||||
inventory_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",
|
||||
tiles = {
|
||||
"mesecons_piston_on_front.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_left.png^[transformR270",
|
||||
"mesecons_piston_right.png^[transformR90",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_top.png^[transformR180",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_left.png^[transformR270",
|
||||
"mesecons_piston_right.png^[transformR90",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_top.png^[transformR180",
|
||||
},
|
||||
inventory_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", {
|
||||
tiles = {
|
||||
"mesecons_piston_pusher_front_sticky.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_left.png^[transformR270",
|
||||
"mesecons_piston_right.png^[transformR90",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_top.png^[transformR180",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_left.png^[transformR270",
|
||||
"mesecons_piston_right.png^[transformR90",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_top.png^[transformR180",
|
||||
"mesecons_piston_tb.png"
|
||||
},
|
||||
inventory_image = "mesecons_piston_top.png",
|
||||
@ -447,11 +447,11 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mesecons_piston_on_front.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_left.png^[transformR270",
|
||||
"mesecons_piston_right.png^[transformR90",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_top.png^[transformR180",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_left.png^[transformR270",
|
||||
"mesecons_piston_right.png^[transformR90",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_top.png^[transformR180",
|
||||
},
|
||||
inventory_image = "mesecons_piston_top.png",
|
||||
wield_image = "mesecons_piston_top.png",
|
||||
@ -524,12 +524,12 @@ local pistonspec_normal_down = {
|
||||
-- offstate
|
||||
minetest.register_node("mesecons_pistons:piston_down_normal_off", {
|
||||
tiles = {
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_pusher_front.png",
|
||||
"mesecons_piston_left.png^[transformR90",
|
||||
"mesecons_piston_right.png^[transformR270",
|
||||
"mesecons_piston_bottom.png^[transformR180",
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_left.png^[transformR90",
|
||||
"mesecons_piston_right.png^[transformR270",
|
||||
"mesecons_piston_bottom.png^[transformR180",
|
||||
"mesecons_piston_top.png",
|
||||
},
|
||||
inventory_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", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_on_front.png",
|
||||
"mesecons_piston_left.png^[transformR90",
|
||||
"mesecons_piston_right.png^[transformR270",
|
||||
"mesecons_piston_bottom.png^[transformR180",
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_left.png^[transformR90",
|
||||
"mesecons_piston_right.png^[transformR270",
|
||||
"mesecons_piston_bottom.png^[transformR180",
|
||||
"mesecons_piston_top.png",
|
||||
},
|
||||
inventory_image = "mesecons_piston_top.png",
|
||||
wield_image = "mesecons_piston_top.png",
|
||||
@ -604,12 +604,12 @@ local pistonspec_sticky_down = {
|
||||
-- offstate
|
||||
minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
|
||||
tiles = {
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_pusher_front_sticky.png",
|
||||
"mesecons_piston_left.png^[transformR90",
|
||||
"mesecons_piston_right.png^[transformR270",
|
||||
"mesecons_piston_bottom.png^[transformR180",
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_left.png^[transformR90",
|
||||
"mesecons_piston_right.png^[transformR270",
|
||||
"mesecons_piston_bottom.png^[transformR180",
|
||||
"mesecons_piston_top.png",
|
||||
},
|
||||
inventory_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", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_on_front.png",
|
||||
"mesecons_piston_left.png^[transformR90",
|
||||
"mesecons_piston_right.png^[transformR270",
|
||||
"mesecons_piston_bottom.png^[transformR180",
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_left.png^[transformR90",
|
||||
"mesecons_piston_right.png^[transformR270",
|
||||
"mesecons_piston_bottom.png^[transformR180",
|
||||
"mesecons_piston_top.png",
|
||||
},
|
||||
inventory_image = "mesecons_piston_top.png",
|
||||
wield_image = "mesecons_piston_top.png",
|
||||
|
@ -1,5 +1,5 @@
|
||||
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
|
||||
{ -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
|
||||
|
@ -81,7 +81,7 @@ function stairsplus:register_6dfacedir_conversion(modname, material)
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
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]
|
||||
elseif flip_to_wall and not flip_upside_down then
|
||||
nfdir = dirs2[fdir + 1]
|
||||
@ -125,7 +125,7 @@ function stairsplus:register_6dfacedir_conversion(modname, material)
|
||||
local fdir = node.param2
|
||||
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]
|
||||
elseif flip_to_wall and not flip_upside_down then
|
||||
nfdir = dirs2[fdir + 2]
|
||||
|
@ -83,39 +83,39 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields)
|
||||
end
|
||||
|
||||
minetest.register_alias(modname.. ":micro_" ..subname.. "_bottom", modname.. ":micro_" ..subname)
|
||||
|
||||
|
||||
-- Some saw-less recipes:
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":micro_" .. subname .. " 7",
|
||||
recipe = {modname .. ":stair_" .. subname .. "_inner"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":micro_" .. subname .. " 6",
|
||||
type = "shapeless",
|
||||
recipe = {modname .. ":stair_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":micro_" .. subname .. " 5",
|
||||
recipe = {modname .. ":stair_" .. subname .. "_outer"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":micro_" .. subname .. " 4",
|
||||
recipe = {modname .. ":slab_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":micro_" .. subname .. " 2",
|
||||
recipe = {modname .. ":panel_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = recipeitem,
|
||||
|
@ -82,7 +82,7 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
||||
minetest.register_node(":" ..modname.. ":panel_" ..subname..alternate, def)
|
||||
end
|
||||
minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname)
|
||||
|
||||
|
||||
-- Some saw-less recipes:
|
||||
|
||||
minetest.register_craft({
|
||||
@ -92,7 +92,7 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
||||
{recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":panel_" .. subname .. " 12",
|
||||
recipe = {
|
||||
@ -100,13 +100,13 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
||||
{recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":panel_" .. subname,
|
||||
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = recipeitem,
|
||||
|
@ -59,18 +59,18 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
||||
output = modname .. ":slab_" .. subname .. " 6",
|
||||
recipe = {{recipeitem, recipeitem, recipeitem}},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slab_" .. subname,
|
||||
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slab_" .. subname,
|
||||
recipe = {{modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slab_" .. subname,
|
||||
recipe = {
|
||||
@ -84,7 +84,7 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
||||
output = recipeitem,
|
||||
recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slab_" .. subname .. " 3",
|
||||
|
@ -129,7 +129,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
mesh = "moreblocks_slope.obj",
|
||||
collision_box = box_slope,
|
||||
selection_box = box_slope,
|
||||
|
||||
|
||||
},
|
||||
["_half"] = {
|
||||
mesh = "moreblocks_slope_half.obj",
|
||||
@ -141,9 +141,9 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
collision_box = box_slope_half_raised,
|
||||
selection_box = box_slope_half_raised,
|
||||
},
|
||||
|
||||
|
||||
--==============================================================
|
||||
|
||||
|
||||
["_inner"] = {
|
||||
mesh = "moreblocks_slope_inner.obj",
|
||||
collision_box = box_slope_inner,
|
||||
@ -159,9 +159,9 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
collision_box = box_slope_inner_half_raised,
|
||||
selection_box = box_slope_inner_half_raised,
|
||||
},
|
||||
|
||||
|
||||
--==============================================================
|
||||
|
||||
|
||||
["_outer"] = {
|
||||
mesh = "moreblocks_slope_outer.obj",
|
||||
collision_box = box_slope_outer,
|
||||
@ -177,9 +177,9 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
collision_box = box_slope_outer_half_raised,
|
||||
selection_box = box_slope_outer_half_raised,
|
||||
},
|
||||
|
||||
|
||||
--==============================================================
|
||||
|
||||
|
||||
["_outer_cut"] = {
|
||||
mesh = "moreblocks_slope_outer_cut.obj",
|
||||
collision_box = box_slope_outer,
|
||||
@ -214,7 +214,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
end
|
||||
|
||||
-- Some saw-less recipes:
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. " 7",
|
||||
recipe = {
|
||||
@ -232,7 +232,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{modname .. ":panel_" .. subname, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. "_half 10",
|
||||
recipe = {
|
||||
@ -248,7 +248,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{modname .. ":panel_" .. subname, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. "_half_raised 7",
|
||||
recipe = {
|
||||
@ -257,7 +257,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. "_half_raised 7",
|
||||
recipe = {
|
||||
@ -266,7 +266,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
--===================================================== Inner ==
|
||||
|
||||
minetest.register_craft({
|
||||
@ -286,7 +286,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{modname .. ":stair_" .. subname .. "_half", recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. "_inner_half 10",
|
||||
recipe = {
|
||||
@ -302,7 +302,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{modname .. ":stair_" .. subname .. "_half", recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. "_inner_half_raised 7",
|
||||
recipe = {
|
||||
@ -311,7 +311,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. "_inner_half_raised 7",
|
||||
recipe = {
|
||||
@ -320,7 +320,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
--===================================================== Outer ==
|
||||
|
||||
minetest.register_craft({
|
||||
@ -340,7 +340,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{modname .. ":micro_" .. subname, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. "_outer_half 10",
|
||||
recipe = {
|
||||
@ -356,7 +356,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{modname .. ":micro_" .. subname, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. "_outer_half_raised 7",
|
||||
recipe = {
|
||||
@ -365,7 +365,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":slope_" .. subname .. "_outer_half_raised 7",
|
||||
recipe = {
|
||||
@ -374,83 +374,83 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
--================================================= Shapeless ==
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = recipeitem,
|
||||
recipe = {modname .. ":slope_" .. subname, modname .. ":slope_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = recipeitem,
|
||||
recipe = {modname .. ":slope_" .. subname .. "_outer_cut", modname .. ":slope_" .. subname .. "_outer_cut"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = recipeitem,
|
||||
recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half_raised"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = recipeitem,
|
||||
recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
|
||||
modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slab_" .. subname,
|
||||
recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slope_" .. subname .. "_half_raised",
|
||||
recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
|
||||
modname .. ":slope_" .. subname .. "_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slope_" .. subname .. "_half_raised",
|
||||
recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slope_" .. subname .. "_inner_half_raised",
|
||||
recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slope_" .. subname .. "_outer_half_raised",
|
||||
recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slope_" .. subname .. "_outer_cut_half_raised",
|
||||
recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_cut_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slope_" .. subname .. "_outer_cut",
|
||||
recipe = {modname .. ":slope_" .. subname .. "_outer"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slope_" .. subname .. "_outer_cut_half",
|
||||
recipe = {modname .. ":slope_" .. subname .. "_outer_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":slope_" .. subname .. "_outer_cut_half_raised",
|
||||
|
@ -124,7 +124,7 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
||||
minetest.register_alias("stairs:stair_" .. subname, modname .. ":stair_" .. subname)
|
||||
|
||||
-- Some saw-less recipes:
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = modname .. ":stair_" .. subname .. " 8",
|
||||
recipe = {
|
||||
@ -142,73 +142,73 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
||||
{recipeitem, recipeitem, recipeitem},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname,
|
||||
recipe = {modname .. ":panel_" .. subname, modname .. ":slab_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname,
|
||||
recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname .. "_outer",
|
||||
recipe = {modname .. ":micro_" .. subname, modname .. ":slab_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname .. "_half",
|
||||
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname .. "_half",
|
||||
recipe = {modname .. ":panel_" .. subname, modname .. ":micro_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname .. "_right_half",
|
||||
recipe = {modname .. ":stair_" .. subname .. "_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname .. "_half",
|
||||
recipe = {modname .. ":stair_" .. subname .. "_right_half"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname,
|
||||
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
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},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname .. "_outer",
|
||||
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = modname .. ":stair_" .. subname,
|
||||
recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({ -- See mirrored variation of the recipe below.
|
||||
output = modname .. ":stair_" .. subname .. "_alt",
|
||||
recipe = {
|
||||
@ -216,7 +216,7 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
||||
{"" , modname .. ":panel_" .. subname},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({ -- Mirrored variation of the recipe above.
|
||||
output = modname .. ":stair_" .. subname .. "_alt",
|
||||
recipe = {
|
||||
|
@ -860,7 +860,7 @@ function nether.grow_tree(pos, generated)
|
||||
local emerged_pos1, emerged_pos2 = manip:read_from_map(min, max)
|
||||
local area = VoxelArea:new({MinEdge=emerged_pos1, MaxEdge=emerged_pos2})
|
||||
local nodes = manip:get_data()
|
||||
local param2s = manip:get_param2_data()
|
||||
local param2s = manip:get_param2_data()
|
||||
|
||||
for _,p in pairs(leaf_ps) do
|
||||
p = area:indexp(p)
|
||||
|
@ -366,7 +366,7 @@ minetest.register_node("nether:apple", {
|
||||
if nether_port(user, vector.round(user:getpos())) then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
local p_hunger = tonumber(hud.hunger[user:get_player_name()])
|
||||
if not p_hunger then
|
||||
return
|
||||
@ -428,7 +428,7 @@ minetest.register_node("nether:vine", {
|
||||
minetest.node_dig(p, nn, digger)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
|
@ -305,14 +305,14 @@ local function check_portal(p1, p2)
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
if not move_check(p1, p2.y, "y") then
|
||||
return false
|
||||
end
|
||||
if not move_check(p2, p1.y, "y") then
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@ -343,7 +343,7 @@ local function make_portal(pos)
|
||||
print("[nether] aborted, obsidian portals can't be used to get out")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
for d=1,2 do
|
||||
for y=p1.y+1,p2.y-1 do
|
||||
local p
|
||||
@ -357,18 +357,18 @@ local function make_portal(pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local param2
|
||||
if p1.z == p2.z then
|
||||
param2 = 0
|
||||
else
|
||||
param2 = 1
|
||||
end
|
||||
|
||||
|
||||
local target = {x=p1.x, y=p1.y, z=p1.z}
|
||||
target.x = target.x + 1
|
||||
target.y = portal_target + math.random(4)
|
||||
|
||||
|
||||
for d=0,3 do
|
||||
for y=p1.y,p2.y do
|
||||
local p = {}
|
||||
|
@ -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)
|
||||
-- Branch textures created by Neuromancer.
|
||||
-- Licence for Code and Non-Bush leaf code is WTFPL.
|
||||
|
||||
abstract_bushes = {}
|
||||
|
||||
abstract_bushes = {}
|
||||
|
||||
minetest.register_node("bushes:youngtree2_bottom", {
|
||||
description = "Young Tree 2 (bottom)",
|
||||
description = "Young Tree 2 (bottom)",
|
||||
drawtype="nodebox",
|
||||
tiles = {"bushes_youngtree2trunk.png"},
|
||||
inventory_image = "bushes_youngtree2trunk_inv.png",
|
||||
wield_image = "bushes_youngtree2trunk_inv.png",
|
||||
wield_image = "bushes_youngtree2trunk_inv.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
is_ground_content = true,
|
||||
@ -27,7 +27,7 @@ node_box = {
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = 'default:stick'
|
||||
})
|
||||
|
||||
|
||||
local BushBranchCenter = { {1,1}, {3,2} }
|
||||
for i in pairs(BushBranchCenter) do
|
||||
local Num = BushBranchCenter[i][1]
|
||||
@ -56,8 +56,8 @@ for i in pairs(BushBranchCenter) do
|
||||
sunlight_propagates = true,
|
||||
groups = {
|
||||
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
leaves=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
@ -77,8 +77,8 @@ for i in pairs(BushBranchSide) do
|
||||
--[[bottom]]"bushes_branches_center_"..TexNum..".png",
|
||||
--[[right]] "bushes_branches_left_"..TexNum..".png",
|
||||
--[[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
|
||||
--[[front]] "bushes_branches_right_"..TexNum..".png"
|
||||
--[[back]] "bushes_branches_center_"..TexNum..".png",-- unless U really want 'em 2 B different
|
||||
--[[front]] "bushes_branches_right_"..TexNum..".png"
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
@ -99,8 +99,8 @@ for i in pairs(BushBranchSide) do
|
||||
sunlight_propagates = true,
|
||||
groups = {
|
||||
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
leaves=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
@ -110,23 +110,23 @@ end
|
||||
|
||||
local BushLeafNode = { {1}, {2}}
|
||||
for i in pairs(BushLeafNode) do
|
||||
local Num = BushLeafNode[i][1]
|
||||
local Num = BushLeafNode[i][1]
|
||||
minetest.register_node("bushes:BushLeaves"..Num, {
|
||||
description = "Bush Leaves "..Num,
|
||||
drawtype = "allfaces_optional",
|
||||
tiles = {"bushes_leaves_"..Num..".png"},
|
||||
paramtype = "light",
|
||||
groups = { -- MM: Should we add leafdecay?
|
||||
groups = { -- MM: Should we add leafdecay?
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
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 chance_of_bush_node_right = math.random(1,10)
|
||||
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)
|
||||
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)
|
||||
end
|
||||
end
|
||||
local chance_of_bush_node_back = math.random(1,10)
|
||||
if chance_of_bush_node_back> 5 then
|
||||
bush_side_height = math.random(0,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)
|
||||
end
|
||||
|
||||
|
||||
abstract_bushes.grow_bush_node(pos,5,leaf_type)
|
||||
end
|
||||
|
||||
abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
|
||||
|
||||
|
||||
|
||||
|
||||
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 bush_branch_type = 2
|
||||
|
||||
|
||||
-- MM: I'm not sure if it's slower now than before...
|
||||
if dir ~= 5 and leaf_type == 1 then
|
||||
bush_branch_type = 2
|
||||
@ -178,7 +178,7 @@ abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
|
||||
bush_branch_type = 3
|
||||
dir = 1
|
||||
end
|
||||
|
||||
|
||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
||||
minetest.set_node(right_here, {name="bushes:bushbranches"..bush_branch_type , param2=dir})
|
||||
@ -196,7 +196,7 @@ end
|
||||
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_grass",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
@ -207,21 +207,21 @@ plantslib:register_generate_plant({
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
abstract_bushes.grow_bush
|
||||
)
|
||||
)
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
abstract_bushes.grow_youngtree_node2 = function(pos, height)
|
||||
|
||||
|
||||
|
||||
|
||||
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 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}
|
||||
|
||||
|
||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(right_here).name == "default:junglegrass" 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_south, {name="bushes:BushLeaves1" })
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_grass",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
@ -252,6 +252,6 @@ plantslib:register_generate_plant({
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
abstract_bushes.grow_youngtree2
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
--http://dev.minetest.net/Node_Drawtypes
|
||||
|
@ -16,7 +16,7 @@ minetest.register_craft({
|
||||
if minetest.get_modpath("farming") and farming.mod == "redo" then
|
||||
--[[ We really have nothing to do to use farming:sugar in the recipes
|
||||
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
|
||||
|
@ -11,7 +11,7 @@ plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
-- find out which bush type we are dealing with
|
||||
local bush_name = ""
|
||||
local can_harvest = false
|
||||
|
||||
|
||||
if oldnode.name == "bushes:fruitless_bush" then
|
||||
-- this bush has not grown fruits yet (but will eventually)
|
||||
bush_name = oldmetadata.fields.bush_type
|
||||
|
@ -28,7 +28,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if ground_y then
|
||||
local p = {x=x,y=ground_y+1,z=z}
|
||||
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
|
||||
|
@ -88,10 +88,10 @@ minetest.register_node("cavestuff:stalactite_1",{
|
||||
{-0.037500,-0.837500,0.037500,0.037500,0.500000,-0.025000},
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
on_place = function(itemstack, placer, 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-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)})
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
-- License (everything): WTFPL
|
||||
-- Contains code from: plants_lib
|
||||
-- Looked at code from: default
|
||||
-- Looked at code from: default
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_dryplants.grow_juncus = function(pos)
|
||||
@ -86,7 +86,7 @@ minetest.register_node("dryplants:juncus_02", {
|
||||
-- near water or swamp
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_grass",
|
||||
--"default:desert_sand",
|
||||
--"default:sand",
|
||||
"stoneage:grass_with_silex",
|
||||
@ -107,7 +107,7 @@ plantslib:register_generate_plant({
|
||||
-- at dunes/beach
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
--"default:dirt_with_grass",
|
||||
--"default:dirt_with_grass",
|
||||
--"default:desert_sand",
|
||||
"default:sand",
|
||||
--"stoneage:grass_with_silex",
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
-- License (everything): WTFPL
|
||||
-- Contains code from: plants_lib
|
||||
-- Looked at code from: default
|
||||
-- Looked at code from: default
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_dryplants.grow_grass_variation = function(pos)
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
-- License (everything): WTFPL
|
||||
-- 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)
|
||||
@ -70,7 +70,7 @@ abstract_dryplants.grow_reedmace_water = function(pos)
|
||||
minetest.set_node(pos_02, {name="dryplants:reedmace_height_3_spikes"})
|
||||
else
|
||||
minetest.set_node(pos_02, {name="dryplants:reedmace_height_3"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -212,8 +212,8 @@ minetest.register_node("dryplants:reedmace", {
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
if node.name == "dryplants:reedmace_top"
|
||||
or node.name == "dryplants:reedmace_spikes" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
or node.name == "dryplants:reedmace_spikes" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"dryplants:reedmace_sapling")
|
||||
end
|
||||
end,
|
||||
@ -241,10 +241,10 @@ minetest.register_node("dryplants:reedmace_bottom", {
|
||||
},
|
||||
after_destruct = function(pos,oldnode)
|
||||
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_spikes" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
or node.name == "dryplants:reedmace_spikes" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"dryplants:reedmace_sapling")
|
||||
end
|
||||
end,
|
||||
@ -348,7 +348,7 @@ minetest.register_entity("dryplants:reedmace_water_entity",{
|
||||
-- near water or swamp
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_grass",
|
||||
"default:desert_sand",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
@ -370,7 +370,7 @@ plantslib:register_generate_plant({
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt",
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_grass",
|
||||
--"default:desert_sand",
|
||||
--"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex",
|
||||
|
@ -5,7 +5,7 @@
|
||||
-- License (everything): WTFPL
|
||||
-- Contains code from: plants_lib
|
||||
-- Looked at code from: 4seasons, default
|
||||
-- Supports: vines
|
||||
-- Supports: vines
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
assert(abstract_ferns.config.enable_giant_treefern == true)
|
||||
@ -21,7 +21,7 @@ abstract_ferns.grow_giant_tree_fern = function(pos)
|
||||
end
|
||||
|
||||
local size = math.random(12,16) -- min of range must be >= 4
|
||||
|
||||
|
||||
local leafchecks = {
|
||||
{
|
||||
direction = 3,
|
||||
@ -238,8 +238,8 @@ minetest.register_node("ferns:fern_trunk_big", {
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
after_destruct = function(pos,oldnode)
|
||||
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
|
||||
minetest.dig_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
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"ferns:fern_trunk_big")
|
||||
end
|
||||
end,
|
||||
|
@ -6,7 +6,7 @@
|
||||
-- Contains code from: plants_lib
|
||||
-- Looked at code from: default, flowers, trees
|
||||
-- Dependencies: plants_lib
|
||||
-- Supports: dryplants, stoneage, sumpf
|
||||
-- Supports: dryplants, stoneage, sumpf
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
assert(abstract_ferns.config.enable_horsetails == true)
|
||||
|
@ -4,7 +4,7 @@ local version = "0.2.0"
|
||||
local mname = "ferns" -- former "archaeplantae"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- (by Mossmanikin)
|
||||
-- License (everything): WTFPL
|
||||
-- License (everything): WTFPL
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_ferns = {}
|
||||
|
@ -1,6 +1,6 @@
|
||||
-- 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 "=").
|
||||
|
||||
-- If there's a "false" (behind a "=") you can change it to "true" (and the other way around).
|
||||
|
@ -4,7 +4,7 @@
|
||||
-- by Mossmanikin
|
||||
-- License (everything): WTFPL
|
||||
-- Contains code from: plants_lib
|
||||
-- Looked at code from: default , trees
|
||||
-- Looked at code from: default , trees
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
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
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local size = math.random(1, 5)
|
||||
local crown = ({ "ferns:tree_fern_leaves", "ferns:tree_fern_leaves_02" })[math.random(1, 2)]
|
||||
|
||||
|
||||
local i = 1
|
||||
while (i < size-1) do
|
||||
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(),
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
if node.name == "ferns:fern_trunk" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
if node.name == "ferns:fern_trunk" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"ferns:fern_trunk")
|
||||
end
|
||||
end,
|
||||
|
@ -42,7 +42,7 @@ for i in ipairs(lilies_list) do
|
||||
minetest.register_node(":flowers:waterlily"..deg1, {
|
||||
description = S("Waterlily"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
tiles = {
|
||||
"flowers_waterlily"..deg2..".png",
|
||||
"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 under_node.name ~= "default:water_source" then
|
||||
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
|
||||
place_pos = top_pos
|
||||
else
|
||||
@ -138,11 +138,11 @@ for i in ipairs(algae_list) do
|
||||
num = "_"..algae_list[i][1]
|
||||
algae_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 }
|
||||
end
|
||||
|
||||
|
||||
minetest.register_node(":flowers:seaweed"..num, {
|
||||
description = S("Seaweed"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
tiles = {
|
||||
"flowers_seaweed"..num..".png",
|
||||
"flowers_seaweed"..num..".png^[transformFY"
|
||||
},
|
||||
@ -161,9 +161,9 @@ for i in ipairs(algae_list) do
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 },
|
||||
},
|
||||
},
|
||||
buildable_to = true,
|
||||
|
||||
|
||||
liquids_pointable = true,
|
||||
drop = "flowers:seaweed",
|
||||
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 under_node.name ~= "default:water_source" then
|
||||
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
|
||||
place_pos = top_pos
|
||||
else
|
||||
@ -240,7 +240,7 @@ for i in ipairs(flowers_list) do
|
||||
local flowerdesc = flowers_list[i][1]
|
||||
local flower = flowers_list[i][2]
|
||||
local craftwith = flowers_list[i][3]
|
||||
|
||||
|
||||
minetest.register_node(":flowers:potted_"..flower, {
|
||||
description = S("Potted "..flowerdesc),
|
||||
drawtype = "mesh",
|
||||
@ -254,7 +254,7 @@ for i in ipairs(flowers_list) do
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.2, -0.5, -0.2, 0.2, 0.4, 0.2 },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
@ -336,7 +336,7 @@ flowers_plus.grow_waterlily = function(pos)
|
||||
if lilies_list[i][1] ~= nil then
|
||||
ext = "_"..lilies_list[i][1]
|
||||
end
|
||||
|
||||
|
||||
if chance == num then
|
||||
minetest.set_node(right_here, {name="flowers:waterlily"..ext, param2=math.random(0,3)})
|
||||
end
|
||||
@ -529,7 +529,7 @@ minetest.register_craft( {
|
||||
-- cotton wads -> string (can be crafted into wool blocks)
|
||||
-- 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_pot", "flowers:potted_dandelion_white")
|
||||
minetest.register_alias("flowers:potted_cotton_plant", "flowers:potted_dandelion_white")
|
||||
|
@ -36,7 +36,7 @@ minetest.register_craftitem("mushroom:poison",{
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "mushroom:identifier",
|
||||
recipe = {
|
||||
recipe = {
|
||||
{ "", "default:torch", "" },
|
||||
{ "default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot" },
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ minetest.register_abm({
|
||||
chance = 300, -- Modif MFF
|
||||
action = function(pos, node)
|
||||
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, 3, "default:water_source") then
|
||||
if math.random(0, 1) == 0 then
|
||||
@ -194,7 +194,7 @@ minetest.register_abm({
|
||||
chance = 300, -- Modif MFF
|
||||
action = function(pos, node)
|
||||
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
|
||||
if math.random(0,1) == 0 then
|
||||
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 = minetest.get_node(soil_pos)
|
||||
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
|
||||
local spread_x = 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"
|
||||
and (newsoil.name == "default:dirt_with_grass"
|
||||
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
|
||||
minetest.set_node(newpos, {name=node.name})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
@ -44,7 +44,7 @@ end
|
||||
function nature:grow_node(pos, nodename)
|
||||
if pos ~= nil then
|
||||
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
|
||||
minetest.remove_node(pos)
|
||||
|
@ -125,7 +125,7 @@ end
|
||||
|
||||
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.
|
||||
|
||||
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))
|
||||
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.actionslist_no_aircheck[#plantslib.actionslist_no_aircheck + 1] = { biomedef, nodes_or_function_or_model }
|
||||
local s = biomedef.surface
|
||||
@ -216,7 +216,7 @@ function plantslib:populate_surfaces(biome, nodes_or_function_or_model, snodes,
|
||||
else
|
||||
if string.find(biome_surfaces_string, "group:") then
|
||||
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
|
||||
surface_ok = true
|
||||
break
|
||||
@ -495,13 +495,13 @@ function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa)
|
||||
chance = biome.spawn_chance,
|
||||
neighbors = biome.neighbors,
|
||||
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 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 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})
|
||||
if noise1 > biome.plantlife_limit
|
||||
if noise1 > biome.plantlife_limit
|
||||
and noise2 <= biome.temp_min
|
||||
and noise2 >= biome.temp_max
|
||||
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
|
||||
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 })
|
||||
end
|
||||
elseif biome.spawn_on_bottom then
|
||||
@ -650,7 +650,7 @@ function plantslib:find_adjacent_wall(pos, verticals, randomflag)
|
||||
local verts = dump(verticals)
|
||||
if randomflag then
|
||||
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] = 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
|
||||
|
@ -15,7 +15,7 @@ end
|
||||
|
||||
abstract_trunks.place_twig = function(pos)
|
||||
local twig_size = math.random(1,27)
|
||||
|
||||
|
||||
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_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 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 node_here = minetest.get_node(right_here)
|
||||
local node_north = minetest.get_node(north)
|
||||
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_west = minetest.get_node(west)
|
||||
local node_n_w = minetest.get_node(north_west)
|
||||
-- small twigs
|
||||
-- small twigs
|
||||
if twig_size <= 16 then
|
||||
minetest.set_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)})
|
||||
end
|
||||
-- big twigs
|
||||
if Big_Twigs == true then
|
||||
-- big twig 1
|
||||
-- big twig 1
|
||||
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
|
||||
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
|
||||
minetest.set_node(right_here, {name="trunks:twig_5"})
|
||||
end
|
||||
@ -59,7 +59,7 @@ abstract_trunks.place_twig = function(pos)
|
||||
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
|
||||
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
|
||||
minetest.set_node(right_here, {name="trunks:twig_5", param2=1})
|
||||
end
|
||||
@ -73,7 +73,7 @@ abstract_trunks.place_twig = function(pos)
|
||||
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
|
||||
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
|
||||
minetest.set_node(right_here, {name="trunks:twig_5", param2=2})
|
||||
end
|
||||
@ -87,7 +87,7 @@ abstract_trunks.place_twig = function(pos)
|
||||
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
|
||||
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
|
||||
minetest.set_node(right_here, {name="trunks:twig_5", param2=3})
|
||||
end
|
||||
@ -98,11 +98,11 @@ abstract_trunks.place_twig = function(pos)
|
||||
minetest.set_node(north, {name="trunks:twig_8", param2=3})
|
||||
end
|
||||
end
|
||||
-- big twig 2
|
||||
-- big twig 2
|
||||
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
|
||||
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
|
||||
minetest.set_node(right_here, {name="trunks:twig_9"})
|
||||
end
|
||||
@ -116,7 +116,7 @@ abstract_trunks.place_twig = function(pos)
|
||||
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
|
||||
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
|
||||
minetest.set_node(right_here, {name="trunks:twig_9", param2=1})
|
||||
end
|
||||
@ -130,7 +130,7 @@ abstract_trunks.place_twig = function(pos)
|
||||
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
|
||||
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
|
||||
minetest.set_node(right_here, {name="trunks:twig_9", param2=2})
|
||||
end
|
||||
@ -144,7 +144,7 @@ abstract_trunks.place_twig = function(pos)
|
||||
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
|
||||
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
|
||||
minetest.set_node(right_here, {name="trunks:twig_9", param2=3})
|
||||
end
|
||||
@ -202,11 +202,11 @@ local TRuNKS = {
|
||||
-- MoD TRuNK NR
|
||||
{"default", "tree", 1},
|
||||
{"default", "jungletree", 2},
|
||||
|
||||
|
||||
{"trees", "tree_conifer", 3},
|
||||
{"trees", "tree_mangrove", 4},
|
||||
{"trees", "tree_palm", 5},
|
||||
|
||||
|
||||
{"moretrees", "apple_tree_trunk", 6},
|
||||
{"moretrees", "beech_trunk", 7},
|
||||
{"moretrees", "birch_trunk", 8},
|
||||
@ -227,7 +227,7 @@ for i in pairs(TRuNKS) do
|
||||
local TRuNK = TRuNKS[i][2]
|
||||
local NR = TRuNKS[i][3]
|
||||
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 minetest.registered_nodes[trunkname] then -- the node being called exists.
|
||||
temptrunk = clone_node(trunkname)
|
||||
@ -236,9 +236,9 @@ for i in pairs(TRuNKS) do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
abstract_trunks.place_trunk = function(pos)
|
||||
|
||||
|
||||
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 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 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 node_here = minetest.get_node(right_here)
|
||||
local node_north = minetest.get_node(north)
|
||||
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
|
||||
minetest.set_node(north, {name=MoD..":"..TRuNK, param2=4})
|
||||
end
|
||||
|
||||
|
||||
if length >= 4 and minetest.registered_nodes[node_north2.name].buildable_to then
|
||||
minetest.set_node(north2, {name=MoD..":"..TRuNK, param2=4})
|
||||
end
|
||||
@ -365,13 +365,13 @@ if Moss_on_ground == true then
|
||||
abstract_trunks.grow_moss_on_ground = function(pos)
|
||||
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local moss_type = math.random(1,21)
|
||||
|
||||
|
||||
if moss_type == 1 then
|
||||
minetest.set_node(on_ground, {name="trunks:moss_fungus", param2=math.random(0,3)})
|
||||
else
|
||||
minetest.set_node(on_ground, {name="trunks:moss", param2=math.random(0,3)})
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
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_w = {x=pos.x-1, y=pos.y, 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_north = minetest.get_node(at_side_n)
|
||||
local node_east = minetest.get_node(at_side_e)
|
||||
local node_south = minetest.get_node(at_side_s)
|
||||
local node_west = minetest.get_node(at_side_w)
|
||||
local node_under = minetest.get_node(undrneath)
|
||||
|
||||
|
||||
--if minetest.get_item_group(node_under.name, "tree") < 1 then
|
||||
local moss_type = math.random(1,41)
|
||||
if minetest.registered_nodes[node_here.name].buildable_to then -- instead of check_air = true,
|
||||
@ -491,20 +491,20 @@ plantslib:register_generate_plant({
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- RooTS
|
||||
-- RooTS
|
||||
-----------------------------------------------------------------------------------------------
|
||||
if Roots == true then -- see settings.txt
|
||||
|
||||
abstract_trunks.grow_roots = function(pos)
|
||||
local twig_size = math.random(1,27)
|
||||
|
||||
|
||||
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 north = {x=pos.x , y=pos.y , z=pos.z+1}
|
||||
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 west = {x=pos.x-1, y=pos.y , z=pos.z }
|
||||
|
||||
|
||||
local node_here = minetest.get_node(right_here)
|
||||
local node_below = minetest.get_node(below)
|
||||
local node_north = minetest.get_node(north)
|
||||
@ -515,8 +515,8 @@ abstract_trunks.grow_roots = function(pos)
|
||||
for i in pairs(TRuNKS) do
|
||||
local MoD = TRuNKS[i][1]
|
||||
local TRuNK = TRuNKS[i][2]
|
||||
if minetest.get_modpath(MoD) ~= nil
|
||||
and node_here.name == MoD..":"..TRuNK
|
||||
if minetest.get_modpath(MoD) ~= nil
|
||||
and node_here.name == MoD..":"..TRuNK
|
||||
and string.find(node_below.name, "dirt")
|
||||
and node_here.param2 == 0 then
|
||||
if minetest.registered_nodes[node_north.name].buildable_to then
|
||||
|
@ -17,7 +17,7 @@ for i in pairs(NoDe) do
|
||||
inventory_image = "trunks_twig_"..NR..".png",
|
||||
wield_image = "trunks_twig_"..NR..".png",
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
tiles = {
|
||||
"trunks_twig_"..NR..".png",
|
||||
"trunks_twig_"..NR..".png^[transformFY", -- mirror
|
||||
"trunks_twig_6.png" -- empty
|
||||
@ -214,7 +214,7 @@ if Auto_Roof_Corner == true then
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
|
||||
|
||||
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_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
|
||||
minetest.set_node(pos, {name=corner, param2=0})
|
||||
end
|
||||
|
||||
|
||||
if ((node_north.name == roof and node_north.param2 == 1)
|
||||
or (node_north.name == corner and node_north.param2 == 2))
|
||||
and ((node_east.name == roof and node_east.param2 == 0)
|
||||
@ -235,7 +235,7 @@ if Auto_Roof_Corner == true then
|
||||
then
|
||||
minetest.set_node(pos, {name=corner, param2=1})
|
||||
end
|
||||
|
||||
|
||||
if ((node_east.name == roof and node_east.param2 == 2)
|
||||
or (node_east.name == corner and node_east.param2 == 3))
|
||||
and ((node_south.name == roof and node_south.param2 == 1)
|
||||
@ -243,7 +243,7 @@ if Auto_Roof_Corner == true then
|
||||
then
|
||||
minetest.set_node(pos, {name=corner, param2=2})
|
||||
end
|
||||
|
||||
|
||||
if ((node_south.name == roof and node_south.param2 == 3)
|
||||
or (node_south.name == corner and node_south.param2 == 0))
|
||||
and ((node_west.name == roof and node_west.param2 == 2)
|
||||
@ -259,7 +259,7 @@ if Auto_Roof_Corner == true then
|
||||
then
|
||||
minetest.set_node(pos, {name=corner_2, param2=0})
|
||||
end
|
||||
|
||||
|
||||
if ((node_north.name == roof and node_north.param2 == 3)
|
||||
or (node_north.name == corner_2 and node_north.param2 == 2))
|
||||
and ((node_east.name == roof and node_east.param2 == 2)
|
||||
@ -267,7 +267,7 @@ if Auto_Roof_Corner == true then
|
||||
then
|
||||
minetest.set_node(pos, {name=corner_2, param2=1})
|
||||
end
|
||||
|
||||
|
||||
if ((node_east.name == roof and node_east.param2 == 0)
|
||||
or (node_east.name == corner_2 and node_east.param2 == 3))
|
||||
and ((node_south.name == roof and node_south.param2 == 3)
|
||||
@ -275,7 +275,7 @@ if Auto_Roof_Corner == true then
|
||||
then
|
||||
minetest.set_node(pos, {name=corner_2, param2=2})
|
||||
end
|
||||
|
||||
|
||||
if ((node_south.name == roof and node_south.param2 == 1)
|
||||
or (node_south.name == corner_2 and node_south.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.
|
||||
-- I'm not satisfied with this; they should be either bigger or a different drawtype.
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- RooTS
|
||||
-- RooTS
|
||||
-----------------------------------------------------------------------------------------------
|
||||
if Roots == true then -- see settings.txt
|
||||
|
||||
@ -303,11 +303,11 @@ local TRuNKS = {
|
||||
-- MoD TRuNK
|
||||
{"default", "tree" },
|
||||
{"default", "jungletree" },
|
||||
|
||||
|
||||
{"trees", "tree_conifer" },
|
||||
{"trees", "tree_mangrove" },
|
||||
{"trees", "tree_palm" },
|
||||
|
||||
|
||||
{"moretrees", "apple_tree_trunk" },
|
||||
{"moretrees", "beech_trunk" },
|
||||
{"moretrees", "birch_trunk" },
|
||||
@ -326,9 +326,9 @@ for i in pairs(TRuNKS) do
|
||||
local MoD = TRuNKS[i][1]
|
||||
local TRuNK = TRuNKS[i][2]
|
||||
if minetest.get_modpath(MoD) ~= nil then
|
||||
|
||||
|
||||
local des = minetest.registered_nodes[MoD..":"..TRuNK].description
|
||||
|
||||
|
||||
minetest.register_node("trunks:"..TRuNK.."root", {
|
||||
description = des.." Root",
|
||||
paramtype = "light",
|
||||
@ -350,12 +350,12 @@ for i in pairs(TRuNKS) do
|
||||
choppy=2,
|
||||
oddly_breakable_by_hand=1,
|
||||
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
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -123,7 +123,7 @@ vines.dig_vine = function( pos, node_name, user )
|
||||
--only dig give the vine if shears are used
|
||||
if not user then return false end
|
||||
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()
|
||||
if inv then
|
||||
inv:add_item("main", ItemStack( node_name ))
|
||||
|
@ -26,7 +26,7 @@ local RaDiuS = {
|
||||
}
|
||||
-- e = + , n = +
|
||||
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
|
||||
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
|
||||
|
@ -10,14 +10,14 @@ dofile(minetest.get_modpath("woodsoils").."/nodes.lua")
|
||||
dofile(minetest.get_modpath("woodsoils").."/generating.lua")
|
||||
|
||||
-- felt like playing a bit :D
|
||||
--[[print(" _____ __")
|
||||
--[[print(" _____ __")
|
||||
print("_/ ____\\___________ ____ _______/ |_")
|
||||
print("\\ __\\/ _ \\_ __ \\_/ __ \\ / ___/\\ __\\")
|
||||
print(" | | ( <_> ) | \\/\\ ___/ \\___ \\ | |")
|
||||
print(" |__| \\____/|__| \\___ >____ > |__|")
|
||||
print(" | | ( <_> ) | \\/\\ ___/ \\___ \\ | |")
|
||||
print(" |__| \\____/|__| \\___ >____ > |__|")
|
||||
print(" \\/ \\/")
|
||||
|
||||
print(" .__.__")
|
||||
print(" .__.__")
|
||||
print(" __________ |__| | ______")
|
||||
print(" / ___/ _ \\| | | / ___/")
|
||||
print(" \\___ ( <_> ) | |__\\___ \\")
|
||||
|
@ -3,8 +3,8 @@
|
||||
minetest.register_node("woodsoils:dirt_with_leaves_1", {
|
||||
description = "Forest Soil 1",
|
||||
tiles = {
|
||||
"default_dirt.png^woodsoils_ground_cover.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^woodsoils_ground_cover.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^woodsoils_ground_cover_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {
|
||||
@ -21,8 +21,8 @@ minetest.register_node("woodsoils:dirt_with_leaves_1", {
|
||||
minetest.register_node("woodsoils:dirt_with_leaves_2", {
|
||||
description = "Forest Soil 2",
|
||||
tiles = {
|
||||
"woodsoils_ground.png",
|
||||
"default_dirt.png",
|
||||
"woodsoils_ground.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^woodsoils_ground_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {
|
||||
@ -39,8 +39,8 @@ minetest.register_node("woodsoils:dirt_with_leaves_2", {
|
||||
minetest.register_node("woodsoils:grass_with_leaves_1", {
|
||||
description = "Forest Soil 3",
|
||||
tiles = {
|
||||
"default_grass.png^woodsoils_ground_cover2.png",
|
||||
"default_dirt.png",
|
||||
"default_grass.png^woodsoils_ground_cover2.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side2.png"},
|
||||
is_ground_content = true,
|
||||
groups = {
|
||||
@ -57,8 +57,8 @@ minetest.register_node("woodsoils:grass_with_leaves_1", {
|
||||
minetest.register_node("woodsoils:grass_with_leaves_2", {
|
||||
description = "Forest Soil 4",
|
||||
tiles = {
|
||||
"default_grass.png^woodsoils_ground_cover.png",
|
||||
"default_dirt.png",
|
||||
"default_grass.png^woodsoils_ground_cover.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {
|
||||
|
@ -1,7 +1,7 @@
|
||||
abstract_youngtrees = {}
|
||||
abstract_youngtrees = {}
|
||||
|
||||
minetest.register_node("youngtrees:bamboo", {
|
||||
description = "Young Bamboo Tree",
|
||||
description = "Young Bamboo Tree",
|
||||
drawtype="nodebox",
|
||||
tiles = {"bamboo.png"},
|
||||
paramtype = "light",
|
||||
@ -21,11 +21,11 @@ minetest.register_node("youngtrees:bamboo", {
|
||||
})
|
||||
|
||||
minetest.register_node("youngtrees:youngtree2_middle",{
|
||||
description = "Young Tree 2 (middle)",
|
||||
description = "Young Tree 2 (middle)",
|
||||
drawtype="nodebox",
|
||||
tiles = {"youngtree2branch.png"},
|
||||
inventory_image = "youngtree2branch.png",
|
||||
wield_image = "youngtree2branch.png",
|
||||
wield_image = "youngtree2branch.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
is_ground_content = true,
|
||||
@ -60,7 +60,7 @@ minetest.register_node("youngtrees:youngtree_top", {
|
||||
drop = 'trunks:twig_1'
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_node("youngtrees:youngtree_middle", {
|
||||
description = "Young Tree (middle)",
|
||||
drawtype = "plantlike",
|
||||
@ -80,7 +80,7 @@ minetest.register_node("youngtrees:youngtree_middle", {
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
minetest.register_node("youngtrees:youngtree_bottom", {
|
||||
description = "Young Tree (bottom)",
|
||||
drawtype = "plantlike",
|
||||
@ -98,19 +98,19 @@ minetest.register_node("youngtrees:youngtree_bottom", {
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = 'trunks:twig_1'
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
abstract_youngtrees.grow_youngtree_node = function(pos, height)
|
||||
|
||||
|
||||
|
||||
|
||||
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}
|
||||
|
||||
|
||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
||||
if height == 1 then
|
||||
@ -119,20 +119,20 @@ abstract_youngtrees.grow_youngtree_node = function(pos, height)
|
||||
if height == 2 then
|
||||
minetest.set_node(right_here, {name="youngtrees:youngtree_bottom"})
|
||||
minetest.set_node(above_right_here, {name="youngtrees:youngtree_top"})
|
||||
end
|
||||
end
|
||||
if height == 3 then
|
||||
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(above_right_here, {name="youngtrees:youngtree_middle"})
|
||||
minetest.set_node(two_above_right_here, {name="youngtrees:youngtree_top"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_grass",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
@ -143,4 +143,4 @@ plantslib:register_generate_plant({
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
abstract_youngtrees.grow_youngtree
|
||||
)
|
||||
)
|
||||
|
@ -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", {
|
||||
@ -226,7 +226,7 @@ minetest.register_abm({
|
||||
local y = {x = pos.x, y = pos.y + 1, 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
|
||||
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
|
||||
minetest.get_node(yy).name == "noairblocks:water_sourcex" then
|
||||
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 yy = {x = pos.x, y = pos.y + 2, z = pos.z }
|
||||
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
|
||||
minetest.get_node(yy).name == "noairblocks:water_sourcex" then
|
||||
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
|
||||
return
|
||||
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
|
||||
minetest.get_node(yy).name == "noairblocks:water_sourcex") then
|
||||
pos.y=pos.y + 1
|
||||
@ -284,7 +284,7 @@ minetest.register_abm({
|
||||
if (active_object_count_wider + active_object_count_wider) > 40 then
|
||||
return
|
||||
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
|
||||
minetest.get_node(yy).name == "noairblocks:water_sourcex") then
|
||||
pos.y=pos.y + 1
|
||||
|
@ -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}
|
||||
if minetest.get_node(xn).name == "default:water_source" 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
|
||||
if minetest.get_node(xn).name == "default:water_flowing" 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
|
||||
return
|
||||
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}
|
||||
if minetest.get_node(xp).name == "default:water_source" 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
|
||||
if minetest.get_node(xp).name == "default:water_flowing" 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
|
||||
return
|
||||
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}
|
||||
if minetest.get_node(zn).name == "default:water_source" 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
|
||||
if minetest.get_node(zn).name == "default:water_flowing" 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
|
||||
return
|
||||
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}
|
||||
if minetest.get_node(zp).name == "default:water_source" 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
|
||||
if minetest.get_node(zp).name == "default:water_flowing" 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
|
||||
return
|
||||
end
|
||||
@ -168,7 +168,7 @@ interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
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
|
||||
if minetest.get_node(yp).name == "default:water_flowing" then
|
||||
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 yp= {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
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
|
||||
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
|
||||
return
|
||||
end
|
||||
|
@ -396,9 +396,9 @@ action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
minetest.get_node(yyp).name == "noairblocks:water_sourcex") then
|
||||
if (minetest.get_node(yyyp).name == "default:water_source" or
|
||||
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
|
||||
minetest.add_node(pos, {name = "seaplants:kelpgreen"})
|
||||
minetest.add_node(pos, {name = "seaplants:kelpgreen"})
|
||||
else
|
||||
return
|
||||
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
|
||||
if (minetest.get_node(yyyp).name == "default:water_source" or
|
||||
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
|
||||
minetest.add_node(pos, {name = "seaplants:kelpbrown"})
|
||||
minetest.add_node(pos, {name = "seaplants:kelpbrown"})
|
||||
else
|
||||
return
|
||||
end
|
||||
|
@ -77,7 +77,7 @@ minetest.register_node("seawrecks:ubootchest", {
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
|
||||
local kind_of_price = math.random(0,2)
|
||||
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"}
|
||||
@ -91,7 +91,7 @@ minetest.register_node("seawrecks:ubootchest", {
|
||||
else
|
||||
price_group[2] = ""
|
||||
end
|
||||
|
||||
|
||||
meta:set_string("formspec",
|
||||
"size[8,9]"..
|
||||
"list[current_name;main;0,0;8,4;]"..
|
||||
@ -203,7 +203,7 @@ interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
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 == "noairblocks:water_sourcex") then
|
||||
minetest.add_node(pos, {name = "default:sand"})
|
||||
@ -298,7 +298,7 @@ local yp = {x = pos.x, y = pos.y + 3, z = pos.z}
|
||||
end
|
||||
|
||||
pos.z = pos.z - 1
|
||||
pos.x = pos.x + 1
|
||||
pos.x = pos.x + 1
|
||||
minetest.add_node(pos, {name = "default:wood"})
|
||||
|
||||
pos.z = pos.z - 1
|
||||
@ -380,7 +380,7 @@ interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
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 == "noairblocks:water_sourcex") then
|
||||
minetest.add_node(pos, {name = "default:dirt"})
|
||||
|
@ -144,7 +144,7 @@ function stairsshine.register_slab(subname, recipeitem, groups, images, descript
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
-- Upside down slabs
|
||||
if p0.y-1 == p1.y then
|
||||
-- Turn into full block if pointing at a existing slab
|
||||
|
@ -101,14 +101,14 @@ local function leave_sled(self, player)
|
||||
player:set_detach()
|
||||
default.player_attached[name] = false
|
||||
default.player_set_animation(player, "stand" , 30)
|
||||
|
||||
|
||||
player:set_physics_override({
|
||||
speed = 1,
|
||||
jump = 1,
|
||||
})
|
||||
player:hud_remove(self.HUD) -- And here is part 2. ~ LazyJ
|
||||
self.object:remove()
|
||||
|
||||
|
||||
--Give the sled back again
|
||||
player:get_inventory():add_item("main", "snow:sled")
|
||||
end
|
||||
@ -205,7 +205,7 @@ minetest.register_craftitem("snow:sled", {
|
||||
local pos = placer:getpos()
|
||||
if accelerating_possible(vector.round(pos)) then
|
||||
pos.y = pos.y+0.5
|
||||
|
||||
|
||||
--Get on the sled and remove it from inventory.
|
||||
minetest.add_entity(pos, "snow:sled"):right_click(placer)
|
||||
itemstack:take_item(); return itemstack
|
||||
|
@ -51,12 +51,12 @@ unified_inventory.register_page("u_skins", {
|
||||
if not u_skins.is_skin(u_skins.u_skins[name]) then
|
||||
u_skins.u_skins[name] = u_skins.default
|
||||
end
|
||||
|
||||
|
||||
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]"
|
||||
.."label[6,.5;Raw texture:]"
|
||||
.."image[6,1;2,1;"..u_skins.u_skins[name]..".png]")
|
||||
|
||||
|
||||
local meta = u_skins.meta[u_skins.u_skins[name]]
|
||||
if meta 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[.75,3.8;6.5,.5;u_skins_null;Page "..page.."/"..total_pages.."]"
|
||||
.."button[7,3.8;1,.5;u_skins_page$"..page_next..";>>]")
|
||||
|
||||
|
||||
unified_inventory.register_page("u_skins_page$"..(page - 1), {
|
||||
get_formspec = function(player)
|
||||
return {formspec=formspec}
|
||||
|
@ -10,14 +10,14 @@ while fetched_skip < 40 do
|
||||
if file then
|
||||
local data = string.split(file:read("*all"), "\n", 3)
|
||||
file:close()
|
||||
|
||||
|
||||
u_skins.list[internal_id] = name
|
||||
u_skins.meta[name] = {}
|
||||
u_skins.meta[name].name = data[1]
|
||||
u_skins.meta[name].author = data[2]
|
||||
u_skins.meta[name].license = data[3]
|
||||
u_skins.meta[name].description = "" --what's that??
|
||||
|
||||
|
||||
fetched_skip = 0
|
||||
internal_id = internal_id + 1
|
||||
end
|
||||
@ -41,7 +41,7 @@ while fetched_skip < 40 do
|
||||
u_skins.meta[name].author = data[2]
|
||||
u_skins.meta[name].license = data[3] or ""
|
||||
u_skins.meta[name].description = ""
|
||||
|
||||
|
||||
fetched_skip = 0
|
||||
internal_id = internal_id + 1
|
||||
end
|
||||
|
@ -104,7 +104,7 @@ function msg_meta:fromRFC1459(line)
|
||||
local pos
|
||||
self.command, pos = line:match("(%S+)()")
|
||||
-- /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"))
|
||||
return
|
||||
end
|
||||
|
@ -13,7 +13,7 @@ end
|
||||
function set:add(connection)
|
||||
local socket = connection.socket
|
||||
insert(self.sockets, socket)
|
||||
|
||||
|
||||
self.connections[socket] = connection
|
||||
insert(self.connections, connection)
|
||||
end
|
||||
@ -32,13 +32,13 @@ end
|
||||
|
||||
function set:select()
|
||||
local read, write, err = select(self.sockets, nil, self.timeout)
|
||||
|
||||
|
||||
if read then
|
||||
for k, socket in ipairs(read) do
|
||||
read[k] = self.connections[socket]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return read, err
|
||||
end
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user