mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-09-10 14:50:25 +02:00
Merge pull request #89 from LeMagnesium/remove_whitespaces
Removing all whitespaces from our Lua files
This commit is contained in:
commit
f2e4e54832
|
@ -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)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -16,17 +16,17 @@ local IRC = [[
|
|||
|
||||
Voici les sanctions prevues pour les infractions aux regles ci-dessus.
|
||||
|
||||
- Infraction niveau DIRT :
|
||||
- Infraction niveau DIRT :
|
||||
Manque de respect envers autrui : Devoice une journee
|
||||
Provocation envers autrui : Devoice une journee
|
||||
Insultes envers autrui : Kick + Devoice une journee
|
||||
|
||||
|
||||
- Infraction niveau STONE :
|
||||
- Recidivide d'infraction niveau dirt : Kick + Ban 1/2 journee
|
||||
- Flood, Discrimination : Kick + Devoice deux heures
|
||||
- Spam : Kick + Devoice 1 jour + Ban 1/2 journee
|
||||
|
||||
- Infraction niveau MESE :
|
||||
|
||||
- Infraction niveau MESE :
|
||||
- Recidive d'infraction niveau stone : Kick + Ban 4 jours + devoice 5 jours
|
||||
- Diffusion de contenu a caractere sexuel : Kick + Ban 1 semaine + devoice 5 jours
|
||||
- Irrespect envers l'equipe du canal : Kick + Ban 10 jours + devoice 8 jours
|
||||
|
@ -35,7 +35,7 @@ Voici les sanctions prevues pour les infractions aux regles ci-dessus.
|
|||
- Recidive d'infraction niveau mese : Kick + Ban 1 mois + devoice 2 semaines
|
||||
- Violation des lois en vigueur : Kick + Ban definitif + Gline si accord des IrcOP d'InchraNet
|
||||
- Violation des regles d'InchraNet : Kick + Ban definitif + Gline ou sanction defnie par l'equipe d'InchraNet
|
||||
|
||||
|
||||
|
||||
Autres regles de bienseances :
|
||||
- Ne demandez pas a faire partie des operateurs/semi-operateurs du canal.
|
||||
|
|
|
@ -16,17 +16,17 @@ local IRC = [[
|
|||
|
||||
Voici les sanctions prévues pour les infractions aux règles ci-dessus.
|
||||
|
||||
- Infraction niveau DIRT :
|
||||
- Infraction niveau DIRT :
|
||||
Manque de respect envers autrui : Devoice une journée
|
||||
Provocation envers autrui : Devoice une journée
|
||||
Insultes envers autrui : Kick + Devoice une journée
|
||||
|
||||
|
||||
- Infraction niveau STONE :
|
||||
- Récidivide d'infraction niveau dirt : Kick + Ban 1/2 journée
|
||||
- Flood, Discrimination : Kick + Devoice deux heures
|
||||
- Spam : Kick + Devoice 1 jour + Ban 1/2 journée
|
||||
|
||||
- Infraction niveau MESE :
|
||||
|
||||
- Infraction niveau MESE :
|
||||
- Récidive d'infraction niveau stone : Kick + Ban 4 jours + devoice 5 jours
|
||||
- Diffusion de contenu à caractère sexuel : Kick + Ban 1 semaine + devoice 5 jours
|
||||
- Irrespect envers l'équipe du canal : Kick + Ban 10 jours + devoice 8 jours
|
||||
|
@ -35,7 +35,7 @@ Voici les sanctions prévues pour les infractions aux règles ci-dessus.
|
|||
- Récidive d'infraction niveau mese : Kick + Ban 1 mois + devoice 2 semaines
|
||||
- Violation des lois en vigueur : Kick + Ban définitif + Gline si accord des IrcOP d'InchraNet
|
||||
- Violation des règles d'InchraNet : Kick + Ban définitif + Gline ou sanction défnie par l'équipe d'InchraNet
|
||||
|
||||
|
||||
|
||||
Autres règles de bienséances :
|
||||
- Ne demandez pas à faire partie des opérateurs/semi-opérateurs du canal.
|
||||
|
|
|
@ -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, })
|
||||
]]
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
--plants to place in openfarming
|
||||
local plants = { ["farming:blueberries"]=1, ["farming:carrot"]=1, ["farming:coffee_beans"]=1, ["farming:corn"]=1, ["farming:cucumber"]=1,
|
||||
["farming:melon_slice"]=1, ["farming:potato"]=1, ["farming:pumpkin_slice"]=1, ["farming:raspberries"]=1, ["farming:rhubarb"]=1,
|
||||
["farming:tomato"]=1, ["farming:seed_cotton"]=1, ["farming:seed_wheat"]=1,["default:papyrus"]=1
|
||||
["farming:tomato"]=1, ["farming:seed_cotton"]=1, ["farming:seed_wheat"]=1,["default:papyrus"]=1
|
||||
}
|
||||
|
||||
--tools to dig in openfarming
|
||||
|
@ -49,17 +49,17 @@ function areas:canInteract(pos, name)
|
|||
if not player then return false end
|
||||
local wstack = player:get_wielded_item():get_name()
|
||||
if wstack == "" then wstack = "hand" end
|
||||
|
||||
|
||||
--on_place
|
||||
if node == "air" and plants[wstack] ~= nil then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
--on_dig
|
||||
if minetest.get_item_group(node, "plant") == 1 and in_hand[wstack] ~= nil then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
owned = true
|
||||
else
|
||||
owned = true
|
||||
|
|
|
@ -60,7 +60,7 @@ minetest.register_chatcommand("set_owner", {
|
|||
|
||||
local id = areas:add(ownerName, areaName, pos1, pos2, nil)
|
||||
areas:save()
|
||||
|
||||
|
||||
minetest.chat_send_player(ownerName,
|
||||
"You have been granted control over area #"..
|
||||
id..". Type /list_areas to show your areas.")
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
--more_signs by addi
|
||||
--Code and Textures are under the CC by-sa 3.0 licence
|
||||
--see: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
|
||||
|
||||
--Code and Textures are under the CC by-sa 3.0 licence
|
||||
--see: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
|
||||
|
||||
arrow_signs={}
|
||||
|
||||
arrow_signs.formspec = "field[text;Sign text:;${text}]";
|
||||
|
||||
arrow_signs_on_place = function(itemstack, placer, pointed_thing)
|
||||
|
||||
|
||||
local posabove = pointed_thing.above
|
||||
local posunder = pointed_thing.under
|
||||
local vector = placer:get_look_dir()
|
||||
local place = true
|
||||
|
||||
|
||||
if posabove.y>posunder.y then
|
||||
if(vector.z>0.5 and vector.z<=1) then
|
||||
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 10})
|
||||
elseif (vector.x>0.5 and vector.x<=1) then
|
||||
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 19})
|
||||
elseif(-0.5>vector.z and -1<=vector.z) then
|
||||
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 4})
|
||||
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 4})
|
||||
elseif (-0.5>vector.x and -1<=vector.x) then
|
||||
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 13})
|
||||
else
|
||||
|
@ -33,7 +33,7 @@ arrow_signs_on_place = function(itemstack, placer, pointed_thing)
|
|||
elseif (vector.x>0.5 and vector.x<=1) then
|
||||
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 17})
|
||||
elseif(-0.5>vector.z and -1<=vector.z) then
|
||||
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 6})
|
||||
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 6})
|
||||
elseif (-0.5>vector.x and -1<=vector.x) then
|
||||
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 15})
|
||||
else
|
||||
|
@ -96,15 +96,15 @@ arrow_signs_on_place = function(itemstack, placer, pointed_thing)
|
|||
else
|
||||
itemstack:take_item()
|
||||
end
|
||||
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function arrow_signs:savetext(pos, formname, fields, sender)
|
||||
|
||||
|
||||
if not minetest.get_player_privs(sender:get_player_name())["interact"] then
|
||||
minetest.chat_send_player(sender:get_player_name(), "error: you don't have permission to edit the sign. you need the interact priv")
|
||||
return
|
||||
|
@ -140,8 +140,8 @@ minetest.override_item("default:sign_wall", {
|
|||
minetest.register_node("arrow_signs:wall", {
|
||||
description = "Arrow signs",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ 0.25, -0.25, 0.5, -0.25, 0.5, 0.47},
|
||||
{ 0.1875, -0.3125, 0.5, -0.1875, -0.25, 0.47},
|
||||
|
@ -150,7 +150,7 @@ minetest.register_node("arrow_signs:wall", {
|
|||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ 0.25, -0.25, 0.5, -0.25, 0.5, 0.47},
|
||||
{ 0.1875, -0.3125, 0.5, -0.1875, -0.25, 0.47},
|
||||
|
@ -166,7 +166,7 @@ minetest.register_node("arrow_signs:wall", {
|
|||
walkable = false,
|
||||
groups = {choppy=2,dig_immediate=2,sign=1},
|
||||
sounds = default.node_sound_defaults(),
|
||||
on_place = arrow_signs_on_place,
|
||||
on_place = arrow_signs_on_place,
|
||||
on_construct = function(pos)
|
||||
--local n = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
|
|
@ -150,7 +150,7 @@ function awards.register_achievement(name,data_table)
|
|||
if data_table.custom_announce == nil or data_table.custom_announce == "" then
|
||||
data_table.custom_announce = "Achievement Unlocked:"
|
||||
end
|
||||
|
||||
|
||||
-- add the achievement to the definition table
|
||||
data_table.name = name
|
||||
awards.def[name] = data_table
|
||||
|
@ -191,7 +191,7 @@ end
|
|||
function awards.give_achievement(name, award)
|
||||
-- Access Player Data
|
||||
local data = awards.players[name]
|
||||
|
||||
|
||||
-- Perform checks
|
||||
if not data then
|
||||
return
|
||||
|
@ -277,7 +277,7 @@ function awards.give_achievement(name, award)
|
|||
position = {x = 0.5, y = 0},
|
||||
offset = {x = 0, y = 40},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
})
|
||||
local three = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
name = "award_title",
|
||||
|
@ -287,7 +287,7 @@ function awards.give_achievement(name, award)
|
|||
position = {x = 0.5, y = 0},
|
||||
offset = {x = 30, y = 100},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
})
|
||||
local four = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
name = "award_icon",
|
||||
|
@ -304,10 +304,10 @@ function awards.give_achievement(name, award)
|
|||
player:hud_remove(four)
|
||||
end)
|
||||
end
|
||||
|
||||
-- record this in the log
|
||||
|
||||
-- record this in the log
|
||||
minetest.log("action", name.." has unlocked award "..title)
|
||||
|
||||
|
||||
-- save playertable
|
||||
awards.save()
|
||||
minetest.sound_play("award_award_won", {to_player = name, gain = 0.5*soundset.get_gain(name,"other")})
|
||||
|
@ -392,7 +392,7 @@ function awards.showto(name, to, sid, text)
|
|||
local def = awards.def[str]
|
||||
if def then
|
||||
if def.title then
|
||||
if def.description then
|
||||
if def.description then
|
||||
minetest.chat_send_player(to, def.title..": "..def.description)
|
||||
else
|
||||
minetest.chat_send_player(to, def.title)
|
||||
|
@ -406,9 +406,9 @@ function awards.showto(name, to, sid, text)
|
|||
if sid == nil or sid < 1 then
|
||||
sid = 1
|
||||
end
|
||||
local formspec = "size[11,5]"
|
||||
local formspec = "size[11,5]"
|
||||
local listofawards = awards._order_awards(name)
|
||||
|
||||
|
||||
-- Sidebar
|
||||
if sid then
|
||||
local item = listofawards[sid+0]
|
||||
|
@ -417,7 +417,7 @@ function awards.showto(name, to, sid, text)
|
|||
formspec = formspec .. "label[1,2.75;Secret Award]"..
|
||||
"image[1,0;3,3;unknown.png]"
|
||||
if def and def.description then
|
||||
formspec = formspec .. "label[0,3.25;Unlock this award to find out what it is]"
|
||||
formspec = formspec .. "label[0,3.25;Unlock this award to find out what it is]"
|
||||
end
|
||||
else
|
||||
local title = item.name
|
||||
|
@ -435,13 +435,13 @@ function awards.showto(name, to, sid, text)
|
|||
formspec = formspec .. "label[1,2.75;"..title..status.."]"..
|
||||
"image[1,0;3,3;"..icon.."]"
|
||||
if def and def.description then
|
||||
formspec = formspec .. "label[0,3.25;"..def.description.."]"
|
||||
formspec = formspec .. "label[0,3.25;"..def.description.."]"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Create list box
|
||||
formspec = formspec .. "textlist[4.75,0;6,5;awards;"
|
||||
formspec = formspec .. "textlist[4.75,0;6,5;awards;"
|
||||
local first = true
|
||||
for _,award in pairs(listofawards) do
|
||||
local def = awards.def[award.name]
|
||||
|
@ -450,14 +450,14 @@ function awards.showto(name, to, sid, text)
|
|||
formspec = formspec .. ","
|
||||
end
|
||||
first = false
|
||||
|
||||
|
||||
if def.secret and not award.got then
|
||||
formspec = formspec .. "#ACACACSecret Award"
|
||||
else
|
||||
local title = award.name
|
||||
local title = award.name
|
||||
if def and def.title then
|
||||
title = def.title
|
||||
end
|
||||
end
|
||||
if award.got then
|
||||
formspec = formspec .. minetest.formspec_escape(title)
|
||||
else
|
||||
|
@ -465,7 +465,7 @@ function awards.showto(name, to, sid, text)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
formspec = formspec .. ";"..sid.."]"
|
||||
|
||||
-- Show formspec to user
|
||||
|
@ -483,11 +483,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
local name = player:get_player_name()
|
||||
if fields.awards then
|
||||
local event = minetest.explode_textlist_event(fields.awards)
|
||||
if event.type == "CHG" then
|
||||
awards.showto(name,name,event.index,false)
|
||||
end
|
||||
if event.type == "CHG" then
|
||||
awards.showto(name,name,event.index,false)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end)
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ awards.register_onDeath(function(player,data)
|
|||
local pos = player:getpos()
|
||||
if pos and minetest.find_node_near(pos, 2, "fire:basic_flame") ~= nil then
|
||||
return "award_burn"
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
|
||||
|
@ -365,7 +365,7 @@ awards.register_onDeath(function(player,data)
|
|||
local pos = player:getpos()
|
||||
if pos and minetest.find_node_near(pos, 2, "default:lava_flowing") ~= nil then
|
||||
return "award_in_the_flow"
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
|
||||
|
@ -379,7 +379,7 @@ awards.register_onDeath(function(player,data)
|
|||
local pos = player:getpos()
|
||||
if pos and minetest.find_node_near(pos, 5, "default:stone_with_diamond") ~= nil then
|
||||
return "award_this_is_sad"
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
|
||||
|
@ -392,7 +392,7 @@ awards.register_onDeath(function(player,data)
|
|||
local pos = player:getpos()
|
||||
if pos and minetest.find_node_near(pos, 5, "bones:bones") ~= nil then
|
||||
return "award_the_stack"
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
|
||||
|
|
|
@ -128,14 +128,14 @@ minetest.register_on_dieplayer(function(player)
|
|||
if not player or not name or name=="" then
|
||||
return
|
||||
end
|
||||
|
||||
-- Get player
|
||||
|
||||
-- Get player
|
||||
awards.assertPlayer(name)
|
||||
local data = awards.players[name]
|
||||
|
||||
-- Increment counter
|
||||
data.deaths = data.deaths + 1
|
||||
|
||||
|
||||
-- Run callbacks and triggers
|
||||
for _,trigger in pairs(awards.onDeath) do
|
||||
local res = nil
|
||||
|
@ -160,14 +160,14 @@ minetest.register_on_joinplayer(function(player)
|
|||
if not player or not name or name=="" then
|
||||
return
|
||||
end
|
||||
|
||||
-- Get player
|
||||
|
||||
-- Get player
|
||||
awards.assertPlayer(name)
|
||||
local data = awards.players[name]
|
||||
|
||||
-- Increment counter
|
||||
data.joins = data.joins + 1
|
||||
|
||||
|
||||
-- Run callbacks and triggers
|
||||
for _,trigger in pairs(awards.onJoin) do
|
||||
local res = nil
|
||||
|
@ -197,11 +197,11 @@ minetest.register_on_chat_message(function(name, message)
|
|||
awards.assertPlayer(name)
|
||||
local data = awards.players[name]
|
||||
local player = minetest.get_player_by_name(name)
|
||||
|
||||
|
||||
-- Increment counter
|
||||
data.chats = data.chats + 1
|
||||
|
||||
-- Run callbacks and triggers
|
||||
|
||||
-- Run callbacks and triggers
|
||||
for _,trigger in pairs(awards.onChat) do
|
||||
local res = nil
|
||||
if type(trigger) == "function" then
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
--[[
|
||||
Beginners_chest mod
|
||||
Put some useful stuff in chests for the new players
|
||||
|
||||
|
||||
Version : 1.1 - 11/8/2014_14h48UTC
|
||||
Last modification by Mg on the : 14/3/2015 @ 14h48 UTC
|
||||
|
||||
|
||||
Mod ßý Mg, based on an idea of MinetestForFun/Darcidride
|
||||
]]--
|
||||
|
||||
|
@ -118,7 +118,7 @@ local chests = {
|
|||
minetest.register_globalstep(function(dtime)
|
||||
local i = 1
|
||||
while i < table.getn(chests)+1 do
|
||||
|
||||
|
||||
if not chests[i].stuff then
|
||||
chests[i].stuff = {
|
||||
[1] = "default:wood",
|
||||
|
@ -128,12 +128,12 @@ minetest.register_globalstep(function(dtime)
|
|||
if not chests[i].interval_timer then
|
||||
chests[i].interval_timer = 0
|
||||
end
|
||||
if not chests[i].interval_max then
|
||||
if not chests[i].interval_max then
|
||||
chests[i].interval_max = 7200 -- Using default value : 2h
|
||||
end
|
||||
|
||||
|
||||
chests[i].interval_timer = chests[i].interval_timer + dtime
|
||||
|
||||
|
||||
if chests[i].position.x and chests[i].position.y and chests[i].position.z and chests[i].interval_timer >= chests[i].interval_max then
|
||||
chests[i].interval_timer = 0
|
||||
local node = minetest.get_node(chests[i].position)
|
||||
|
@ -160,7 +160,7 @@ minetest.register_globalstep(function(dtime)
|
|||
inv:set_list("main", chests[i].stuff)
|
||||
|
||||
minetest.log("action","[b_chest]["..i.."] Chest reloaded at "..chests[i].position.x..", "..chests[i].position.y..", "..chests[i].position.z)
|
||||
|
||||
|
||||
else
|
||||
minetest.log("action","[b_chest]["..i.."] Cannot reload chest at "..chests[i].position.x..", "..chests[i].position.y..", "..chests[i].position.z.." : area not loaded.")
|
||||
end
|
||||
|
|
|
@ -187,8 +187,8 @@ minetest.register_abm(
|
|||
for k, obj in pairs(objs) do
|
||||
obj:set_hp(obj:get_hp()-100)
|
||||
minetest.sound_play("bobblocks_trap_fall",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 3,})
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 3,})
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
})
|
||||
|
|
|
@ -76,7 +76,7 @@ end
|
|||
function generate_tree(pos, trunk, leaves)
|
||||
pos.y = pos.y-1
|
||||
local nodename = minetest.get_node(pos).name
|
||||
|
||||
|
||||
pos.y = pos.y+1
|
||||
if not minetest.get_node_light(pos) then
|
||||
return
|
||||
|
@ -210,7 +210,7 @@ elseif string.find(n.name, "farming:pumpkin_") ~= nil then
|
|||
else
|
||||
minetest.set_node(pos, {name="farming:pumpkin"})
|
||||
end
|
||||
|
||||
|
||||
elseif n.name == "default:dirt_with_grass" then
|
||||
for i = -2, 3, 1 do
|
||||
for j = -3, 2, 1 do
|
||||
|
@ -225,8 +225,8 @@ elseif n.name == "default:dirt_with_grass" then
|
|||
else
|
||||
minetest.set_node(pos, {name=plant_tab[math.random(0, 5)]})
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -145,7 +145,7 @@ function add_protected_bukket_liquid(nameofbukket,liquidsourcename)
|
|||
end
|
||||
-- Check if pointing to a buildable node
|
||||
local n = minetest.get_node(pointed_thing.under)
|
||||
|
||||
|
||||
if is_protected_area(pointed_thing.under, 4 ,user:get_player_name()) then
|
||||
minetest.chat_send_player(user:get_player_name(),"You can't place here - Too short of a protected area. (less than or equal to 4 blocks)")
|
||||
if minetest.is_protected(pointed_thing.under,user:get_player_name()) then
|
||||
|
@ -153,7 +153,7 @@ function add_protected_bukket_liquid(nameofbukket,liquidsourcename)
|
|||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
if minetest.registered_nodes[n.name].buildable_to then
|
||||
-- buildable; replace the node
|
||||
minetest.log("action", user:get_player_name().. " use "..nameofbukket.." at ".. minetest.pos_to_string(pointed_thing.under))
|
||||
|
|
|
@ -35,7 +35,7 @@ minetest.register_entity(":__builtin:falling_node", {
|
|||
}
|
||||
self.object:set_properties(prop)
|
||||
end,
|
||||
|
||||
|
||||
set_owner = function(self, owner)
|
||||
if owner ~= nil then
|
||||
self.owner = "falling"
|
||||
|
@ -181,7 +181,7 @@ if PROTECT_LAVA_REALTIME == 1 then
|
|||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_string("owner") ~= nil and minetest.is_protected(pos, meta:get_string("owner")) then
|
||||
minetest.add_node(pos,{name="air"})
|
||||
end
|
||||
|
@ -196,7 +196,7 @@ if PROTECT_WATER_REALTIME == 1 then
|
|||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if meta:get_string("owner") ~= nil and minetest.is_protected(pos, meta:get_string("owner")) then
|
||||
minetest.add_node(pos,{name="air"})
|
||||
end
|
||||
|
@ -224,7 +224,7 @@ end
|
|||
-- local meta = minetest.get_meta(area:position(p_pos))
|
||||
-- if minetest.get_name_from_content_id(data[p_pos])== "default:lava_source" and meta:get_string("owner") ~= nil and minetest.is_protected(area:position(p_pos), meta:get_string("owner")) then
|
||||
-- data[p_pos] = c_air
|
||||
-- end
|
||||
-- end
|
||||
-- vm:set_data(data)
|
||||
-- vm:write_to_map()
|
||||
-- vm:update_map()
|
||||
|
|
|
@ -18,7 +18,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
is_visible = false,
|
||||
timer = 0,
|
||||
},
|
||||
|
||||
|
||||
itemstring = "",
|
||||
physical_state = true,
|
||||
|
||||
|
@ -83,7 +83,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
self.object:setacceleration({x=0, y=-10, z=0})
|
||||
self:set_item(self.itemstring)
|
||||
end,
|
||||
|
||||
|
||||
on_step = function(self, dtime)
|
||||
if not self.timer then
|
||||
self.timer = 0
|
||||
|
@ -92,16 +92,16 @@ minetest.register_entity(":__builtin:item", {
|
|||
if time ~= 0 and (self.timer > time) then
|
||||
self.object:remove()
|
||||
end
|
||||
|
||||
|
||||
local p = self.object:getpos()
|
||||
|
||||
|
||||
local name = minetest.get_node(p).name
|
||||
if (minetest.registered_nodes[name] and minetest.registered_nodes[name].damage_per_second > 0) or name == "maptools:igniter" then
|
||||
minetest.sound_play("builtin_item_lava", {pos = self.object:getpos(), gain = 0.5})
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
--[[ if name == "default:water_source" then
|
||||
self.object:setacceleration({x = 0, y = 4, z = 0})
|
||||
else
|
||||
|
@ -119,13 +119,13 @@ minetest.register_entity(":__builtin:item", {
|
|||
else
|
||||
pos.z = pos.z+d
|
||||
end
|
||||
|
||||
|
||||
local name = minetest.get_node(pos).name
|
||||
local par2 = minetest.get_node(pos).param2
|
||||
if name == "default:water_flowing" and par2 < param2 then
|
||||
return pos
|
||||
end
|
||||
|
||||
|
||||
if i<3 then
|
||||
pos.x = pos.x-d
|
||||
else
|
||||
|
@ -133,7 +133,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local vec = get_flowing_dir(self)
|
||||
if vec then
|
||||
local v = self.object:getvelocity()
|
||||
|
@ -159,7 +159,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
p.y = p.y - 0.3
|
||||
local nn = minetest.get_node(p).name
|
||||
-- If node is not registered or node is walkably solid.
|
||||
|
|
|
@ -106,7 +106,7 @@ chesttools.on_receive_fields = function(pos, formname, fields, player)
|
|||
selected = 'main';
|
||||
end
|
||||
local inv_list = 'main';
|
||||
if( selected == 'main' ) then
|
||||
if( selected == 'main' ) then
|
||||
inv_list = 'main';
|
||||
elseif( selected == 'craft' ) then
|
||||
inv_list = 'craft';
|
||||
|
@ -254,8 +254,8 @@ chesttools.update_chest = function(pos, formname, fields, player)
|
|||
elseif( fields.shared ) then
|
||||
price = 1;
|
||||
end
|
||||
|
||||
elseif( node.name=='chesttools:shared_chest') then
|
||||
|
||||
elseif( node.name=='chesttools:shared_chest') then
|
||||
if( fields.shared) then
|
||||
return;
|
||||
end
|
||||
|
@ -321,7 +321,7 @@ chesttools.update_chest = function(pos, formname, fields, player)
|
|||
minetest.swap_node( pos, { name = target, param2 = node.param2 });
|
||||
|
||||
minetest.chat_send_player( pname, 'Chest changed to '..tostring( minetest.registered_nodes[ target].description )..
|
||||
' for '..tostring( price )..' steel ingots.');
|
||||
' for '..tostring( price )..' steel ingots.');
|
||||
end
|
||||
|
||||
|
||||
|
@ -334,7 +334,7 @@ chesttools.form_input_handler = function( player, formname, fields)
|
|||
elseif( formname == "chesttools:update") then
|
||||
chesttools.update_chest( pos, formname, fields, player);
|
||||
end
|
||||
|
||||
|
||||
return;
|
||||
end
|
||||
end
|
||||
|
@ -435,9 +435,9 @@ minetest.register_node( 'chesttools:shared_chest', {
|
|||
return nil;
|
||||
end
|
||||
|
||||
if( node.name=='default:chest'
|
||||
or node.name=='default:chest_locked'
|
||||
or node.name=='chesttools:shared_chest') then
|
||||
if( node.name=='default:chest'
|
||||
or node.name=='default:chest_locked'
|
||||
or node.name=='chesttools:shared_chest') then
|
||||
|
||||
local formspec = "size[8,4]"..
|
||||
"label[2,0.4;Change chest type:]"..
|
||||
|
@ -464,7 +464,7 @@ minetest.register_node( 'chesttools:shared_chest', {
|
|||
formspec = formspec..'item_image[5,1;1.5,1.5;chesttools:shared_chest]'..
|
||||
'label[5,2.5;shared]';
|
||||
end
|
||||
minetest.show_formspec( name, "chesttools:update", formspec );
|
||||
minetest.show_formspec( name, "chesttools:update", formspec );
|
||||
end
|
||||
return nil;
|
||||
end,
|
||||
|
|
|
@ -136,7 +136,7 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
--------------------------
|
||||
-- presents -
|
||||
-- presents -
|
||||
--------------------------
|
||||
|
||||
-- paper colour craft --
|
||||
|
|
|
@ -11,7 +11,7 @@ minetest.register_node("christmas_craft:snowman", {
|
|||
paramtype2 = "facedir",
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@ minetest.register_node("christmas_craft:christmas_lights", {
|
|||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:christmas_wreath", {
|
||||
|
@ -46,7 +46,7 @@ minetest.register_node("christmas_craft:christmas_wreath", {
|
|||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
groups = {oddly_breakable_by_hand = 3},
|
||||
})
|
||||
|
||||
minetest.register_node("christmas_craft:christmas_star", {
|
||||
|
@ -92,9 +92,9 @@ minetest.register_node("christmas_craft:red_baubles", {
|
|||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
|
@ -119,9 +119,9 @@ minetest.register_node("christmas_craft:yellow_baubles", {
|
|||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
|
@ -146,9 +146,9 @@ minetest.register_node("christmas_craft:green_baubles", {
|
|||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
|
@ -174,9 +174,9 @@ minetest.register_node("christmas_craft:blue_baubles", {
|
|||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
|
@ -201,9 +201,9 @@ minetest.register_node("christmas_craft:orange_baubles", {
|
|||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
|
@ -228,9 +228,9 @@ minetest.register_node("christmas_craft:violet_baubles", {
|
|||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
|
@ -255,9 +255,9 @@ minetest.register_node("christmas_craft:pink_baubles", {
|
|||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
|
@ -282,9 +282,9 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
fixed = {
|
||||
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
|
||||
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
|
||||
|
||||
|
||||
-- side , top , side , side , bottom, side,
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
|
@ -298,9 +298,9 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
|
||||
------------
|
||||
--nodes--
|
||||
|
||||
|
||||
-- presents --
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:present_box", {
|
||||
description = "Present Box",
|
||||
tiles = {"christmas_craft_present_box.png"},
|
||||
|
@ -309,7 +309,7 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present", {
|
||||
description = "Christmas Present",
|
||||
tiles = {"christmas_craft_present_wh.png^christmas_craft_bow_top.png", "christmas_craft_present_wh.png^christmas_craft_bow_bottom.png", "christmas_craft_present_wh.png^christmas_craft_bow_side.png"},
|
||||
|
@ -334,13 +334,13 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
{items = {'fake_fire:flint_and_steel'}, rarity = 90,},
|
||||
{items = {'default:chest_locked'}, rarity = 80,},
|
||||
{items = {'default:brick'}, rarity = 80,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 80,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 80,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_green", {
|
||||
description = "Christmas Present Green ",
|
||||
tiles = {"christmas_craft_present_gr.png^christmas_craft_bow_top.png", "christmas_craft_present_gr.png^christmas_craft_bow_bottom.png", "christmas_craft_present_gr.png^christmas_craft_bow_side.png"},
|
||||
|
@ -365,13 +365,13 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_red", {
|
||||
description = "Christmas Present Red ",
|
||||
tiles = {"christmas_craft_present_re.png^christmas_craft_bow_top.png", "christmas_craft_present_re.png^christmas_craft_bow_bottom.png", "christmas_craft_present_re.png^christmas_craft_bow_side.png"},
|
||||
|
@ -396,7 +396,7 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
|
@ -427,13 +427,13 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_yellow", {
|
||||
description = "Christmas Present Yellow ",
|
||||
tiles = {"christmas_craft_present_ye.png^christmas_craft_bow_top.png", "christmas_craft_present_ye.png^christmas_craft_bow_bottom.png", "christmas_craft_present_ye.png^christmas_craft_bow_side.png"},
|
||||
|
@ -458,13 +458,13 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_red", {
|
||||
description = "Christmas Present Red ",
|
||||
tiles = {"christmas_craft_present_re.png^christmas_craft_bow_top.png", "christmas_craft_present_re.png^christmas_craft_bow_bottom.png", "christmas_craft_present_re.png^christmas_craft_bow_side.png"},
|
||||
|
@ -489,13 +489,13 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_violet", {
|
||||
description = "Christmas Present Violet ",
|
||||
tiles = {"christmas_craft_present_vi.png^christmas_craft_bow_top.png", "christmas_craft_present_vi.png^christmas_craft_bow_bottom.png", "christmas_craft_present_vi.png^christmas_craft_bow_side.png"},
|
||||
|
@ -520,13 +520,13 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_orange", {
|
||||
description = "Christmas Present Orange ",
|
||||
tiles = {"christmas_craft_present_or.png^christmas_craft_bow_top.png", "christmas_craft_present_or.png^christmas_craft_bow_bottom.png", "christmas_craft_present_or.png^christmas_craft_bow_side.png"},
|
||||
|
@ -551,13 +551,13 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("christmas_craft:Christmas_present_pink", {
|
||||
description = "Christmas Present Pink ",
|
||||
tiles = {"christmas_craft_present_pi.png^christmas_craft_bow_top.png", "christmas_craft_present_pi.png^christmas_craft_bow_bottom.png", "christmas_craft_present_pi.png^christmas_craft_bow_side.png"},
|
||||
|
@ -582,8 +582,8 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
{items = {'fake_fire:flint_and_steel'}, rarity = 15,},
|
||||
{items = {'default:chest_locked'}, rarity = 20,},
|
||||
{items = {'default:brick'}, rarity = 25,},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
}},
|
||||
{items = {'default:dirt_with_grass'}, rarity = 30,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
}),
|
||||
|
@ -643,32 +643,32 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
|
||||
-- string --
|
||||
|
||||
|
||||
minetest.register_craftitem("christmas_craft:red_ribbon", {
|
||||
description = "Red Ribbon",
|
||||
inventory_image = "christmas_craft_red_ribbon.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
|
||||
-- wish list --
|
||||
|
||||
|
||||
minetest.register_craftitem("christmas_craft:wish_list", {
|
||||
description = "Wish list",
|
||||
inventory_image = "christmas_craft_which_list.png",
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
})
|
||||
|
||||
|
||||
------------
|
||||
|
||||
-- minetest.register_craftitem("christmas_craft:snow_ball", {
|
||||
-- description = "Snow ball",
|
||||
-- inventory_image = "snow_ball.png",
|
||||
-- stack_max = 16,
|
||||
-- liquids_pointable = false,
|
||||
-- liquids_pointable = false,
|
||||
--})
|
||||
|
||||
|
||||
|
@ -705,7 +705,7 @@ minetest.register_node("christmas_craft:silver_baubles", {
|
|||
})
|
||||
--]]
|
||||
|
||||
-- complex node --
|
||||
-- complex node --
|
||||
|
||||
snowball_DAMAGE=0.5
|
||||
snowball_GRAVITY=9
|
||||
|
@ -734,7 +734,7 @@ snow_snowball_ENTITY={
|
|||
textures = {"snowball.png"},
|
||||
lastpos={},
|
||||
collisionbox = {-0.25,-0.25,-0.25, 0.25,0.25,0.25},
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -743,7 +743,7 @@ snow_snowball_ENTITY.on_step = function(self, dtime)
|
|||
self.timer=self.timer+dtime
|
||||
local pos = self.object:getpos()
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
|
||||
--Become item when hitting a node.
|
||||
if self.lastpos.x~=nil then --If there is no lastpos for some reason.
|
||||
if node.name ~= "air" then
|
||||
|
@ -754,10 +754,10 @@ snow_snowball_ENTITY.on_step = function(self, dtime)
|
|||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||
self.object:remove()
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
self.lastpos={x=pos.x, y=pos.y, z=pos.z} -- Set lastpos-->Node will be added at last pos outside the node
|
||||
|
||||
|
||||
end
|
||||
|
||||
minetest.register_entity("christmas_craft:snowball_entity", snow_snowball_ENTITY)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
print (" ---- mods override is Loading! ---- ")
|
||||
|
||||
-- leaves --
|
||||
-- leaves --
|
||||
|
||||
|
||||
--minetest.register_node(":4seasons:leaves_winter", {
|
||||
|
@ -29,7 +29,7 @@ minetest.register_node(":4seasons:grass_winter", {
|
|||
drop = {
|
||||
max_items = 2, items = {
|
||||
{items = {'default:dirt'}, rarity = 0,},
|
||||
{items = {'christmas_craft:snowball'}, rarity = 0,},
|
||||
{items = {'christmas_craft:snowball'}, rarity = 0,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
|
@ -45,7 +45,7 @@ minetest.register_node(":4seasons:sand_winter", {
|
|||
drop = {'default:sand',
|
||||
max_items = 2, items = {
|
||||
{items = {'default:sand'}, rarity = 0,},
|
||||
{items = {'christmas_craft:snowball'}, rarity = 0,},
|
||||
{items = {'christmas_craft:snowball'}, rarity = 0,},
|
||||
}},
|
||||
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
|
@ -61,7 +61,7 @@ minetest.register_node(":4seasons:desertsand_winter", {
|
|||
drop = {'default:desert_sand',
|
||||
max_items = 2, items = {
|
||||
{items = {'default:desert_sand'}, rarity = 0,},
|
||||
{items = {'christmas_craft:snowball'}, rarity = 0,},
|
||||
{items = {'christmas_craft:snowball'}, rarity = 0,},
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.4},
|
||||
|
@ -78,7 +78,7 @@ minetest.register_node(":4seasons:cactus_winter", {
|
|||
drop = {'default:cactus',
|
||||
max_items = 2, items = {
|
||||
{items = {'default:cactus'}, rarity = 0,},
|
||||
{items = {'christmas_craft:snowball'}, rarity = 0,},
|
||||
{items = {'christmas_craft:snowball'}, rarity = 0,},
|
||||
}},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
|
@ -52,10 +52,10 @@ minetest.register_node(":default:leaves", {
|
|||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
-- remplace jungleleaves
|
||||
minetest.register_node(":default:jungleleaves", {
|
||||
description = "Jungle Leaves",
|
||||
|
@ -90,7 +90,7 @@ minetest.register_node(":default:jungleleaves", {
|
|||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
@ -37,7 +37,7 @@ for shade = 1, 3 do
|
|||
drawtype = "fencelike",
|
||||
description = nodedesc,
|
||||
tiles = { pngname },
|
||||
inventory_image = pngnameinv,
|
||||
inventory_image = pngnameinv,
|
||||
wield_image = pngnameinv,
|
||||
sunlight_propagates = colored_block_sunlight,
|
||||
paramtype = "light",
|
||||
|
@ -54,7 +54,7 @@ for shade = 1, 3 do
|
|||
drawtype = "fencelike",
|
||||
description = s50nodedesc,
|
||||
tiles = { s50pngname },
|
||||
inventory_image = s50pngnameinv,
|
||||
inventory_image = s50pngnameinv,
|
||||
wield_image = s50pngnameinv,
|
||||
sunlight_propagates = colored_block_sunlight,
|
||||
paramtype = "light",
|
||||
|
@ -151,7 +151,7 @@ for hue = 1, 12 do
|
|||
drawtype = "fencelike",
|
||||
description = nodedesc,
|
||||
tiles = { pngname },
|
||||
inventory_image = pngnameinv,
|
||||
inventory_image = pngnameinv,
|
||||
wield_image = pngnameinv,
|
||||
sunlight_propagates = colored_block_sunlight,
|
||||
paramtype = "light",
|
||||
|
@ -252,7 +252,7 @@ for grey = 1,5 do
|
|||
drawtype = "fencelike",
|
||||
description = nodedesc,
|
||||
tiles = { pngname },
|
||||
inventory_image = pngnameinv,
|
||||
inventory_image = pngnameinv,
|
||||
wield_image = pngnameinv,
|
||||
sunlight_propagates = colored_block_sunlight,
|
||||
paramtype = "light",
|
||||
|
|
|
@ -98,7 +98,7 @@ for hue = 1, 12 do
|
|||
}
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- ============================================================
|
||||
-- The 5 levels of greyscale.
|
||||
|
|
|
@ -20,7 +20,7 @@ local colored_block_sound = "default.node_sound_wood_defaults()"
|
|||
-- Show the wood planks in the crafting guide:
|
||||
-- Value copy the groups table to another one to pass to stairsplus:register_all()
|
||||
-- oherwise stairsplus:register_all() will add the ["not_in_creative_inventory"] = 1 key/value to the groups
|
||||
-- of the original table and force the coloredwood planks to be removed from the crafting guide.
|
||||
-- of the original table and force the coloredwood planks to be removed from the crafting guide.
|
||||
local stairsplus_groups = {}
|
||||
if coloredwood.enable_stairsplus then
|
||||
for k, v in pairs(colored_block_groups) do
|
||||
|
@ -179,7 +179,7 @@ for hue = 1, 12 do
|
|||
},
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- ============================================================
|
||||
-- The 5 levels of greyscale.
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
-- Version 0.6
|
||||
|
||||
-- Changelog:
|
||||
-- Changelog:
|
||||
-- 23.05.15 As all dyes can be crafted into other dyes, only white dye is consumed - provided the
|
||||
-- other dyes needed for the crafting chain are stored.
|
||||
-- 22.05.15 Added support for new homedecor meshnodes.
|
||||
|
@ -61,7 +61,7 @@
|
|||
-- Added some more labels in the main menu to make it easier to understand.
|
||||
-- 22.07.13 Added textures provided by Vanessae
|
||||
-- fixed a bug concerning normal dyes (when unifieddyes is not installed)
|
||||
|
||||
|
||||
-- adds a function to check ownership of a node; taken from VanessaEs homedecor mod
|
||||
colormachine = {};
|
||||
|
||||
|
@ -86,14 +86,14 @@ local stained_glass_exception = 0;
|
|||
|
||||
-- the names of suitable sources of that color (note: this does not work by group!);
|
||||
-- you can add your own color sources here if you want
|
||||
colormachine.basic_dye_sources = { "flowers:rose", "flowers:tulip", "flowers:dandelion_yellow",
|
||||
colormachine.basic_dye_sources = { "flowers:rose", "flowers:tulip", "flowers:dandelion_yellow",
|
||||
"", "default:cactus", "", "", "", -- no lime, no aqua, no cyan, no skyblue
|
||||
"flowers:geranium", "flowers:viola", "", "", -- no magenta, no redviolet
|
||||
"default:clay_lump", "", "", "", "default:coal_lump" };
|
||||
|
||||
-- if flowers is not installed
|
||||
colormachine.alternate_basic_dye_sources = {
|
||||
"default:apple", "default:desert_stone", "default:sand",
|
||||
colormachine.alternate_basic_dye_sources = {
|
||||
"default:apple", "default:desert_stone", "default:sand",
|
||||
"", "default:cactus", "", "", "",
|
||||
"default:leaves", "", "", "" ,
|
||||
"default:clay_lump", "", "", "", "default:coal_lump" };
|
||||
|
@ -115,11 +115,11 @@ colormachine.dye_mixes = { red = {}, -- base color
|
|||
|
||||
white = {}, -- base color
|
||||
lightgrey = {13,15}, -- white + grey
|
||||
grey = {13,17}, -- black + white
|
||||
grey = {13,17}, -- black + white
|
||||
darkgrey = {15,17}, -- grey + black
|
||||
black = {}, -- base color
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-- construct the formspec for the color selector
|
||||
|
@ -140,7 +140,7 @@ end
|
|||
|
||||
-- defines the order in which blocks are shown
|
||||
-- nr: the diffrent block types need to be ordered by some system; the number defines that order
|
||||
-- modname: some mods define more than one type of colored blocks; the modname is needed
|
||||
-- modname: some mods define more than one type of colored blocks; the modname is needed
|
||||
-- for checking if the mod is installed and for creating colored blocks
|
||||
-- shades: some mods (or parts thereof) do not support all possible shades
|
||||
-- grey_shades: some mods support only some shades of grey (or none at all)
|
||||
|
@ -166,7 +166,7 @@ colormachine.data = {
|
|||
|
||||
hardenedclay_ = { nr=3.5, modname='hardenedclay', shades={1,0,1,0,0,0,1,0}, grey_shades={1,0,1,1,1}, u=0, descr="hclay", block="hardenedclay:hardened_clay_white", add="hardened_clay_", p=16},
|
||||
colouredstonebricks_ = { nr=3.6, modname='colouredstonebricks', shades={1,0,1,0,0,0,1,0}, grey_shades={1,0,1,1,1}, u=0, descr="cbrick", block="default:stonebrick", add="", p=1},
|
||||
|
||||
|
||||
clstone_stone_ = { nr=3.7, modname='clstone', shades={1,0,1,0,0,0,1,0}, grey_shades={1,0,1,1,1}, u=0, descr="clstone",block="default:stone", add="", p=1, obj_postfix='_stone' },
|
||||
|
||||
colorcubes_1_ = { nr=3.8, modname='colorcubes', shades={1,0,1,0,0,0,1,0}, grey_shades={1,0,1,1,1}, u=0, descr="ccubes",block="default:stone", add="", p=1, obj_postfix='_single' },
|
||||
|
@ -403,7 +403,7 @@ colormachine.generate_form = function( m_prefix )
|
|||
"label[0.3,1;light]";
|
||||
|
||||
-- not all mods offer all shades (and some offer even more)
|
||||
local supported = colormachine.data[ m_prefix ].shades;
|
||||
local supported = colormachine.data[ m_prefix ].shades;
|
||||
|
||||
if( supported[2]==0 ) then
|
||||
form = form..
|
||||
|
@ -510,7 +510,7 @@ colormachine.decode_color_name = function( meta, new_color )
|
|||
table.remove( liste, 1 ); -- the color has been selected
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- the color was not found! error! keep the old color
|
||||
if( selected_color == -1 ) then
|
||||
if( meta ) then
|
||||
|
@ -595,8 +595,8 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
|
||||
if( meta ~= nil ) then
|
||||
c = tonumber(meta:get_string('selected_color'));
|
||||
s = tonumber(meta:get_string('selected_shade'));
|
||||
g = tonumber(meta:get_string('selected_grey_shade'));
|
||||
s = tonumber(meta:get_string('selected_shade'));
|
||||
g = tonumber(meta:get_string('selected_grey_shade'));
|
||||
end
|
||||
|
||||
|
||||
|
@ -608,7 +608,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
|
||||
local k_orig = k;
|
||||
-- unifieddyes_ does not supply all colors
|
||||
if( k == 'unifieddyes_'
|
||||
if( k == 'unifieddyes_'
|
||||
and ( (g==-1 and s==3 and (as_obj_name==1 or not(c==4 or c==6 or c==8 or c==12 or c==13 )))
|
||||
or (g==-1 and s==1 and c==1 ) -- pink
|
||||
or (g==-1 and s==7 and c==5 ) -- dark brown
|
||||
|
@ -646,7 +646,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
return 'homedecor:'..colormachine.data[k].add..'brown'..(colormachine.data[k].postfix or '');
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if( k=='homedecor_table_' and as_obj_name==1 and new_color=='dark_orange' ) then
|
||||
return 'homedecor:'..colormachine.data[k].add..'mahogany'..(colormachine.data[k].postfix or '');
|
||||
end
|
||||
|
@ -661,8 +661,8 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
end
|
||||
|
||||
-- beds and sofas are available in less colors
|
||||
if( g==-1
|
||||
and (c==7 or c==11)
|
||||
if( g==-1
|
||||
and (c==7 or c==11)
|
||||
and (k=='beds_bed_top_top_' or k=='lrfurn_sofa_right_front_' or k=='lrfurn_armchair_front_' or k=='lrfurn_longsofa_middle_front_' )) then
|
||||
|
||||
return nil;
|
||||
|
@ -674,7 +674,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
local color_used = "";
|
||||
if( s==1 and c==1 ) then
|
||||
color_used = 'pink'; -- in blox, this is called "pink"; normally "light_red"
|
||||
elseif( g>-1 ) then
|
||||
elseif( g>-1 ) then
|
||||
color_used = colormachine.grey_names[ g ];
|
||||
elseif( s ~= 3 ) then
|
||||
return nil; -- only normal saturation supported
|
||||
|
@ -692,7 +692,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
return 'blox_'..( color_used )..( colormachine.data[k].add )..'.png';
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
local postfix = '.png';
|
||||
local prefix = k;
|
||||
|
@ -709,12 +709,12 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
return nil; -- no grey values for them
|
||||
end
|
||||
local h_trans = {yellow=1, lime=2, green=3, aqua=4, cyan=5, skyblue=6, blue=7, violet=8, magenta=9, redviolet=10, red=11,orange=12};
|
||||
|
||||
|
||||
local h = h_trans[ colormachine.colors[c] ];
|
||||
|
||||
local b = "";
|
||||
local sat = "";
|
||||
|
||||
|
||||
if( k == 'stained_glass_' ) then
|
||||
prefix = "stained_glass:"..(colormachine.colors[c]).."_";
|
||||
if( s==1 or s==2) then b = "8"; -- light
|
||||
|
@ -723,7 +723,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
elseif( s==7 or s==8) then b = "3"; -- dark
|
||||
end
|
||||
prefix = prefix.."_";
|
||||
|
||||
|
||||
sat = "7";
|
||||
if( s==2 or s==4 or s==6 or s==8 ) then -- saturation
|
||||
sat = "6";
|
||||
|
@ -747,7 +747,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
|
||||
if( s==1 and new_color=='light_blue' ) then -- only light blue is supported
|
||||
return prefix..'light_blue'..postfix;
|
||||
|
||||
|
||||
elseif( new_color=='dark_green' ) then
|
||||
return prefix..'forest_green'..postfix;
|
||||
|
||||
|
@ -760,14 +760,14 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
|
||||
elseif( new_color=='orange' ) then
|
||||
return prefix..'oak'..postfix;
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
if( k=='cotton_' and new_color=='grey') then
|
||||
new_color = 'mediumgrey';
|
||||
end
|
||||
|
||||
|
||||
|
||||
if( k=='framedglass_' and as_obj_name ~= 1) then
|
||||
postfix = 'glass.png';
|
||||
|
@ -791,7 +791,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
end
|
||||
|
||||
-- those have split textures...
|
||||
if( colormachine.data[k].modname == 'coloredblocks') then
|
||||
if( colormachine.data[k].modname == 'coloredblocks') then
|
||||
|
||||
|
||||
|
||||
|
@ -818,7 +818,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
|
||||
return 'coloredblocks_'..new_color..postfix;
|
||||
|
||||
elseif( new_color..'_' == colormachine.data[k].add ) then
|
||||
elseif( new_color..'_' == colormachine.data[k].add ) then
|
||||
|
||||
prefix = 'coloredblocks:';
|
||||
--]]
|
||||
|
@ -827,7 +827,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
end
|
||||
|
||||
if( colormachine.data[k].modname == 'plasticbox'
|
||||
and new_color == 'dark_green') then
|
||||
and new_color == 'dark_green') then
|
||||
return prefix..'darkgreen'..postfix;
|
||||
end
|
||||
|
||||
|
@ -835,11 +835,11 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
if( as_obj_name == 1 and colormachine.data[k].obj_postfix ) then
|
||||
postfix = (colormachine.data[k].obj_postfix) ..postfix;
|
||||
end
|
||||
|
||||
|
||||
-- normal dyes (also used for wool) use a diffrent naming scheme
|
||||
if( colormachine.data[k].u == 0) then
|
||||
if( new_color == 'darkgrey' and k ~= 'framedglass_') then
|
||||
return prefix..'dark_grey'..postfix;
|
||||
return prefix..'dark_grey'..postfix;
|
||||
elseif( new_color == 'dark_orange' ) then
|
||||
return prefix..'brown'..postfix;
|
||||
elseif( new_color == 'dark_green' ) then
|
||||
|
@ -847,7 +847,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
|
|||
elseif( new_color == 'light_red' ) then
|
||||
return prefix..'pink'..postfix;
|
||||
-- lime, aqua, skyblue and redviolet do not exist as standard wool/dye colors
|
||||
elseif( g == -1 and (c==4 or c==6 or c==8 or c==12) and k_orig ~= 'unifieddyes_') then
|
||||
elseif( g == -1 and (c==4 or c==6 or c==8 or c==12) and k_orig ~= 'unifieddyes_') then
|
||||
return nil;
|
||||
-- all other colors of normal dye/wool exist only in normal shade
|
||||
elseif( g == -1 and s~= 3 and k_orig ~= 'unifieddyes_') then
|
||||
|
@ -872,16 +872,16 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
|
|||
if( mod_name == v.modname ) then
|
||||
table.insert( found, k );
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if( #found < 1 ) then
|
||||
return { error_code ="Sorry, this block is not supported by the spray booth.",
|
||||
found_name = "",
|
||||
blocktype = ""};
|
||||
end
|
||||
|
||||
-- another case of special treatment needed; at least the color is given in the tiles
|
||||
if( mod_name =='stained_glass' and stained_glass_exception==1) then
|
||||
|
||||
-- another case of special treatment needed; at least the color is given in the tiles
|
||||
if( mod_name =='stained_glass' and stained_glass_exception==1) then
|
||||
|
||||
local original_node = minetest.registered_items[ bname ];
|
||||
if( original_node ~= nil ) then
|
||||
|
@ -891,7 +891,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
|
|||
end
|
||||
end
|
||||
|
||||
-- this mod does not seperate modname and objectname well enough :-( Naming scheme:- steel_framed_obsidian_glassCOLOR
|
||||
-- this mod does not seperate modname and objectname well enough :-( Naming scheme:- steel_framed_obsidian_glassCOLOR
|
||||
if( mod_name =='framedglass' ) then
|
||||
block_name = string.sub( block_name, 28 );
|
||||
end
|
||||
|
@ -909,13 +909,13 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
|
|||
local bloxdescr = original_node.description;
|
||||
-- bloxparts[1] will be filled with the name of the color:
|
||||
local bloxparts = string.split( bloxdescr, " ");
|
||||
-- now extract the blocktype information
|
||||
-- now extract the blocktype information
|
||||
if( bloxparts ~= nil and #bloxparts > 0 ) then
|
||||
|
||||
-- we split with the color name
|
||||
local found_name = bloxparts[1];
|
||||
local blocktype = 'blox_'..string.sub( block_name, string.len( found_name )+1 )..'_';
|
||||
|
||||
|
||||
-- handle pink and purple
|
||||
if( found_name == 'pink' ) then
|
||||
found_name = 'light_red';
|
||||
|
@ -931,7 +931,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
|
|||
-- if this point is reached, the decoding of the blox-block-name has failed
|
||||
return { error_code = "Error: Failed to decode color of this blox-block.",
|
||||
found_name = "",
|
||||
blocktype = "" };
|
||||
blocktype = "" };
|
||||
|
||||
end
|
||||
|
||||
|
@ -944,9 +944,9 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
|
|||
|
||||
elseif( block_name == 'shutter_mahogany' ) then
|
||||
block_name = 'shutter_dark_orange';
|
||||
|
||||
|
||||
-- this is the default, unpainted one..which can also be considered as "orange" in the menu
|
||||
-- elseif( blockname == 'shutter_oak' ) then
|
||||
-- elseif( blockname == 'shutter_oak' ) then
|
||||
-- block_name = 'shutter_orange';
|
||||
end
|
||||
end
|
||||
|
@ -968,7 +968,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
|
|||
if( colormachine.data[k].obj_postfix ) then
|
||||
|
||||
local l = string.len( colormachine.data[k].obj_postfix);
|
||||
if( string.len( block_name ) > l
|
||||
if( string.len( block_name ) > l
|
||||
and string.sub( block_name, -1*l ) == colormachine.data[k].obj_postfix ) then
|
||||
|
||||
block_name = string.sub( block_name, 1, (-1*l)-1 );
|
||||
|
@ -992,14 +992,14 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
|
|||
liste[ curr_index ] = 'dark';
|
||||
table.insert( liste, 'orange' );
|
||||
curr_index = curr_index + 1;
|
||||
|
||||
|
||||
-- pink <=> light_red
|
||||
elseif( #liste > 0 and liste[ curr_index ]=='pink' ) then
|
||||
liste[ curr_index ] = 'light';
|
||||
table.insert( liste, 'red' );
|
||||
curr_index = curr_index + 1;
|
||||
end
|
||||
|
||||
|
||||
-- find out the saturation - either "s50" or omitted
|
||||
local sat = 0;
|
||||
if( curr_index > 1 and liste[ curr_index ] == "s50" ) then
|
||||
|
@ -1060,7 +1060,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
|
|||
|
||||
-- for blocks that do not follow the naming scheme - the color cannot be decoded
|
||||
if( g==-1 and c==0 ) then
|
||||
return { error_code ="This is a colored block: "..tostring( bname )..".",
|
||||
return { error_code ="This is a colored block: "..tostring( bname )..".",
|
||||
found_name = "",
|
||||
blocktype = ""};
|
||||
end
|
||||
|
@ -1072,7 +1072,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
|
|||
|
||||
for k,v in pairs( colormachine.data ) do
|
||||
-- prefix and postfix have to fit
|
||||
if( curr_index > 0 and add=="" and mod_name == v.modname and (liste[ curr_index ].."_") == v.add
|
||||
if( curr_index > 0 and add=="" and mod_name == v.modname and (liste[ curr_index ].."_") == v.add
|
||||
-- if a postfix exists, we did check for that before and set blocktype accordingly
|
||||
and( not( blocktype ) or blocktype=='' or blocktype==k)) then
|
||||
add = v.add;
|
||||
|
@ -1133,13 +1133,13 @@ colormachine.blocktype_menu = function( meta, new_color, page )
|
|||
local y = 2;
|
||||
|
||||
for i,k in ipairs( colormachine.ordered ) do
|
||||
|
||||
|
||||
-- only installed mods are of intrest
|
||||
if( k ~= nil and colormachine.data[ k ].installed == 1 and i > start_at_offset and i <= (start_at_offset + per_page)) then
|
||||
if( k ~= nil and colormachine.data[ k ].installed == 1 and i > start_at_offset and i <= (start_at_offset + per_page)) then
|
||||
|
||||
-- that particular mod may not offer this color
|
||||
form = form.."button["..tostring(x)..","..tostring(y-0.8).. ";1,1;"..k..";"..colormachine.data[k].descr.."]"..
|
||||
"item_image["..tostring(x)..","..tostring(y )..";1,1;"..colormachine.data[k].block.."]";
|
||||
"item_image["..tostring(x)..","..tostring(y )..";1,1;"..colormachine.data[k].block.."]";
|
||||
|
||||
local button = colormachine.print_color_image( meta, k, new_color, nil, nil, nil, tostring(x), tostring(y+1), 1);-- translated_color as return value for button
|
||||
if( button ~= "" ) then
|
||||
|
@ -1198,7 +1198,7 @@ colormachine.main_menu_formspec = function( pos, option )
|
|||
|
||||
"label[3,0.0;1. Input - Insert material to paint:]"..
|
||||
"list[current_name;input;4.5,0.5;1,1;]"..
|
||||
|
||||
|
||||
"label[9.3,-0.5;Additional storage for dyes:]"..
|
||||
"list[current_name;extrastore;9.3,0;5,9]";
|
||||
|
||||
|
@ -1228,7 +1228,7 @@ colormachine.main_menu_formspec = function( pos, option )
|
|||
if( bname == v.block and colormachine.data[ k ].installed==1) then
|
||||
table.insert( found, k );
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- make sure all output fields are empty
|
||||
for i = 1, inv:get_size( "output" ) do
|
||||
|
@ -1288,13 +1288,13 @@ colormachine.main_menu_formspec = function( pos, option )
|
|||
end
|
||||
-- so that we can determine the factor when taking blocks from the output slots
|
||||
meta:set_string('p_values', minetest.serialize( p_values ));
|
||||
|
||||
|
||||
-- this color was not supported
|
||||
if( anz_found == 0 ) then
|
||||
form = form.."label[2.2,3.0;Block is not available in that color.]";
|
||||
return form;
|
||||
end
|
||||
|
||||
|
||||
form = form.."label[3.0,1.2;2. Select color for any style:]"..
|
||||
"label[3.0,2.9;3. Take output (determines style):]"..
|
||||
"list[current_name;output;"..tostring(out_offset+1)..",3.5;"..tostring( anz_found )..",1;]";
|
||||
|
@ -1308,7 +1308,7 @@ colormachine.main_menu_formspec = function( pos, option )
|
|||
form = form.."label[2.2,3.0;ERROR! Failed to analyze the name of this node: "..tostring(bname).."]";
|
||||
return form;
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- it may be a dye source
|
||||
for i,v in ipairs( colormachine.basic_dye_sources ) do
|
||||
|
@ -1330,7 +1330,7 @@ colormachine.main_menu_formspec = function( pos, option )
|
|||
|
||||
-- the previous analyse was necessary in order to determine which block we ought to use
|
||||
if( option == 'remove_paint' ) then
|
||||
-- actually remove the paint from the
|
||||
-- actually remove the paint from the
|
||||
inv:set_stack( "input", 1, colormachine.data[ found_color_data.blocktype ].block.." "..tostring( anz_blocks ));
|
||||
-- update display (we changed the input!)
|
||||
return colormachine.main_menu_formspec(pos, "analyze");
|
||||
|
@ -1353,7 +1353,7 @@ colormachine.main_menu_formspec = function( pos, option )
|
|||
else
|
||||
form = form.."label[5.5,2.0;This is the selected color.]";
|
||||
end
|
||||
|
||||
|
||||
return form;
|
||||
end
|
||||
|
||||
|
@ -1368,7 +1368,7 @@ colormachine.get_node_name_painted = function( old_node_name, dye_node_name )
|
|||
table.insert( possible_blocks, k );
|
||||
unpainted_block = old_node_name;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if( unpainted_block == "" ) then
|
||||
local parts = string.split(old_node_name,":");
|
||||
|
@ -1399,7 +1399,7 @@ colormachine.get_node_name_painted = function( old_node_name, dye_node_name )
|
|||
table.insert( possible_blocks, k );
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- remove paint
|
||||
if( not( dye_node_name ) or dye_node_name == "") then
|
||||
|
@ -1429,7 +1429,7 @@ colormachine.get_node_name_painted = function( old_node_name, dye_node_name )
|
|||
|
||||
local new_block_name = colormachine.translate_color_name( nil, k, dye_name, cdata.c, cdata.s, cdata.g, 1 );
|
||||
table.insert( found, new_block_name );
|
||||
end
|
||||
end
|
||||
if( #found < 1 ) then
|
||||
return;
|
||||
end
|
||||
|
@ -1468,7 +1468,7 @@ colormachine.allow_inventory_access = function(pos, listname, index, stack, play
|
|||
|
||||
local stack_name = stack:get_name();
|
||||
-- the dyes are a bit special - they accept only powder of the correct name
|
||||
if( listname == "dyes"
|
||||
if( listname == "dyes"
|
||||
and stack_name ~= ("dye:".. colormachine.colors_and_greys[ index ])
|
||||
and stack_name ~= ("unifieddyes:"..colormachine.colors_and_greys[ index ])
|
||||
and (stack_name ~= "dye:light_grey" or colormachine.colors_and_greys[ index ]~="lightgrey" )
|
||||
|
@ -1500,7 +1500,7 @@ end
|
|||
|
||||
|
||||
colormachine.on_metadata_inventory_put = function( pos, listname, index, stack, player )
|
||||
|
||||
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory();
|
||||
|
||||
|
@ -1558,7 +1558,7 @@ end
|
|||
|
||||
|
||||
colormachine.on_metadata_inventory_take = function( pos, listname, index, stack, player )
|
||||
|
||||
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory();
|
||||
|
||||
|
@ -1598,7 +1598,7 @@ colormachine.on_metadata_inventory_take = function( pos, listname, index, stack,
|
|||
else
|
||||
inv:set_stack( "input", 1, inv:get_stack("input",1):get_name().." "..tostring( anz_present ));
|
||||
end
|
||||
|
||||
|
||||
-- the main menu needs to be updated as well
|
||||
meta:set_string( 'formspec', colormachine.main_menu_formspec( pos, "analyze" ));
|
||||
return;
|
||||
|
@ -1637,7 +1637,7 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume )
|
|||
needed[ colormachine.colors[ c ]] = 1;
|
||||
-- handle saturation
|
||||
if( s==1 ) then needed[ "white" ]=1; -- light
|
||||
-- elseif( s==3 ) then -- normal color - no changes needed
|
||||
-- elseif( s==3 ) then -- normal color - no changes needed
|
||||
elseif( s==4 ) then needed[ "white" ]=2; needed[ "black" ] =1; -- normal, low saturation
|
||||
elseif( s==5 ) then needed[ "black" ] =1; -- medium dark
|
||||
elseif( s==6 ) then needed[ "white" ]=1; needed[ "black" ] =1; -- medium dark, low saturation
|
||||
|
@ -1651,7 +1651,7 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume )
|
|||
anz_pigments = anz_pigments + v;
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- n: portions of *mixtures* needed
|
||||
local n = 1;
|
||||
-- if the colors are to be consumed, we need to calculate how many we actually need
|
||||
|
@ -1663,7 +1663,7 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume )
|
|||
-- now we need to check how many pigments of each color we have
|
||||
for i,v in ipairs( colormachine.colors_and_greys ) do
|
||||
|
||||
if( needed[ v ] and needed[ v ]> 0 ) then
|
||||
if( needed[ v ] and needed[ v ]> 0 ) then
|
||||
|
||||
-- find out how many blocks of this type we can actually color
|
||||
local stack = inv:get_stack( "dyes", i );
|
||||
|
@ -1688,8 +1688,8 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume )
|
|||
|
||||
n = math.min( anz_white, need_white );
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- return how many *could* be colored
|
||||
if( amount_needed > 0 and do_consume ~= 1 ) then
|
||||
return n*anz_pigments;
|
||||
|
@ -1700,8 +1700,8 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume )
|
|||
|
||||
for i,v in ipairs( colormachine.colors_and_greys ) do
|
||||
|
||||
if( needed[ v ] and needed[ v ]> 0 ) then
|
||||
|
||||
if( needed[ v ] and needed[ v ]> 0 ) then
|
||||
|
||||
-- show how many pigments of this color are needed for the selected mixture
|
||||
-- normal color
|
||||
if( i <= #colormachine.colors ) then
|
||||
|
@ -1717,9 +1717,9 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume )
|
|||
if( amount_needed > 0 and n > 0 ) then
|
||||
local stack = inv:get_stack( "dyes", i );
|
||||
local found = stack:get_count();
|
||||
--print( ' CONSUMED '..math.floor( n * needed[ v ] )..' of '..tostring( stack:get_name()));
|
||||
--print( ' CONSUMED '..math.floor( n * needed[ v ] )..' of '..tostring( stack:get_name()));
|
||||
if( found > math.floor( n * needed[ v ] )) then
|
||||
inv:set_stack( "dyes", i, stack:get_name()..' '..tostring( math.max( 1, found - math.floor( n * needed[ v ] ))));
|
||||
inv:set_stack( "dyes", i, stack:get_name()..' '..tostring( math.max( 1, found - math.floor( n * needed[ v ] ))));
|
||||
else
|
||||
inv:set_stack( "dyes", i, "" );
|
||||
end
|
||||
|
@ -1730,7 +1730,7 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume )
|
|||
|
||||
-- in case pigments where consumed, return how many blocks where colored successfully
|
||||
if( amount_needed > 0 and n > 0 ) then
|
||||
--print('Successfully colored: '..tostring( n*anz_pigments ));
|
||||
--print('Successfully colored: '..tostring( n*anz_pigments ));
|
||||
return n*anz_pigments;
|
||||
end
|
||||
|
||||
|
@ -1763,9 +1763,9 @@ colormachine.mix_colors = function( inv, i, sender )
|
|||
local stack1 = inv:get_stack( "dyes", mix[1] );
|
||||
local stack2 = inv:get_stack( "dyes", mix[2] );
|
||||
local stack3 = inv:get_stack( "dyes", i );
|
||||
|
||||
|
||||
if( stack3:get_free_space() > 1 -- we need space for two
|
||||
|
||||
if( stack3:get_free_space() > 1 -- we need space for two
|
||||
and stack1:get_count() > 0
|
||||
and stack2:get_count() > 0 ) then
|
||||
|
||||
|
@ -1794,12 +1794,12 @@ colormachine.mix_colors = function( inv, i, sender )
|
|||
|
||||
elseif( stack3:get_free_space() > 1 ) then
|
||||
minetest.chat_send_player( sender:get_player_name(), 'Need '..colormachine.colors_and_greys[ mix[1] ]..' and '..
|
||||
colormachine.colors_and_greys[ mix[2] ]..' in order to mix '..farbe..'.');
|
||||
colormachine.colors_and_greys[ mix[2] ]..' in order to mix '..farbe..'.');
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- this generates the formspec for all supported mods and the general colormachine.dye_management_formspec
|
||||
-- this generates the formspec for all supported mods and the general colormachine.dye_management_formspec
|
||||
colormachine.init = function()
|
||||
local liste = {};
|
||||
-- create formspecs for all machines
|
||||
|
@ -1820,7 +1820,7 @@ colormachine.init = function()
|
|||
end
|
||||
end
|
||||
|
||||
table.sort( liste, function(a,b) return colormachine.data[a].nr < colormachine.data[b].nr end);
|
||||
table.sort( liste, function(a,b) return colormachine.data[a].nr < colormachine.data[b].nr end);
|
||||
colormachine.ordered = liste;
|
||||
|
||||
-- if no flowers are present, take dye sources from default (so we only have to depend on dyes)
|
||||
|
@ -1854,7 +1854,7 @@ colormachine.init = function()
|
|||
|
||||
-- align colors horizontal
|
||||
for i,k in ipairs( colormachine.colors ) do
|
||||
|
||||
|
||||
local prefix = 'dye:';
|
||||
if( i==4 or i==6 or i==8 or i==12 or i==14 ) then
|
||||
if( colormachine.data[ 'unifieddyes_' ].installed == 1 ) then
|
||||
|
@ -1871,15 +1871,15 @@ colormachine.init = function()
|
|||
form = form.."item_image["..tostring(i)..",1;1,1;"..source.."]";
|
||||
|
||||
-- even those colors may be additionally mixed
|
||||
if( #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then
|
||||
if( #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then
|
||||
form = form.. "button["..tostring(i-0.1)..",1.9;0.8,0.2;mix_"..colormachine.colors_and_greys[ i ]..";mix]";
|
||||
end
|
||||
|
||||
-- a color that can be mixed
|
||||
elseif( #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then
|
||||
elseif( #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then
|
||||
|
||||
local mixes = colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ];
|
||||
|
||||
|
||||
local source1 = 'dye:'..colormachine.colors_and_greys[ mixes[1] ];
|
||||
local source2 = 'dye:'..colormachine.colors_and_greys[ mixes[2] ];
|
||||
|
||||
|
@ -1887,7 +1887,7 @@ colormachine.init = function()
|
|||
"item_image["..tostring(i+0.3)..",1.3;1,1;"..source2.."]"..
|
||||
"button["..tostring(i-0.1)..",1.9;0.8,0.2;mix_"..colormachine.colors_and_greys[ i ]..";mix]";
|
||||
end
|
||||
|
||||
|
||||
form = form.. "item_image["..tostring(i)..",2;1,1;"..tostring( prefix..colormachine.colors[ i ] ).."]"..
|
||||
"label["..tostring(i)..",3.6;" ..tostring( colormachine.colors_and_greys[ i ] ).."]";
|
||||
else
|
||||
|
@ -1897,14 +1897,14 @@ colormachine.init = function()
|
|||
|
||||
-- align grey-values vertical
|
||||
for i,k in ipairs( colormachine.grey_names ) do
|
||||
|
||||
|
||||
if( i ~= 2 or colormachine.data[ 'unifieddyes_' ].installed == 1 ) then
|
||||
|
||||
local source = colormachine.basic_dye_sources[ #colormachine.colors + i ];
|
||||
if( source and source ~= "" ) then
|
||||
form = form.."item_image[10,"..tostring(i+4)..";1,1;"..source.."]";
|
||||
|
||||
elseif( #colormachine.dye_mixes[ colormachine.colors_and_greys[ #colormachine.colors + i ] ] == 2 ) then
|
||||
elseif( #colormachine.dye_mixes[ colormachine.colors_and_greys[ #colormachine.colors + i ] ] == 2 ) then
|
||||
|
||||
local mixes = colormachine.dye_mixes[ colormachine.colors_and_greys[ #colormachine.colors + i ] ];
|
||||
|
||||
|
@ -1915,7 +1915,7 @@ colormachine.init = function()
|
|||
"item_image[10.3,"..tostring(i+4.3)..";1,1;"..source2.."]"..
|
||||
"button[9.8," ..tostring(i+4.9)..";0.8,0.2;mix_"..colormachine.colors_and_greys[ #colormachine.colors + i ]..";mix]";
|
||||
end
|
||||
|
||||
|
||||
local dye_name = 'dye:'..k;
|
||||
|
||||
-- lightgrey exists only in unifieddyes
|
||||
|
@ -1930,7 +1930,7 @@ colormachine.init = function()
|
|||
elseif( i==4 ) then
|
||||
dye_name = 'dye:dark_grey';
|
||||
end
|
||||
|
||||
|
||||
if( dye_name ~= "" ) then
|
||||
form = form.. "item_image[11,"..tostring(i+4)..";1,1;"..tostring( dye_name ).."]"..
|
||||
"label[ 12.9,"..tostring(i+4)..";" ..tostring( colormachine.colors_and_greys[ #colormachine.colors + i ] ).."]";
|
||||
|
@ -1939,8 +1939,8 @@ colormachine.init = function()
|
|||
form = form.."label[12.2,"..tostring(i+4)..";n/a]";
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
colormachine.dye_management_formspec = form;
|
||||
|
||||
end
|
||||
|
@ -1957,7 +1957,7 @@ minetest.after( 0, colormachine.init );
|
|||
-- unifiedbricks: clay blocks, brick blocks (skip individual clay lumps and bricks!)
|
||||
-- multicolor: 3 shades, usual amount of colors
|
||||
-- cotton: (by jordach) probably the same as coloredwood
|
||||
--
|
||||
--
|
||||
-- stained_glass: 9 shades/intensities
|
||||
|
||||
|
||||
|
@ -2051,15 +2051,15 @@ minetest.register_node("colormachine:colormachine", {
|
|||
return;
|
||||
elseif( colormachine.data[ k ] ) then
|
||||
-- remember the page we where at
|
||||
meta:set_string( 'formspec', colormachine.data[ k ].formspec..
|
||||
meta:set_string( 'formspec', colormachine.data[ k ].formspec..
|
||||
"field[20,20;0.1,0.1;page;;"..tostring(fields.page).."]" );
|
||||
return;
|
||||
elseif( k=='key_escape') then
|
||||
-- nothing to do
|
||||
else
|
||||
local inv = meta:get_inventory();
|
||||
|
||||
-- perhaps we ought to mix colors
|
||||
|
||||
-- perhaps we ought to mix colors
|
||||
for i,f in ipairs( colormachine.colors_and_greys ) do
|
||||
if( k==("mix_"..f )) then
|
||||
colormachine.mix_colors( inv, i, sender );
|
||||
|
@ -2083,8 +2083,8 @@ minetest.register_node("colormachine:colormachine", {
|
|||
elseif( k=='last_page') then
|
||||
fields.page = math.ceil(#colormachine.ordered/(3*13)-1);
|
||||
end
|
||||
|
||||
meta:set_string( 'formspec', colormachine.blocktype_menu( meta, k, fields.page ));
|
||||
|
||||
meta:set_string( 'formspec', colormachine.blocktype_menu( meta, k, fields.page ));
|
||||
|
||||
else
|
||||
|
||||
|
@ -2102,7 +2102,7 @@ minetest.register_node("colormachine:colormachine", {
|
|||
return 0;
|
||||
end,
|
||||
|
||||
|
||||
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
return colormachine.allow_inventory_access(pos, listname, index, stack, player, "put" );
|
||||
end,
|
||||
|
@ -2131,13 +2131,13 @@ minetest.register_node("colormachine:colormachine", {
|
|||
|
||||
if( not( inv:is_empty("input"))
|
||||
or not( inv:is_empty("refill"))) then
|
||||
minetest.chat_send_player( player:get_player_name(), "Please remove the material in the input- and/or refill slot first!");
|
||||
meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0));
|
||||
minetest.chat_send_player( player:get_player_name(), "Please remove the material in the input- and/or refill slot first!");
|
||||
meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0));
|
||||
return false;
|
||||
end
|
||||
if( not( inv:is_empty("dyes"))) then
|
||||
minetest.chat_send_player( player:get_player_name(), "Please remove the stored dyes first!");
|
||||
meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0 ));
|
||||
minetest.chat_send_player( player:get_player_name(), "Please remove the stored dyes first!");
|
||||
meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0 ));
|
||||
return false;
|
||||
end
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
-- Bracket
|
||||
minetest.register_node("columnia:bracket", {
|
||||
-- Bracket
|
||||
minetest.register_node("columnia:bracket", {
|
||||
description = 'Bracket (Column)',
|
||||
tiles = {"columnia_rusty.png",},
|
||||
drawtype = "nodebox",
|
||||
|
@ -40,7 +40,7 @@ minetest.register_node("columnia:bracket", {
|
|||
groups = {choppy=2, oddly_breakable_by_hand=2,},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'columnia:bracket 4',
|
||||
recipe = {
|
||||
|
@ -70,7 +70,7 @@ minetest.register_node("columnia:lamp_ceiling", {
|
|||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, 0.4375, -0.1875, 0.1875, 0.5, 0.1875},
|
||||
{-0.125, 0.375, -0.125, 0.125, 0.4375, 0.125},
|
||||
{-0.125, 0.375, -0.125, 0.125, 0.4375, 0.125},
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
|
@ -189,7 +189,7 @@ function columnia.register_column_top(subname, recipeitem, groups, images, descr
|
|||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
|
||||
{-0.5, 0.25, -0.5, 0.5, 0.5, 0.5},
|
||||
{-0.5, 0.25, -0.5, 0.5, 0.5, 0.5},
|
||||
{-0.375, 0, -0.375, 0.375, 0.5, 0.375},
|
||||
},
|
||||
},
|
||||
|
@ -545,7 +545,7 @@ columnia.register_column_ia("stone", "default:stone",
|
|||
"Stone Column Link",
|
||||
"Stone Column Linkdown",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
|
||||
columnia.register_column_ia("stonebrick", "default:stonebrick",
|
||||
{cracky=3},
|
||||
{"default_stone_brick.png"},
|
||||
|
@ -566,7 +566,7 @@ columnia.register_column_ia("desert_stonebrick", "default:desert_stonebrick",
|
|||
"Desert Stone Brick Column Crosslink",
|
||||
"Desert Stone Brick Column Link",
|
||||
"Desert Stone Brick Column Linkdown",
|
||||
default.node_sound_stone_defaults())
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
columnia.register_column_ia("desert_stone", "default:desert_stone",
|
||||
{cracky=3},
|
||||
|
@ -577,8 +577,8 @@ columnia.register_column_ia("desert_stone", "default:desert_stone",
|
|||
"Desert Stone Column Crosslink",
|
||||
"Desert Stone Column Link",
|
||||
"Desert Stone Column Linkdown",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
columnia.register_column_ia("cobble", "default:cobble",
|
||||
{cracky=3},
|
||||
{"default_cobble.png"},
|
||||
|
@ -599,8 +599,8 @@ columnia.register_column_ia("brick", "default:brick",
|
|||
"Brick Column Crosslink",
|
||||
"Brick Column Link",
|
||||
"Brick Column Linkdown",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
columnia.register_column_ia("sandstone", "default:sandstone",
|
||||
{crumbly=2,cracky=2},
|
||||
{"default_sandstone.png"},
|
||||
|
@ -611,7 +611,7 @@ columnia.register_column_ia("sandstone", "default:sandstone",
|
|||
"Sandstone Column Link",
|
||||
"Sandstone Column Linkdown",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
|
||||
columnia.register_column_ia("sandstonebrick", "default:sandstonebrick",
|
||||
{crumbly=2,cracky=2},
|
||||
{"default_sandstone_brick.png"},
|
||||
|
@ -622,7 +622,7 @@ columnia.register_column_ia("sandstonebrick", "default:sandstonebrick",
|
|||
"Sandstone Brick Column Link",
|
||||
"Sandstone Brick Column Linkdown",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
|
||||
columnia.register_column_ia("wood", "default:wood",
|
||||
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
{"default_wood.png"},
|
||||
|
|
|
@ -139,7 +139,7 @@ minetest.register_craftitem("compassgps:cgpsmap_marked", {
|
|||
e:setyaw(yaw)
|
||||
local dist=math.abs(pos.x-x)+math.abs(pos.y-y)+math.abs(pos.z-z)
|
||||
if growing_wall_maps == false then
|
||||
e:set_properties({visual_size={x=0.85,y=0.85}})
|
||||
e:set_properties({visual_size={x=0.85,y=0.85}})
|
||||
elseif dist>30000 then
|
||||
e:set_properties({visual_size={x=3.45,y=3.45}})
|
||||
elseif dist>15000 then
|
||||
|
|
|
@ -100,7 +100,7 @@ if minetest.get_modpath("farming") == nil then
|
|||
{"default:dry_shrub","default:dry_shrub"},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "darkage:straw 2",
|
||||
recipe = {
|
||||
|
@ -131,7 +131,7 @@ else
|
|||
{"default:dry_shrub","default:dry_shrub"},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:straw 2",
|
||||
recipe = {
|
||||
|
@ -139,7 +139,7 @@ else
|
|||
{"darkage:dry_leaves","darkage:dry_leaves"},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "darkage:straw_bale",
|
||||
recipe = {
|
||||
|
@ -147,7 +147,7 @@ else
|
|||
{"farming:straw","farming:straw"},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "darkage:adobe 4",
|
||||
recipe = {
|
||||
|
|
|
@ -155,7 +155,7 @@ local function generate_claylike(name, minp, maxp, seed, chance, minh, maxh, dir
|
|||
end
|
||||
if num_water_around >= 3 then
|
||||
is_shallow = false
|
||||
end
|
||||
end
|
||||
if is_shallow then
|
||||
for x1=-divlen,divlen do
|
||||
for z1=-divlen,divlen do
|
||||
|
|
|
@ -7,7 +7,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "marble", "darkage:marble", {
|
||||
description = "Marble",
|
||||
tiles = {"darkage_marble.png"},
|
||||
|
@ -15,7 +15,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "serpentine", "darkage:serpentine", {
|
||||
description = "Serpentine",
|
||||
tiles = {"darkage_serpentine.png"},
|
||||
|
@ -23,7 +23,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "ors", "darkage:ors", {
|
||||
description = "Old Red Sandstone",
|
||||
tiles = {"darkage_ors.png"},
|
||||
|
@ -31,7 +31,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "schist", "darkage:schist", {
|
||||
description = "Schist",
|
||||
tiles = {"darkage_schist.png"},
|
||||
|
@ -39,7 +39,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "slate", "darkage:slate", {
|
||||
description = "Slate",
|
||||
tiles = {"darkage_slate.png"},
|
||||
|
@ -47,7 +47,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "gneiss", "darkage:gneiss", {
|
||||
description = "Gneiss",
|
||||
tiles = {"darkage_gneiss.png"},
|
||||
|
@ -55,7 +55,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "chalk", "darkage:chalk", {
|
||||
description = "Chalk",
|
||||
tiles = {"darkage_chalk.png"},
|
||||
|
@ -63,7 +63,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "slate_cobble", "darkage:slate_cobble", {
|
||||
description = "Slate Cobble",
|
||||
tiles = {"darkage_slate_cobble.png"},
|
||||
|
@ -71,7 +71,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "ors_cobble", "darkage:ors_cobble", {
|
||||
description = "Old Red Sandstone Cobble",
|
||||
tiles = {"darkage_ors_cobble.png"},
|
||||
|
@ -79,7 +79,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "gneiss_cobble", "darkage:gneiss_cobble", {
|
||||
description = "Gneiss Cobble",
|
||||
tiles = {"darkage_gneiss_cobble.png"},
|
||||
|
@ -87,7 +87,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "basalt_cobble", "darkage:basalt_cobble", {
|
||||
description = "Basalt Cobble",
|
||||
tiles = {"darkage_basalt_cobble.png"},
|
||||
|
@ -113,7 +113,7 @@ if stairsplus then
|
|||
sunlight_propagates = true,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "straw_bale", "darkage:straw_bale", {
|
||||
description = "Straw Bale",
|
||||
tiles = {"darkage_straw_bale.png"},
|
||||
|
@ -121,7 +121,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "slate_tile", "darkage:slate_tile", {
|
||||
description = "Slate Tile",
|
||||
tiles = {"darkage_slate_tile.png"},
|
||||
|
@ -129,7 +129,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "marble_tile", "darkage:marble_tile", {
|
||||
description = "Marble Tile",
|
||||
tiles = {"darkage_marble_tile.png"},
|
||||
|
@ -137,7 +137,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "stone_brick", "darkage:stone_brick", {
|
||||
description = "Stone Brick",
|
||||
tiles = {"darkage_stone_brick.png"},
|
||||
|
@ -145,7 +145,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "reinforced_chalk", "darkage:reinforced_chalk", {
|
||||
description = "Reinforced Chalk",
|
||||
tiles = {"darkage_chalk.png^darkage_reinforce.png"},
|
||||
|
@ -153,7 +153,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "glass", "darkage:glass", {
|
||||
description = "Medieval Glass",
|
||||
tiles = {"darkage_glass.png"},
|
||||
|
@ -161,7 +161,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "glow_glass", "darkage:glow_glass", {
|
||||
description = "Medieval Glow Glass",
|
||||
tiles = {"darkage_glass.png"},
|
||||
|
@ -171,7 +171,7 @@ if stairsplus then
|
|||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
|
||||
stairsplus:register_all("darkage", "reinforced_wood", "darkage:reinforced_wood", {
|
||||
description = "Reinforced Wood",
|
||||
tiles = {"default_wood.png^darkage_reinforce.png"},
|
||||
|
@ -189,7 +189,7 @@ elseif stairs then
|
|||
"Basalt Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("marble", "darkage:marble",
|
||||
{cracky=3},
|
||||
{"darkage_marble.png"},
|
||||
|
@ -197,7 +197,7 @@ elseif stairs then
|
|||
"Marble Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("marble", "darkage:serpentine",
|
||||
{cracky=3},
|
||||
{"darkage_serpentine.png"},
|
||||
|
@ -205,7 +205,7 @@ elseif stairs then
|
|||
"Serpentine Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("ors", "darkage:ors",
|
||||
{crumbly=2,cracky=2},
|
||||
{"darkage_ors.png"},
|
||||
|
@ -213,7 +213,7 @@ elseif stairs then
|
|||
"Old Red Sandstone Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("schist", "darkage:schist",
|
||||
{cracky=3},
|
||||
{"darkage_schist.png"},
|
||||
|
@ -221,7 +221,7 @@ elseif stairs then
|
|||
"Schist Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("slate", "darkage:slate",
|
||||
{cracky=2},
|
||||
{"darkage_slate.png"},
|
||||
|
@ -229,7 +229,7 @@ elseif stairs then
|
|||
"Slate Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("gneiss", "darkage:gneiss",
|
||||
{cracky=3},
|
||||
{"darkage_gneiss.png"},
|
||||
|
@ -237,7 +237,7 @@ elseif stairs then
|
|||
"Gneiss Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("chalk", "darkage:chalk",
|
||||
{crumbly=2,cracky=2},
|
||||
{"darkage_chalk.png"},
|
||||
|
@ -245,7 +245,7 @@ elseif stairs then
|
|||
"Chalk Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("slate_cobble", "darkage:slate_cobble",
|
||||
{cracky=2},
|
||||
{"darkage_slate_cobble.png"},
|
||||
|
@ -253,7 +253,7 @@ elseif stairs then
|
|||
"Slate Cobble Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("ors_cobble", "darkage:ors_cobble",
|
||||
{crumbly=2,cracky=2},
|
||||
{"darkage_ors_cobble.png"},
|
||||
|
@ -261,7 +261,7 @@ elseif stairs then
|
|||
"Old Red Sandstone Cobble Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("gneiss_cobble", "darkage:gneiss_cobble",
|
||||
{crumbly=2,cracky=2},
|
||||
{"darkage_gneiss_cobble.png"},
|
||||
|
@ -269,7 +269,7 @@ elseif stairs then
|
|||
"Gneiss Cobble Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("basalt_cobble", "darkage:basalt_cobble",
|
||||
{cracky=3},
|
||||
{"darkage_basalt_cobble.png"},
|
||||
|
@ -302,7 +302,7 @@ elseif stairs then
|
|||
"Straw Bale Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("slate_tile", "darkage:slate_tile",
|
||||
{cracky=2},
|
||||
{"darkage_slate_tile.png"},
|
||||
|
@ -310,7 +310,7 @@ elseif stairs then
|
|||
"Slate Tile Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("marble_tile", "darkage:marble_tile",
|
||||
{cracky=2},
|
||||
{"darkage_marble_tile.png"},
|
||||
|
@ -318,7 +318,7 @@ elseif stairs then
|
|||
"Marble Tile Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("stone_brick", "darkage:stone_brick",
|
||||
{cracky=3},
|
||||
{"darkage_stone_brick.png"},
|
||||
|
@ -326,7 +326,7 @@ elseif stairs then
|
|||
"Stone Brick Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("reinforced_chalk", "darkage:reinforced_chalk",
|
||||
{cracky=3},
|
||||
{"darkage_chalk.png^darkage_reinforce.png"},
|
||||
|
@ -334,7 +334,7 @@ elseif stairs then
|
|||
"Reinforced Chalk Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("glass", "darkage:glass",
|
||||
{snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
{"darkage_glass.png"},
|
||||
|
@ -342,7 +342,7 @@ elseif stairs then
|
|||
"Medieval Glass Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("glow_glass", "darkage:glow_glass",
|
||||
{snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
{"darkage_glass.png"},
|
||||
|
@ -350,7 +350,7 @@ elseif stairs then
|
|||
"Medieval Glow Glass Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("reinforced_wood", "darkage:reinforced_wood",
|
||||
{snappy=2,choppy=3,oddly_breakable_by_hand=3,flammable=3},
|
||||
{"default_wood.png^darkage_reinforce.png"},
|
||||
|
@ -358,5 +358,5 @@ elseif stairs then
|
|||
"Reinforced Wood Slab",
|
||||
default.node_sound_stone_defaults()
|
||||
)
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -115,7 +115,7 @@ if RANDOM_MESSAGES == true then
|
|||
minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player:get_player_name(),"other")})
|
||||
sound_play_all(player:get_player_name())
|
||||
end)
|
||||
|
||||
|
||||
else
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
local player_name = player:get_player_name()
|
||||
|
|
|
@ -42,7 +42,7 @@ minetest.register_on_dieplayer(function(player)
|
|||
|
||||
-- Drop unified_inventory bags and their contents
|
||||
if minetest.get_modpath("unified_inventory") then
|
||||
|
||||
|
||||
local bag_id = {"bag1", "bag2", "bag3", "bag4"}
|
||||
local contents_id = ""
|
||||
local n = 0
|
||||
|
|
|
@ -60,7 +60,7 @@ minetest.register_node("eventobjects:surprise_node", {
|
|||
end
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
|
||||
|
||||
end,
|
||||
on_punch = function(pos, node, puncher, pointed_things)
|
||||
-- Spawn betweek 5 and 20 random nodes
|
||||
|
|
|
@ -31,14 +31,14 @@ function factions_chat.init()
|
|||
give_to_singleplayer = true,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
minetest.register_privilege("faction_admin",
|
||||
{
|
||||
description = "this user is allowed to create or delete factions",
|
||||
give_to_singleplayer = true,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
minetest.register_chatcommand("factions",
|
||||
{
|
||||
params = "<cmd> <parameter 1> .. <parameter n>",
|
||||
|
@ -47,7 +47,7 @@ function factions_chat.init()
|
|||
func = factions_chat.cmdhandler,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
minetest.register_chatcommand("af",
|
||||
{
|
||||
params = "text",
|
||||
|
@ -56,7 +56,7 @@ function factions_chat.init()
|
|||
func = factions_chat.allfactions_chathandler,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
minetest.register_chatcommand("f",
|
||||
{
|
||||
params = "<factionname> text",
|
||||
|
@ -82,13 +82,13 @@ function factions_chat.cmdhandler(playername,parameter)
|
|||
local player = minetest.get_player_by_name(playername)
|
||||
local params = parameter:split(" ")
|
||||
local cmd = params[1]
|
||||
|
||||
|
||||
--handle common commands
|
||||
if parameter == nil or
|
||||
parameter == "" then
|
||||
|
||||
|
||||
local playerfactions = factions.get_factions(player)
|
||||
|
||||
|
||||
local tosend = "Factions: " .. playername .. " factions:"
|
||||
for i,v in ipairs(playerfactions) do
|
||||
if i ~= #playerfactions then
|
||||
|
@ -96,33 +96,33 @@ function factions_chat.cmdhandler(playername,parameter)
|
|||
else
|
||||
tosend = tosend .. " " .. v
|
||||
end
|
||||
end
|
||||
end
|
||||
minetest.chat_send_player(playername, tosend, false)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
--list all known factions
|
||||
if cmd == "list" then
|
||||
local list = factions.get_faction_list()
|
||||
local tosend = "Factions: current available factions:"
|
||||
|
||||
|
||||
for i,v in ipairs(list) do
|
||||
if i ~= #list then
|
||||
tosend = tosend .. " " .. v .. ","
|
||||
else
|
||||
tosend = tosend .. " " .. v
|
||||
end
|
||||
end
|
||||
end
|
||||
minetest.chat_send_player(playername, tosend, false)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
--show factions mod version
|
||||
if cmd == "version" then
|
||||
minetest.chat_send_player(playername, "Factions: version " .. factions_version , false)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
--show description of faction
|
||||
if cmd == "info" then
|
||||
if params[2] ~= nil then
|
||||
|
@ -132,7 +132,7 @@ function factions_chat.cmdhandler(playername,parameter)
|
|||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if cmd == "leave" then
|
||||
if params[2] ~= nil then
|
||||
if params[3] ~= nil then
|
||||
|
@ -141,22 +141,22 @@ function factions_chat.cmdhandler(playername,parameter)
|
|||
if minetest.check_player_privs(playername,{ faction_admin=true }) or
|
||||
factions.is_admin(params[2],playername) and
|
||||
toremove ~= nil then
|
||||
|
||||
|
||||
factions.member_remove(params[2],toremove)
|
||||
minetest.chat_send_player(playername,
|
||||
"Factions: " .. params[3] .. " has been removed from "
|
||||
minetest.chat_send_player(playername,
|
||||
"Factions: " .. params[3] .. " has been removed from "
|
||||
.. params[2], false)
|
||||
return
|
||||
end
|
||||
else
|
||||
factions.member_remove(params[2],player)
|
||||
minetest.chat_send_player(playername,
|
||||
minetest.chat_send_player(playername,
|
||||
"Factions: You have left " .. params[2], false)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--handle superadmin only commands
|
||||
if minetest.check_player_privs(playername,{ faction_admin=true }) then
|
||||
--create new faction
|
||||
|
@ -176,14 +176,14 @@ function factions_chat.cmdhandler(playername,parameter)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if cmd == "join" then
|
||||
if params[2] ~= nil then
|
||||
if params[2] ~= nil then
|
||||
if params[3] ~= nil and
|
||||
minetest.check_player_privs(playername,{ faction_admin=true }) then
|
||||
|
||||
|
||||
local toadd = minetest.get_player_by_name(params[3])
|
||||
|
||||
|
||||
if toadd ~= nil then
|
||||
if factions.member_add(params[2],toadd) then
|
||||
minetest.chat_send_player(playername,
|
||||
|
@ -219,16 +219,16 @@ function factions_chat.cmdhandler(playername,parameter)
|
|||
"Factions: you are not allowed to join " .. params[2],
|
||||
false)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--all following commands require at least two parameters
|
||||
if params[2] ~= nil then
|
||||
if minetest.check_player_privs(playername,{ faction_admin=true }) or
|
||||
factions.is_admin(params[2],playername) then
|
||||
|
||||
|
||||
--delete faction
|
||||
if cmd == "delete" then
|
||||
if factions.delete_faction(params[2]) then
|
||||
|
@ -243,19 +243,19 @@ function factions_chat.cmdhandler(playername,parameter)
|
|||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if cmd == "set_free" then
|
||||
if params[3] ~= nil and
|
||||
(params[3] == "true" or params[3] == "false")then
|
||||
|
||||
|
||||
local value = false
|
||||
if params[3] == "true" then
|
||||
value = true
|
||||
end
|
||||
|
||||
|
||||
if factions.set_free(params[2],value) then
|
||||
minetest.chat_send_player(playername,
|
||||
"Factions: free to join for " .. params[2] ..
|
||||
"Factions: free to join for " .. params[2] ..
|
||||
" has been set to " .. params[3],
|
||||
false)
|
||||
else
|
||||
|
@ -266,20 +266,20 @@ function factions_chat.cmdhandler(playername,parameter)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--set player admin status
|
||||
if cmd == "admin" then
|
||||
if params[3] ~= nil and params[4] ~= nil and
|
||||
(params[4] == "true" or params[4] == "false") then
|
||||
|
||||
|
||||
local value = false
|
||||
if params[4] == "true" then
|
||||
value = true
|
||||
end
|
||||
|
||||
|
||||
if factions.set_admin(params[2],params[3],value) then
|
||||
minetest.chat_send_player(playername,
|
||||
"Factions: adminstate of " .. params[3] ..
|
||||
"Factions: adminstate of " .. params[3] ..
|
||||
" has been set to " .. params[4],
|
||||
false)
|
||||
else
|
||||
|
@ -291,40 +291,40 @@ function factions_chat.cmdhandler(playername,parameter)
|
|||
end
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if cmd == "description" and
|
||||
params[2] ~= nil and
|
||||
params[3] ~= nil then
|
||||
|
||||
|
||||
local desc = params[3]
|
||||
for i=4, #params, 1 do
|
||||
desc = desc .. " " .. params[i]
|
||||
end
|
||||
if factions.set_description(params[2],desc) then
|
||||
minetest.chat_send_player(playername,
|
||||
"Factions: updated description of faction " ..
|
||||
"Factions: updated description of faction " ..
|
||||
params[2],
|
||||
false)
|
||||
return
|
||||
else
|
||||
minetest.chat_send_player(playername,
|
||||
"Factions: FAILED to update description of faction " ..
|
||||
"Factions: FAILED to update description of faction " ..
|
||||
params[2],
|
||||
false)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if cmd == "invite" and
|
||||
params[2] ~= nil and
|
||||
params[3] ~= nil then
|
||||
if factions.member_invite(params[2],params[3]) then
|
||||
minetest.chat_send_player(params[3],
|
||||
"Factions: " .. params[3] ..
|
||||
"Factions: " .. params[3] ..
|
||||
" you have been invited to join faction " .. params[2],
|
||||
false)
|
||||
minetest.chat_send_player(playername,
|
||||
"Factions: " .. params[3] ..
|
||||
"Factions: " .. params[3] ..
|
||||
" has been invited to join faction " .. params[2],
|
||||
false)
|
||||
return
|
||||
|
@ -353,22 +353,22 @@ end
|
|||
--! @param parameter data supplied to command
|
||||
-------------------------------------------------------------------------------
|
||||
function factions_chat.allfactions_chathandler(playername,parameter)
|
||||
|
||||
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
|
||||
|
||||
if player ~= nil then
|
||||
local recipients = {}
|
||||
|
||||
|
||||
for faction,value in pairs(factions.get_factions(player)) do
|
||||
for name,value in pairs(factions.dynamic_data.membertable[faction]) do
|
||||
local object_to_check = minetest.get_player_by_name(name)
|
||||
|
||||
|
||||
if object_to_check ~= nil then
|
||||
recipients[name] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for recipient,value in pairs(recipients) do
|
||||
if recipient ~= playername then
|
||||
minetest.chat_send_player(recipient,playername ..": " .. parameter,false)
|
||||
|
@ -390,26 +390,26 @@ end
|
|||
--! @param parameter data supplied to command
|
||||
-------------------------------------------------------------------------------
|
||||
function factions_chat.chathandler(playername,parameter)
|
||||
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
|
||||
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
|
||||
if player ~= nil then
|
||||
local line = parameter:split(" ")
|
||||
local target_faction = line[1]
|
||||
local line = parameter:split(" ")
|
||||
local target_faction = line[1]
|
||||
|
||||
local text = line[2]
|
||||
for i=3,#line,1 do
|
||||
text = text .. " " .. line[i]
|
||||
end
|
||||
|
||||
|
||||
local valid_faction = false
|
||||
|
||||
|
||||
for faction,value in pairs(factions.get_factions(player)) do
|
||||
if target_faction == faction then
|
||||
valid_faction = true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if faction ~= nil and valid_faction and
|
||||
factions.dynamic_data.membertable[faction] ~= nil then
|
||||
for name,value in pairs(factions.dynamic_data.membertable[faction]) do
|
||||
|
@ -443,7 +443,7 @@ function factions_chat.show_help(playername)
|
|||
local MSG = function(text)
|
||||
minetest.chat_send_player(playername,text,false)
|
||||
end
|
||||
|
||||
|
||||
MSG("Factions mod")
|
||||
MSG("Usage:")
|
||||
MSG("\tUser commands:")
|
||||
|
@ -453,7 +453,7 @@ function factions_chat.show_help(playername)
|
|||
MSG("\t\t/factions leave <factionname> -> leave specified faction")
|
||||
MSG("\t\t/factions join <factionname> -> join specified faction")
|
||||
MSG("\t\t/factions version -> show version number of mod")
|
||||
|
||||
|
||||
MSG("\tAdmin commands:")
|
||||
MSG("\t\t/factions create <factionname> -> create a new faction")
|
||||
MSG("\t\t/factions delete <factionname> -> delete a faction faction")
|
||||
|
|
|
@ -53,11 +53,11 @@ function factions.add_faction(name)
|
|||
factions.data.factions[name].base_reputation = {}
|
||||
factions.data.factions[name].adminlist = {}
|
||||
factions.data.factions[name].invitations = {}
|
||||
|
||||
|
||||
factions.dynamic_data.membertable[name] = {}
|
||||
|
||||
|
||||
factions.save()
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
@ -81,7 +81,7 @@ function factions.set_base_reputation(faction1,faction2,value)
|
|||
|
||||
if factions.data.factions[faction1] ~= nil and
|
||||
factions.data.factions[faction2] ~= nil then
|
||||
|
||||
|
||||
factions.data.factions[faction1].base_reputation[faction2] = value
|
||||
factions.data.factions[faction2].base_reputation[faction1] = value
|
||||
factions.save()
|
||||
|
@ -166,13 +166,13 @@ end
|
|||
--! @return true/false
|
||||
-------------------------------------------------------------------------------
|
||||
function factions.exists(name)
|
||||
|
||||
|
||||
for key,value in pairs(factions.data.factions) do
|
||||
if key == name then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -188,11 +188,11 @@ end
|
|||
function factions.get_faction_list()
|
||||
|
||||
local retval = {}
|
||||
|
||||
|
||||
for key,value in pairs(factions.data.factions) do
|
||||
table.insert(retval,key)
|
||||
end
|
||||
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
|
@ -210,9 +210,9 @@ end
|
|||
function factions.delete_faction(name)
|
||||
|
||||
factions.data.factions[name] = nil
|
||||
|
||||
|
||||
factions.save()
|
||||
|
||||
|
||||
if factions.data.factions[name] == nil then
|
||||
return true
|
||||
end
|
||||
|
@ -235,25 +235,25 @@ end
|
|||
function factions.member_add(name, object)
|
||||
local new_entry = {}
|
||||
new_entry.factions = {}
|
||||
|
||||
|
||||
if object.object ~= nil then
|
||||
object = object.object
|
||||
end
|
||||
|
||||
|
||||
if not factions.exists(name) then
|
||||
print("Unable to add to NON existant faction >" .. name .. "<")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
new_entry.name,new_entry.temporary = factions.get_name(object)
|
||||
|
||||
|
||||
factions.dbg_lvl2("Adding name=" .. dump(new_entry.name) .. " to faction: " .. name )
|
||||
|
||||
|
||||
if new_entry.name ~= nil then
|
||||
if factions.data.objects[new_entry.name] == nil then
|
||||
factions.data.objects[new_entry.name] = new_entry
|
||||
end
|
||||
|
||||
|
||||
if factions.data.objects[new_entry.name].factions[name] == nil then
|
||||
factions.data.objects[new_entry.name].factions[name] = true
|
||||
factions.dynamic_data.membertable[name][new_entry.name] = true
|
||||
|
@ -262,7 +262,7 @@ function factions.member_add(name, object)
|
|||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--return false if no valid object or already member
|
||||
return false
|
||||
end
|
||||
|
@ -287,7 +287,7 @@ function factions.member_invite(name, playername)
|
|||
factions.save()
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
--return false if not a valid faction or player already invited
|
||||
return false
|
||||
end
|
||||
|
@ -307,9 +307,9 @@ end
|
|||
function factions.member_remove(name,object)
|
||||
|
||||
local id,type = factions.get_name(object)
|
||||
|
||||
|
||||
factions.dbg_lvl2("removing name=" .. dump(id) .. " to faction: " .. name )
|
||||
|
||||
|
||||
if id ~= nil and
|
||||
factions.data.objects[id] ~= nil and
|
||||
factions.data.objects[id].factions[name] ~= nil then
|
||||
|
@ -318,7 +318,7 @@ function factions.member_remove(name,object)
|
|||
factions.save()
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
if id ~= nil and
|
||||
factions.data.factions[name].invitations[id] ~= nil then
|
||||
factions.data.factions[name].invitations[id] = nil
|
||||
|
@ -414,7 +414,7 @@ function factions.is_free(name)
|
|||
factions.data.factions[name].open then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -436,7 +436,7 @@ function factions.is_admin(name,playername)
|
|||
factions.data.factions[name].adminlist[playername] == true then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -459,7 +459,7 @@ function factions.is_invited(name,playername)
|
|||
factions.data.factions[name].open == true) then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -477,7 +477,7 @@ end
|
|||
function factions.get_factions(object)
|
||||
|
||||
local id,type = factions.get_name(object)
|
||||
|
||||
|
||||
local retval = {}
|
||||
if id ~= nil and
|
||||
factions.data.objects[id] ~= nil then
|
||||
|
@ -485,7 +485,7 @@ function factions.get_factions(object)
|
|||
table.insert(retval,key)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
|
@ -504,7 +504,7 @@ end
|
|||
function factions.is_member(name,object)
|
||||
|
||||
local retval = false
|
||||
|
||||
|
||||
local id,type = factions.get_name(object)
|
||||
|
||||
if id ~= nil and
|
||||
|
@ -516,7 +516,7 @@ function factions.is_member(name,object)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
|
@ -536,14 +536,14 @@ end
|
|||
function factions.get_reputation(name,object)
|
||||
|
||||
local id,type = factions.get_name(object)
|
||||
|
||||
|
||||
factions.dbg_lvl3("get_reputation: " .. name .. "<-->" .. dump(id))
|
||||
|
||||
|
||||
if id ~= nil and
|
||||
factions.data.factions[name] ~= nil then
|
||||
|
||||
|
||||
factions.dbg_lvl3("get_reputation: object reputation: " .. dump(factions.data.factions[name].reputation[id]))
|
||||
|
||||
|
||||
if factions.data.factions[name].reputation[id] == nil then
|
||||
factions.data.factions[name].reputation[id]
|
||||
= factions.calc_base_reputation(name,object)
|
||||
|
@ -571,21 +571,21 @@ end
|
|||
--! @return true/false
|
||||
-------------------------------------------------------------------------------
|
||||
function factions.modify_reputation(name,object,delta)
|
||||
|
||||
|
||||
local id,type = factions.get_name(object)
|
||||
|
||||
|
||||
if factions.data.factions[name] ~= nil then
|
||||
if factions.data.factions[name].reputation[id] == nil then
|
||||
factions.data.factions[name].reputation[id]
|
||||
= factions.calc_base_reputation(name,object)
|
||||
end
|
||||
|
||||
|
||||
factions.data.factions[name].reputation[id]
|
||||
= factions.data.factions[name].reputation[id] + delta
|
||||
factions.save()
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
@ -604,21 +604,21 @@ function factions.get_name(object)
|
|||
if object == nil then
|
||||
return nil,true
|
||||
end
|
||||
|
||||
|
||||
if object.object ~= nil then
|
||||
object = object.object
|
||||
end
|
||||
|
||||
|
||||
if object:is_player() then
|
||||
return object:get_player_name(),false
|
||||
else
|
||||
local luaentity = object:get_luaentity()
|
||||
|
||||
|
||||
if luaentity ~= nil then
|
||||
return tostring(luaentity),true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return nil,true
|
||||
end
|
||||
|
||||
|
@ -639,9 +639,9 @@ function factions.calc_base_reputation(name,object)
|
|||
--calculate initial reputation based uppon all groups
|
||||
local object_factions = factions.get_factions(object)
|
||||
local rep_value = 0
|
||||
|
||||
|
||||
factions.dbg_lvl3("calc_base_reputation: " .. name .. " <--> " .. tostring(object))
|
||||
|
||||
|
||||
if object_factions ~= nil then
|
||||
factions.dbg_lvl3("calc_base_reputation: " .. tostring(object) .. " is in " .. #object_factions .. " factions")
|
||||
for k,v in pairs(object_factions) do
|
||||
|
@ -655,10 +655,10 @@ function factions.calc_base_reputation(name,object)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
rep_value = rep_value / #object_factions
|
||||
end
|
||||
|
||||
|
||||
return rep_value
|
||||
end
|
||||
|
||||
|
@ -675,16 +675,16 @@ function factions.save()
|
|||
--due to figuring out which data to save and which is temporary only
|
||||
--all data is saved here
|
||||
--this implies data needs to be cleant up on load
|
||||
|
||||
|
||||
local file,error = io.open(factions_worldid .. "/" .. "factions.conf","w")
|
||||
|
||||
|
||||
if file ~= nil then
|
||||
file:write(minetest.serialize(factions.data))
|
||||
file:close()
|
||||
else
|
||||
minetest.log("error","MOD factions: unable to save factions world specific data!: " .. error)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
@ -698,23 +698,23 @@ end
|
|||
-------------------------------------------------------------------------------
|
||||
function factions.load()
|
||||
local file,error = io.open(factions_worldid .. "/" .. "factions.conf","r")
|
||||
|
||||
|
||||
if file ~= nil then
|
||||
local raw_data = file:read("*a")
|
||||
file:close()
|
||||
|
||||
|
||||
if raw_data ~= nil and
|
||||
raw_data ~= "" then
|
||||
|
||||
|
||||
local raw_table = minetest.deserialize(raw_data)
|
||||
|
||||
|
||||
|
||||
|
||||
--read object data
|
||||
local temp_objects = {}
|
||||
|
||||
|
||||
if raw_table.objects ~= nil then
|
||||
for key,value in pairs(raw_table.objects) do
|
||||
|
||||
|
||||
if value.temporary == false then
|
||||
factions.data.objects[key] = value
|
||||
else
|
||||
|
@ -722,7 +722,7 @@ function factions.load()
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if raw_table.factions ~= nil then
|
||||
for key,value in pairs(raw_table.factions) do
|
||||
factions.data.factions[key] = {}
|
||||
|
@ -730,18 +730,18 @@ function factions.load()
|
|||
factions.data.factions[key].adminlist = value.adminlist
|
||||
factions.data.factions[key].open = value.open
|
||||
factions.data.factions[key].invitations = value.invitations
|
||||
|
||||
|
||||
factions.data.factions[key].reputation = {}
|
||||
for repkey,repvalue in pairs(value.reputation) do
|
||||
if temp_objects[repkey] == nil then
|
||||
factions.data.factions[key].reputation[repkey] = repvalue
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
factions.dynamic_data.membertable[key] = {}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--populate dynamic faction member table
|
||||
for id,object in pairs(factions.data.objects) do
|
||||
for name,value in pairs(factions.data.objects[id].factions) do
|
||||
|
@ -753,7 +753,7 @@ function factions.load()
|
|||
end
|
||||
else
|
||||
local file,error = io.open(factions_worldid .. "/" .. "factions.conf","w")
|
||||
|
||||
|
||||
if file ~= nil then
|
||||
file:close()
|
||||
else
|
||||
|
|
|
@ -24,7 +24,7 @@ end
|
|||
minetest.log("action","[FailPoints] CooKies baked")
|
||||
|
||||
-- Global callbacks
|
||||
minetest.register_on_shutdown(function()
|
||||
minetest.register_on_shutdown(function()
|
||||
-- Stocking CooKies
|
||||
pntf = io.open(data.oven,"w")
|
||||
for i,v in pairs(data.cookies) do
|
||||
|
@ -48,20 +48,20 @@ minetest.register_chatcommand("cookie", {
|
|||
minetest.chat_send_player(name,"/cookie <subcommand> | <playername>")
|
||||
minetest.chat_send_player(name,"Available subcommands :")
|
||||
minetest.chat_send_player(name," - help : show this help")
|
||||
minetest.chat_send_player(name," - view | view <playername> : View player's CooKies amount")
|
||||
minetest.chat_send_player(name," - view | view <playername> : View player's CooKies amount")
|
||||
return
|
||||
elseif param == "settings" then
|
||||
if not minetest.get_player_privs(name)["server"] then
|
||||
minetest.chat_send_player(name,"You're not allowed to perform this command. (Missing privilege : server)")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
minetest.chat_send_player(name,"=== CK_DEBUG_LINES SENT ===")
|
||||
print("=== CK_DEBUG_LINES ===")
|
||||
local send_admin = function(msg)
|
||||
minetest.chat_send_player(name,msg)
|
||||
end
|
||||
|
||||
|
||||
send_admin("CK File")
|
||||
if pntf ~= nil then
|
||||
send_admin("Found")
|
||||
|
@ -69,7 +69,7 @@ minetest.register_chatcommand("cookie", {
|
|||
send_admin("Missing!")
|
||||
end
|
||||
table.foreach(data,print)
|
||||
|
||||
|
||||
return
|
||||
elseif param == "view" then
|
||||
if param2 == "" or param2 == nil then
|
||||
|
@ -80,14 +80,14 @@ minetest.register_chatcommand("cookie", {
|
|||
minetest.chat_send_player(name,"-CK- You own "..owncookies.." CooKies.")
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
if data.cookies[param2] ~= nil and data.cookies[param2] > 0 then
|
||||
minetest.chat_send_player(name,"-CK- Player "..param2.." owns "..data.cookies[param2].." CooKies.")
|
||||
else
|
||||
minetest.chat_send_player(name,"-CK- Player "..param2.." doesn't seem to own any CooKie.")
|
||||
end
|
||||
else
|
||||
|
||||
|
||||
-- If not any known command
|
||||
if name == param then
|
||||
if minetest.get_player_privs(name)["baker"] == true then
|
||||
|
@ -100,7 +100,7 @@ minetest.register_chatcommand("cookie", {
|
|||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
if param == "" then
|
||||
minetest.chat_send_player(name,"-CK- You failed: Not enough parameters given, type /cookie help for help")
|
||||
return false
|
||||
|
@ -110,7 +110,7 @@ minetest.register_chatcommand("cookie", {
|
|||
minetest.chat_send_player(name,"-CK- You failed: Sorry, "..param.." isn't online.")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
-- Take, or not, cookies from name's account to give them to param
|
||||
if minetest.get_player_privs(name)["baker"] ~= true then
|
||||
if data.cookies[name] == nil or data.failpoints[name] == 0 then
|
||||
|
@ -122,14 +122,14 @@ minetest.register_chatcommand("cookie", {
|
|||
else
|
||||
minetest.log("action","[FailPoints] "..name.." has baked a CooKie.")
|
||||
end
|
||||
|
||||
|
||||
-- Give/Add the CooKie to param' account
|
||||
if data.cookies[param] == nil then
|
||||
data.cookies[param] = 1
|
||||
else
|
||||
data.cookies[param] = data.cookies[param]+1
|
||||
end
|
||||
|
||||
|
||||
minetest.log("action","[FailPoints] "..name.." has given a CooKie to "..param)
|
||||
minetest.log("action","[FailPoints] "..param.." now own "..data.cookies[param].."CKs")
|
||||
minetest.log("action","[FailPoints] "..name.." now own "..(data.cookies[name] or 0).."CKs")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
-- Fails mod By Mg <mg[dot]minetest[at]gmail[dot]com>
|
||||
--[[
|
||||
|
||||
|
||||
/-----\-\
|
||||
/ /--] \-\
|
||||
| |-] |-|
|
||||
|
@ -48,7 +48,7 @@ end
|
|||
data.is_player_available = minetest.get_player_by_name
|
||||
|
||||
if data.STRICT_PLAYER_CHECK == false then
|
||||
|
||||
|
||||
data.is_player_available = function (name)
|
||||
return (io.open(minetest.get_worldpath().."/players/"..name) ~= nil)
|
||||
end
|
||||
|
@ -68,7 +68,7 @@ end
|
|||
minetest.log("action","[FailPoints] Loaded")
|
||||
|
||||
-- Global callbacks
|
||||
minetest.register_on_shutdown(function()
|
||||
minetest.register_on_shutdown(function()
|
||||
-- Saving failpoints
|
||||
pntf = io.open(data.fp_file,"w")
|
||||
for i,v in pairs(data.failpoints) do
|
||||
|
@ -96,20 +96,20 @@ minetest.register_chatcommand("fail", {
|
|||
minetest.chat_send_player(name,"Available subcommands :")
|
||||
minetest.chat_send_player(name," - help : show this help")
|
||||
minetest.chat_send_player(name," - version : show actual fail version")
|
||||
minetest.chat_send_player(name," - view | view <playername> : View player's failpoints amount")
|
||||
minetest.chat_send_player(name," - view | view <playername> : View player's failpoints amount")
|
||||
return
|
||||
elseif param == "settings" then
|
||||
if not minetest.get_player_privs(name)["server"] then
|
||||
minetest.chat_send_player(name,"You're not allowed to perform this command. (Missing privilege : server)")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
minetest.chat_send_player(name,"=== FP_DEBUG_LINES SENT ===")
|
||||
print("=== FP_DEBUG_LINES ===")
|
||||
local send_admin = function(msg)
|
||||
minetest.chat_send_player(name,msg)
|
||||
end
|
||||
|
||||
|
||||
send_admin("FP File")
|
||||
if pntf ~= nil then
|
||||
send_admin("Found")
|
||||
|
@ -117,7 +117,7 @@ minetest.register_chatcommand("fail", {
|
|||
send_admin("Missing!")
|
||||
end
|
||||
table.foreach(data,print)
|
||||
|
||||
|
||||
return
|
||||
elseif param == "view" then
|
||||
if param2 == "" or param2 == nil then
|
||||
|
@ -128,14 +128,14 @@ minetest.register_chatcommand("fail", {
|
|||
minetest.chat_send_player(name,"-FP- You own "..ownfail.." FailPoints.")
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
if data.failpoints[param2] ~= nil and data.failpoints[param2] > 0 then
|
||||
minetest.chat_send_player(name,"-FP- Player "..param2.." owns "..data.failpoints[param2].." FailPoints.")
|
||||
else
|
||||
minetest.chat_send_player(name,"-FP- Player "..param2.." doesn't seem to own any FailPoint.")
|
||||
end
|
||||
else
|
||||
|
||||
|
||||
-- If not any known command
|
||||
if name == param then
|
||||
if minetest.get_player_privs(name)["fp_create"] == true then
|
||||
|
@ -148,7 +148,7 @@ minetest.register_chatcommand("fail", {
|
|||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
if param == "" then
|
||||
minetest.chat_send_player(name,"-FP- You failed: Not enough parameters given, type /fail help for help")
|
||||
return false
|
||||
|
@ -158,7 +158,7 @@ minetest.register_chatcommand("fail", {
|
|||
minetest.chat_send_player(name,"-FP- You failed: Sorry, "..param.." isn't online.")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
-- Take, or not, failpoints from name's account to give them to param
|
||||
if minetest.get_player_privs(name)["fp_create"] ~= true then
|
||||
if data.failpoints[name] == nil or data.failpoints[name] == 0 then
|
||||
|
@ -170,14 +170,14 @@ minetest.register_chatcommand("fail", {
|
|||
else
|
||||
minetest.log("action","[FailPoints] "..name.." has created a FailPoint.")
|
||||
end
|
||||
|
||||
|
||||
-- Give/Add the failpoint to param' account
|
||||
if data.failpoints[param] == nil then
|
||||
data.failpoints[param] = 1
|
||||
else
|
||||
data.failpoints[param] = data.failpoints[param]+1
|
||||
end
|
||||
|
||||
|
||||
minetest.log("action","[FailPoints] "..name.." has given a failpoint to "..param)
|
||||
minetest.log("action","[FailPoints] "..param.." now own "..data.failpoints[param].."FPs")
|
||||
minetest.log("action","[FailPoints] "..name.." now own "..(data.failpoints[name] or 0).."FPs")
|
||||
|
|
|
@ -8,9 +8,9 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname)
|
|||
if not pt and pt.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local under = minetest.get_node(pt.under)
|
||||
|
||||
|
||||
-- return if any of the nodes is not registered
|
||||
if not minetest.registered_nodes[under.name] then
|
||||
return
|
||||
|
@ -20,7 +20,7 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname)
|
|||
if under.name ~= "default:jungletree" then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- add the node and remove 1 item from the itemstack
|
||||
minetest.add_node(pt.above, {name=plantname})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
|
@ -144,7 +144,7 @@ minetest.register_abm({
|
|||
elseif dir == 4 then pos.z = pos.z -1
|
||||
else return
|
||||
end
|
||||
|
||||
|
||||
if minetest.get_node(pos).name == "air" and minetest.get_node_light(pos) > 12 then
|
||||
-- print ("COCOA", pos.x, pos.y, pos.z)
|
||||
minetest.set_node(pos,{name="farming:cocoa_"..tostring(math.random(1,3))})
|
||||
|
|
|
@ -28,7 +28,7 @@ minetest.register_craft({
|
|||
|
||||
--= Ethanol (Thanks to JKMurray for this idea)
|
||||
|
||||
minetest.register_craftitem("farming:bottle_ethanol", {
|
||||
minetest.register_craftitem("farming:bottle_ethanol", {
|
||||
description = "Bottle of Ethanol",
|
||||
inventory_image = "farming_bottle_ethanol.png",
|
||||
})
|
||||
|
|
|
@ -66,7 +66,7 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
|
|||
if not pt or pt.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local under = minetest.get_node(pt.under)
|
||||
local upos = pointed_thing.under
|
||||
|
||||
|
@ -77,23 +77,23 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
|
|||
|
||||
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
|
||||
local above = minetest.get_node(p)
|
||||
|
||||
|
||||
-- return if any of the nodes is not registered
|
||||
if not minetest.registered_nodes[under.name]
|
||||
or not minetest.registered_nodes[above.name] then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- check if the node above the pointed thing is air
|
||||
if above.name ~= "air" then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- check if pointing at dirt
|
||||
if minetest.get_item_group(under.name, "soil") ~= 1 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- turn the node into soil, wear out item and play sound
|
||||
minetest.set_node(pt.under, {name="farming:soil"})
|
||||
minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5,})
|
||||
|
|
|
@ -404,7 +404,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
|
|||
|
||||
-- can I replace above node, and am I pointing at soil
|
||||
if not minetest.registered_nodes[above.name].buildable_to
|
||||
or minetest.get_item_group(under.name, "soil") < 2
|
||||
or minetest.get_item_group(under.name, "soil") < 2
|
||||
or minetest.get_item_group(above.name, "plant") ~= 0 then -- ADDED this line for multiple seed placement bug
|
||||
return
|
||||
end
|
||||
|
@ -471,7 +471,7 @@ farming.register_plant = function(name, def)
|
|||
{items = {mname .. ":seed_" .. pname}, rarity = 18 - i * 2},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
local g = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, growing = 1}
|
||||
-- Last step doesn't need growing=1 so Abm never has to check these
|
||||
if i == def.steps then
|
||||
|
|
|
@ -48,15 +48,15 @@ local function find_dock(pos, second)
|
|||
local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2}
|
||||
if second > 0 then
|
||||
local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2}
|
||||
minetest.set_node(pos, tmp_node)
|
||||
minetest.set_node(pos, tmp_node)
|
||||
end
|
||||
elseif code == 0 then
|
||||
if second == 2 then
|
||||
local tmp_node = {name="fences:fence_wood", param1=me.param1, param2=me.param2}
|
||||
minetest.set_node(pos, tmp_node)
|
||||
minetest.set_node(pos, tmp_node)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
local function punch(pos, puncher)
|
||||
|
@ -576,7 +576,7 @@ minetest.register_craft({
|
|||
local meta2
|
||||
local state2 = 0
|
||||
|
||||
local function update_gate(pos, node)
|
||||
local function update_gate(pos, node)
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
|
||||
|
|
|
@ -39,17 +39,17 @@ minetest.register_alias("flowers_plus:seaweed", "flowers:seaweed") -- exception
|
|||
|
||||
local PLaNTS = {
|
||||
-- MoD* iTeM MeSSaGe ("You caught "..)
|
||||
{"flowers", "waterlily", "a Waterlily." },
|
||||
{"flowers", "waterlily_225", "a Waterlily." },
|
||||
{"flowers", "waterlily_45", "a Waterlily." },
|
||||
{"flowers", "waterlily_675", "a Waterlily." },
|
||||
{"flowers", "waterlily_s1", "a Waterlily." },
|
||||
{"flowers", "waterlily_s2", "a Waterlily." },
|
||||
{"flowers", "waterlily_s3", "a Waterlily." },
|
||||
{"flowers", "waterlily", "a Waterlily." },
|
||||
{"flowers", "waterlily_225", "a Waterlily." },
|
||||
{"flowers", "waterlily_45", "a Waterlily." },
|
||||
{"flowers", "waterlily_675", "a Waterlily." },
|
||||
{"flowers", "waterlily_s1", "a Waterlily." },
|
||||
{"flowers", "waterlily_s2", "a Waterlily." },
|
||||
{"flowers", "waterlily_s3", "a Waterlily." },
|
||||
{"flowers", "waterlily_s4", "a Waterlily." },
|
||||
{"flowers", "seaweed", "some Seaweed."},
|
||||
{"flowers", "seaweed_2", "some Seaweed."},
|
||||
{"flowers", "seaweed_3", "some Seaweed."},
|
||||
{"flowers", "seaweed", "some Seaweed."},
|
||||
{"flowers", "seaweed_2", "some Seaweed."},
|
||||
{"flowers", "seaweed_3", "some Seaweed."},
|
||||
{"flowers", "seaweed_4", "some Seaweed."},
|
||||
{"trunks", "twig_1", "a Twig." },
|
||||
{"trunks", "twig_2", "a Twig." },
|
||||
|
@ -89,7 +89,7 @@ minetest.register_node("fishing:bobber_box", {
|
|||
"fishing_bobber.png",
|
||||
"fishing_bobber.png",
|
||||
"fishing_bobber.png^[transformFX"
|
||||
}, --
|
||||
}, --
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
|
@ -123,7 +123,7 @@ local FISHING_BOBBER_ENTITY={
|
|||
})
|
||||
self.object:remove()
|
||||
end,
|
||||
-- WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE)
|
||||
-- WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE)
|
||||
on_rightclick = function (self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
local player = clicker:get_player_name()
|
||||
|
@ -141,7 +141,7 @@ local FISHING_BOBBER_ENTITY={
|
|||
minetest.add_node({x=pos.x, y=pos.y, z=pos.z}, {name="air"})
|
||||
if inv:room_for_item("main", {name=DRoP, count=1, wear=0, metadata=""}) then
|
||||
inv:add_item("main", {name=DRoP, count=1, wear=0, metadata=""})
|
||||
if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught Plant
|
||||
if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught Plant
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if inv:room_for_item("main", {name="fishing:bait_worm", count=1, wear=0, metadata=""}) then
|
||||
|
@ -176,13 +176,13 @@ local FISHING_BOBBER_ENTITY={
|
|||
iTeM = "fish_blue_white"
|
||||
WeaR = 0
|
||||
MeSSaGe = S("a Blue white fish.")
|
||||
obj:remove()
|
||||
obj:remove()
|
||||
end
|
||||
end
|
||||
-- add (in)visible fish to inventory
|
||||
if inv:room_for_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""}) then
|
||||
inv:add_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""})
|
||||
if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught somethin'
|
||||
if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught somethin'
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if GeTBaiTBack == true then
|
||||
|
@ -211,12 +211,12 @@ local FISHING_BOBBER_ENTITY={
|
|||
if inv:room_for_item("main", {name="fishing:bait_worm", count=1, wear=0, metadata=""}) then
|
||||
inv:add_item("main", {name="fishing:bait_worm", count=1, wear=0, metadata=""})
|
||||
if MESSAGES == true then say(player, S("The bait is still there."), false) end -- bait still there
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- weither player has fishing pole or not
|
||||
-- make sound and remove bobber
|
||||
minetest.sound_play("fishing_bobber1", {
|
||||
|
@ -240,7 +240,7 @@ local FISHING_BOBBER_ENTITY={
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if math.random(1, 4) == 1 then
|
||||
self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/2880*math.pi))
|
||||
end
|
||||
|
@ -259,9 +259,9 @@ local FISHING_BOBBER_ENTITY={
|
|||
minetest.sound_play("fishing_bobber1", {pos = self.object:getpos(),gain = 0.5,})
|
||||
self.object:remove()
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if self.object:get_hp() > 310 then
|
||||
local find_fish = minetest.get_objects_inside_radius({x=pos.x,y=pos.y+0.5,z=pos.z}, 1)
|
||||
for k, obj in pairs(find_fish) do
|
||||
|
@ -274,8 +274,8 @@ local FISHING_BOBBER_ENTITY={
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
local do_env_damage = function(self)
|
||||
self.object:set_hp(self.object:get_hp()-self.water_damage)
|
||||
if self.object:get_hp() == 600 then
|
||||
|
@ -306,7 +306,7 @@ local FISHING_BOBBER_ENTITY={
|
|||
self.object:moveto({x=pos.x,y=pos.y+0.0625,z=pos.z})
|
||||
elseif self.object:get_hp() == 285 then
|
||||
self.object:moveto({x=pos.x,y=pos.y-0.1,z=pos.z})
|
||||
elseif self.object:get_hp() < 284 then
|
||||
elseif self.object:get_hp() < 284 then
|
||||
self.object:moveto({x=pos.x+(0.001*(math.random(-8, 8))),y=pos.y,z=pos.z+(0.001*(math.random(-8, 8)))})
|
||||
self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/1440*math.pi))
|
||||
elseif self.object:get_hp() == 0 then
|
||||
|
|
|
@ -34,17 +34,17 @@ local CaTCH_BiG = {
|
|||
|
||||
local PLaNTS = {
|
||||
-- MoD* iTeM MeSSaGe ("You caught "..)
|
||||
{"flowers", "waterlily", "a Waterlily." },
|
||||
{"flowers", "waterlily_225", "a Waterlily." },
|
||||
{"flowers", "waterlily_45", "a Waterlily." },
|
||||
{"flowers", "waterlily_675", "a Waterlily." },
|
||||
{"flowers", "waterlily_s1", "a Waterlily." },
|
||||
{"flowers", "waterlily_s2", "a Waterlily." },
|
||||
{"flowers", "waterlily_s3", "a Waterlily." },
|
||||
{"flowers", "waterlily", "a Waterlily." },
|
||||
{"flowers", "waterlily_225", "a Waterlily." },
|
||||
{"flowers", "waterlily_45", "a Waterlily." },
|
||||
{"flowers", "waterlily_675", "a Waterlily." },
|
||||
{"flowers", "waterlily_s1", "a Waterlily." },
|
||||
{"flowers", "waterlily_s2", "a Waterlily." },
|
||||
{"flowers", "waterlily_s3", "a Waterlily." },
|
||||
{"flowers", "waterlily_s4", "a Waterlily." },
|
||||
{"flowers", "seaweed", "some Seaweed."},
|
||||
{"flowers", "seaweed_2", "some Seaweed."},
|
||||
{"flowers", "seaweed_3", "some Seaweed."},
|
||||
{"flowers", "seaweed", "some Seaweed."},
|
||||
{"flowers", "seaweed_2", "some Seaweed."},
|
||||
{"flowers", "seaweed_3", "some Seaweed."},
|
||||
{"flowers", "seaweed_4", "some Seaweed."},
|
||||
{"trunks", "twig_1", "a Twig." },
|
||||
{"trunks", "twig_2", "a Twig." },
|
||||
|
@ -83,7 +83,7 @@ local FISHING_BOBBER_ENTITY_SHARK={
|
|||
})
|
||||
self.object:remove()
|
||||
end,
|
||||
-- WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE)
|
||||
-- WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE)
|
||||
on_rightclick = function (self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
local player = clicker:get_player_name()
|
||||
|
@ -101,7 +101,7 @@ local FISHING_BOBBER_ENTITY_SHARK={
|
|||
minetest.add_node({x=pos.x, y=pos.y, z=pos.z}, {name="air"})
|
||||
if inv:room_for_item("main", {name=DRoP, count=1, wear=0, metadata=""}) then
|
||||
inv:add_item("main", {name=DRoP, count=1, wear=0, metadata=""})
|
||||
if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught Plant
|
||||
if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught Plant
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if inv:room_for_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""}) then
|
||||
|
@ -129,7 +129,7 @@ local FISHING_BOBBER_ENTITY_SHARK={
|
|||
if minetest.get_modpath(MoD) ~= nil then
|
||||
if inv:room_for_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""}) then
|
||||
inv:add_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""})
|
||||
if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught somethin'
|
||||
if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught somethin'
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if GeTBaiTBack == true then
|
||||
|
@ -146,20 +146,20 @@ local FISHING_BOBBER_ENTITY_SHARK={
|
|||
if MESSAGES == true then say(player, S("Your fish escaped."), false) end -- fish escaped
|
||||
end
|
||||
end
|
||||
if self.object:get_hp() > 300 and minetest.get_node(pos).name == "air" then
|
||||
if self.object:get_hp() > 300 and minetest.get_node(pos).name == "air" then
|
||||
if MESSAGES == true then say(player, S("You didn't catch any fish."), false) end -- fish escaped
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if math.random(1, 3) == 1 then
|
||||
if inv:room_for_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""}) then
|
||||
inv:add_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""})
|
||||
if MESSAGES == true then say(player, S("The bait is still there."), false) end -- bait still there
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--end
|
||||
else
|
||||
if MESSAGES == true then say(player, S("Your fish escaped."), false) end -- fish escaped
|
||||
else
|
||||
if MESSAGES == true then say(player, S("Your fish escaped."), false) end -- fish escaped
|
||||
end
|
||||
minetest.sound_play("fishing_bobber1", {
|
||||
pos = self.object:getpos(),
|
||||
|
@ -230,7 +230,7 @@ local FISHING_BOBBER_ENTITY_SHARK={
|
|||
self.object:moveto({x=pos.x,y=pos.y+0.0625,z=pos.z})
|
||||
elseif self.object:get_hp() == 285 then
|
||||
self.object:moveto({x=pos.x,y=pos.y-0.0625,z=pos.z})
|
||||
elseif self.object:get_hp() < 284 then
|
||||
elseif self.object:get_hp() < 284 then
|
||||
self.object:moveto({x=pos.x+(0.001*(math.random(-8, 8))),y=pos.y,z=pos.z+(0.001*(math.random(-8, 8)))})
|
||||
self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/720*math.pi))
|
||||
elseif self.object:get_hp() == 0 then
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
-- Wooden Fishing Pole
|
||||
minetest.register_craft({
|
||||
output = "fishing:pole",
|
||||
recipe = {
|
||||
recipe = {
|
||||
{"", "", "group:stick" },
|
||||
{"", "group:stick", "farming:string"},
|
||||
{"group:stick", "", "farming:string"},
|
||||
|
@ -24,7 +24,7 @@ minetest.register_craft({
|
|||
if minetest.get_modpath("moreblocks") ~= nil then
|
||||
minetest.register_craft({
|
||||
output = "fishing:pole",
|
||||
recipe = {
|
||||
recipe = {
|
||||
{"", "", "group:stick" },
|
||||
{"", "group:stick", "moreblocks:rope" },
|
||||
{"group:stick", "", "moreblocks:rope" },
|
||||
|
@ -35,7 +35,7 @@ end
|
|||
if minetest.get_modpath("ropes") ~= nil then
|
||||
minetest.register_craft({
|
||||
output = "fishing:pole",
|
||||
recipe = {
|
||||
recipe = {
|
||||
{"", "", "group:stick" },
|
||||
{"", "group:stick", "ropes:rope" },
|
||||
{"group:stick", "", "ropes:rope" },
|
||||
|
@ -47,7 +47,7 @@ end
|
|||
if minetest.get_modpath("moreores") ~= nil then
|
||||
minetest.register_craft({
|
||||
output = "fishing:pole_perfect",
|
||||
recipe = {
|
||||
recipe = {
|
||||
{"", "", "moreores:mithril_ingot" },
|
||||
{"", "moreores:mithril_ingot", "mobs:spider_cobweb" },
|
||||
{"moreores:mithril_ingot", "", "mobs:spider_cobweb" },
|
||||
|
@ -86,7 +86,7 @@ minetest.register_craft({
|
|||
type = "shapeless",
|
||||
output = "fishing:sushi",
|
||||
recipe = {"fishing:fish_raw", "farming:seed_wheat", "seaplants:kelpgreen" },
|
||||
|
||||
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -58,7 +58,7 @@ minetest.register_craftitem("fishing:shark", {
|
|||
inventory_image = "fishing_shark_cooked.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
})
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Pike
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -77,10 +77,10 @@ minetest.register_tool("fishing:pole", {
|
|||
gain = 0.5,
|
||||
})
|
||||
minetest.add_entity({interval = 1,x=pt.under.x, y=pt.under.y+(45/64), z=pt.under.z}, "fishing:bobber_entity")
|
||||
|
||||
if WEAR_OUT == true
|
||||
|
||||
if WEAR_OUT == true
|
||||
and not minetest.setting_getbool("creative_mode") then
|
||||
return rod_wear(itemstack, user, pointed_thing, 30)
|
||||
return rod_wear(itemstack, user, pointed_thing, 30)
|
||||
else
|
||||
return {name="fishing:pole", count=1, wear=0, metadata=""}
|
||||
end
|
||||
|
@ -94,10 +94,10 @@ minetest.register_tool("fishing:pole", {
|
|||
gain = 0.5,
|
||||
})
|
||||
minetest.add_entity({interval = 1,x=pt.under.x, y=pt.under.y+(45/64), z=pt.under.z}, "fishing:bobber_entity_shark")
|
||||
|
||||
if WEAR_OUT == true
|
||||
|
||||
if WEAR_OUT == true
|
||||
and not minetest.setting_getbool("creative_mode") then
|
||||
return rod_wear(itemstack, user, pointed_thing, 30)
|
||||
return rod_wear(itemstack, user, pointed_thing, 30)
|
||||
else
|
||||
return {name="fishing:pole", count=1, wear=0, metadata=""}
|
||||
end
|
||||
|
@ -150,10 +150,10 @@ minetest.register_tool("fishing:pole_perfect", {
|
|||
gain = 0.5,
|
||||
})
|
||||
minetest.add_entity({interval = 1,x=pt.under.x, y=pt.under.y+(45/64), z=pt.under.z}, "fishing:bobber_entity")
|
||||
|
||||
if WEAR_OUT == true
|
||||
|
||||
if WEAR_OUT == true
|
||||
and not minetest.setting_getbool("creative_mode") then
|
||||
return rod_wear(itemstack, user, pointed_thing, 1500)
|
||||
return rod_wear(itemstack, user, pointed_thing, 1500)
|
||||
else
|
||||
return {name="fishing:pole_perfect", count=1, wear=0, metadata=""}
|
||||
end
|
||||
|
@ -167,10 +167,10 @@ minetest.register_tool("fishing:pole_perfect", {
|
|||
gain = 0.5,
|
||||
})
|
||||
minetest.add_entity({interval = 1,x=pt.under.x, y=pt.under.y+(45/64), z=pt.under.z}, "fishing:bobber_entity_shark")
|
||||
|
||||
if WEAR_OUT == true
|
||||
|
||||
if WEAR_OUT == true
|
||||
and not minetest.setting_getbool("creative_mode") then
|
||||
return rod_wear(itemstack, user, pointed_thing, 1500)
|
||||
return rod_wear(itemstack, user, pointed_thing, 1500)
|
||||
else
|
||||
return {name="fishing:pole_perfect", count=1, wear=0, metadata=""}
|
||||
end
|
||||
|
@ -240,7 +240,7 @@ if SIMPLE_DECO_FISHING_POLE == true then
|
|||
minetest.remove_node(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
--Canne à pêche parfaite deco
|
||||
minetest.register_node("fishing:pole_perfect_deco", {
|
||||
description = S("Perfect Fishing Pole"),
|
||||
|
@ -348,7 +348,7 @@ else
|
|||
minetest.remove_node(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
--Canne à pêche parfaite deco
|
||||
minetest.register_node("fishing:pole_perfect_deco", {
|
||||
description = S("Perfect Fishing Pole"),
|
||||
|
@ -455,11 +455,11 @@ else
|
|||
if pt.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local under = minetest.get_node(pt.under)
|
||||
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
|
||||
local above = minetest.get_node(p)
|
||||
|
||||
|
||||
-- return if any of the nodes is not registered
|
||||
if not minetest.registered_nodes[under.name] then
|
||||
return
|
||||
|
@ -467,24 +467,24 @@ else
|
|||
if not minetest.registered_nodes[above.name] then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- check if the node above the pointed thing is air
|
||||
if above.name ~= "air" then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- check if pointing at dirt
|
||||
if minetest.get_item_group(under.name, "soil") ~= 1 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- turn the node into soil, play sound, get worm and wear out item
|
||||
minetest.set_node(pt.under, {name="farming:soil"})
|
||||
minetest.sound_play("default_dig_crumbly", {
|
||||
pos = pt.under,
|
||||
gain = 0.5,
|
||||
})
|
||||
|
||||
|
||||
if math.random(1, 100) < WORM_CHANCE then
|
||||
if WORM_IS_MOB == true then
|
||||
minetest.add_entity({x=pt.under.x, y=pt.under.y+0.4, z=pt.under.z}, "fishing:bait_worm_entity")
|
||||
|
|
|
@ -80,11 +80,11 @@ for i in pairs(TRoPHY) do
|
|||
return has_trophy_privilege(meta, player)
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "fishing:trophy_"..iTeM,
|
||||
recipe = {MoD..":"..iTeM, "default:sign_wall"},
|
||||
})
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -69,16 +69,16 @@ minetest.register_entity("fishing:bait_worm_entity", {
|
|||
if n.name == "air" then -- fall when in air
|
||||
self.object:moveto({x=pos.x,y=pos.y-0.5,z=pos.z})
|
||||
self.object:set_hp(self.object:get_hp()-75)
|
||||
|
||||
|
||||
--if n.name == "snappy" then -- fall when leaves or similar
|
||||
elseif minetest.get_item_group(n.name, "snappy") ~= 0 then
|
||||
self.object:moveto({x=pos.x+(0.001*(math.random(-32, 32))),y=pos.y-(0.001*(math.random(0, 64))),z=pos.z+(0.001*(math.random(-32, 32)))})
|
||||
|
||||
|
||||
|
||||
|
||||
elseif string.find(n.name, "default:water") then -- sink when in water
|
||||
self.object:moveto({x=pos.x,y=pos.y-0.25,z=pos.z})
|
||||
self.object:set_hp(self.object:get_hp()-37)
|
||||
|
||||
|
||||
elseif minetest.get_item_group(n.name, "soil") ~= 0 then
|
||||
if minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-0.1,z=pos.z}).name, "soil") == 0 and self.object:get_hp() > 200 then
|
||||
self.object:set_hp(199)
|
||||
|
@ -95,24 +95,24 @@ minetest.register_entity("fishing:bait_worm_entity", {
|
|||
local goal_02 = check_group(minetest.get_node({x = pos.x, y = pos.y-0.4, z = pos.z + 1}).name, "soil")
|
||||
local goal_03 = check_group(minetest.get_node({x = pos.x - 1, y = pos.y-0.4, z = pos.z }).name, "soil")
|
||||
local goal_04 = check_group(minetest.get_node({x = pos.x, y = pos.y-0.4, z = pos.z - 1}).name, "soil")
|
||||
|
||||
|
||||
local goal_1a = check_group(minetest.get_node({x = pos.x + 1, y = pos.y+0.6, z = pos.z }).name, "soil")
|
||||
local goal_2a = check_group(minetest.get_node({x = pos.x, y = pos.y+0.6, z = pos.z + 1}).name, "soil")
|
||||
local goal_3a = check_group(minetest.get_node({x = pos.x - 1, y = pos.y+0.6, z = pos.z }).name, "soil")
|
||||
local goal_4a = check_group(minetest.get_node({x = pos.x, y = pos.y+0.6, z = pos.z - 1}).name, "soil")
|
||||
-- if there's dirt nearby, go there
|
||||
if goal_01 ~= 0 or goal_1a ~= 0 then
|
||||
self.object:moveto({x=pos.x+0.002,y=pos.y,z=pos.z+(0.001*(math.random(-2, 2)))})
|
||||
self.object:moveto({x=pos.x+0.002,y=pos.y,z=pos.z+(0.001*(math.random(-2, 2)))})
|
||||
elseif goal_02 ~= 0 or goal_2a ~= 0 then
|
||||
self.object:moveto({x=pos.x+(0.001*(math.random(-2, 2))),y=pos.y,z=pos.z+0.002})
|
||||
self.object:moveto({x=pos.x+(0.001*(math.random(-2, 2))),y=pos.y,z=pos.z+0.002})
|
||||
elseif goal_03 ~= 0 or goal_3a ~= 0 then
|
||||
self.object:moveto({x=pos.x-0.002,y=pos.y,z=pos.z+(0.001*(math.random(-2, 2)))})
|
||||
self.object:moveto({x=pos.x-0.002,y=pos.y,z=pos.z+(0.001*(math.random(-2, 2)))})
|
||||
elseif goal_04 ~= 0 or goal_4a ~= 0 then
|
||||
self.object:moveto({x=pos.x+(0.001*(math.random(-2, 2))),y=pos.y,z=pos.z-0.002})
|
||||
self.object:moveto({x=pos.x+(0.001*(math.random(-2, 2))),y=pos.y,z=pos.z-0.002})
|
||||
else -- I'm lost, no dirt
|
||||
self.object:moveto({x=pos.x+(0.001*(math.random(-8, 8))),y=pos.y,z=pos.z+(0.001*(math.random(-8, 8)))})
|
||||
self.object:moveto({x=pos.x+(0.001*(math.random(-8, 8))),y=pos.y,z=pos.z+(0.001*(math.random(-8, 8)))})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
look_whats_up(self)
|
||||
end,
|
||||
|
|
|
@ -24,7 +24,7 @@ function ForceloadManager(filetoopen, hide_file_errors)
|
|||
end
|
||||
end
|
||||
for i = 1, #blocks do
|
||||
if not minetest.forceload_block(blocks[i]) then
|
||||
if not minetest.forceload_block(blocks[i]) then
|
||||
minetest.log("error", "Failed to load block " .. minetest.pos_to_string(blocks[i]))
|
||||
end
|
||||
end
|
||||
|
@ -40,7 +40,7 @@ function ForceloadManager(filetoopen, hide_file_errors)
|
|||
end,
|
||||
unload = function(self, pos)
|
||||
for i = 1, #self._blocks do
|
||||
if vector.equals(pos, self._blocks[i]) then
|
||||
if vector.equals(pos, self._blocks[i]) then
|
||||
minetest.forceload_free_block(pos)
|
||||
table.remove(self._blocks, i)
|
||||
return true
|
||||
|
@ -56,16 +56,16 @@ function ForceloadManager(filetoopen, hide_file_errors)
|
|||
end
|
||||
end,
|
||||
verify = function(self)
|
||||
return self:verify_each(function(pos, block)
|
||||
return self:verify_each(function(pos, block)
|
||||
local name = "ignore"
|
||||
if block ~= nil then
|
||||
name = block.name
|
||||
end
|
||||
|
||||
if name == "ignore" then
|
||||
if name == "ignore" then
|
||||
if not pos.last or elapsed_time > pos.last + 15 then
|
||||
pos.last = elapsed_time
|
||||
if not minetest.forceload_block(pos) then
|
||||
if not minetest.forceload_block(pos) then
|
||||
minetest.log("error", "Failed to force load " .. minetest.pos_to_string(pos))
|
||||
pos.remove = true
|
||||
end
|
||||
|
@ -74,15 +74,15 @@ function ForceloadManager(filetoopen, hide_file_errors)
|
|||
elseif name == "forceload:anchor" then
|
||||
pos.last = elapsed_time
|
||||
return true
|
||||
else
|
||||
else
|
||||
minetest.log("error", minetest.pos_to_string(pos) .. " shouldn't be loaded")
|
||||
pos.remove = true
|
||||
return false
|
||||
return false
|
||||
end
|
||||
end)
|
||||
end,
|
||||
verify_each = function(self, func)
|
||||
local not_loaded = {}
|
||||
local not_loaded = {}
|
||||
for i = 1, #self._blocks do
|
||||
local res = minetest.get_node(self._blocks[i])
|
||||
if not func(self._blocks[i], res) then
|
||||
|
@ -125,10 +125,10 @@ minetest.register_node("forceload:anchor",{
|
|||
if not minetest.check_player_privs(placer:get_player_name(),
|
||||
{forceload = true}) then
|
||||
minetest.chat_send_player(placer:get_player_name(), "The forceload privilege is required to do that.")
|
||||
elseif flm:load(pos) then
|
||||
elseif flm:load(pos) then
|
||||
flm:save(minetest.get_worldpath().."/flm.json")
|
||||
return
|
||||
end
|
||||
end
|
||||
minetest.set_node(pos, {name="air"})
|
||||
return true
|
||||
end
|
||||
|
|
|
@ -87,7 +87,7 @@ function add_coloured_framedglass(name, desc, dye)
|
|||
use_texture_alpha = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
|
|
|
@ -12,7 +12,7 @@ local hp_bar = {
|
|||
|
||||
function hp_bar:on_step(dtime)
|
||||
local wielder = self.wielder
|
||||
if wielder == nil then
|
||||
if wielder == nil then
|
||||
self.object:remove()
|
||||
return
|
||||
elseif minetest.get_player_by_name(wielder:get_player_name()) == nil then
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -18,7 +18,7 @@ end
|
|||
|
||||
function hud.set_armor(player_name, ges_state, items)
|
||||
local max_items = 4
|
||||
if items == 5 then
|
||||
if items == 5 then
|
||||
max_items = items
|
||||
end
|
||||
local max = max_items * 65535
|
||||
|
|
|
@ -17,7 +17,7 @@ local function poisenp(tick, time, time_left, player)
|
|||
if player:get_hp()-1 > 0 then
|
||||
player:set_hp(player:get_hp()-1)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function hud.item_eat(hunger_change, replace_with_item, poisen, heal)
|
||||
|
@ -301,7 +301,7 @@ if minetest.get_modpath("mobs") ~= nil then
|
|||
overwrite("mobs:chicken_cooked", 4)
|
||||
overwrite("mobs:egg", 1)
|
||||
overwrite("mobs:chicken_egg_fried", 2)
|
||||
if minetest.get_modpath("bucket") then
|
||||
if minetest.get_modpath("bucket") then
|
||||
overwrite("mobs:bucket_milk", 3, "bucket:bucket_empty")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -49,7 +49,7 @@ HUD_TICK = 0.1
|
|||
--Some hunger settings
|
||||
hud.exhaustion = {} -- Exhaustion is experimental!
|
||||
|
||||
HUD_HUNGER_TICK = 800 -- time in seconds after that 1 hunger point is taken
|
||||
HUD_HUNGER_TICK = 800 -- time in seconds after that 1 hunger point is taken
|
||||
HUD_HUNGER_EXHAUST_DIG = 3 -- exhaustion increased this value after digged node
|
||||
HUD_HUNGER_EXHAUST_PLACE = 1 -- exhaustion increased this value after placed
|
||||
HUD_HUNGER_EXHAUST_MOVE = 0.3 -- exhaustion increased this value if player movement detected
|
||||
|
@ -69,7 +69,7 @@ end
|
|||
|
||||
--load custom settings
|
||||
local set = io.open(minetest.get_modpath("hud").."/hud.conf", "r")
|
||||
if set then
|
||||
if set then
|
||||
dofile(minetest.get_modpath("hud").."/hud.conf")
|
||||
set:close()
|
||||
else
|
||||
|
@ -243,7 +243,7 @@ hud.set_hunger = function(player)
|
|||
if not inv or not value then return nil end
|
||||
if value > 30 then value = 30 end
|
||||
if value < 0 then value = 0 end
|
||||
|
||||
|
||||
inv:set_stack("hunger", 1, ItemStack({name=":", count=value+1}))
|
||||
|
||||
return true
|
||||
|
@ -321,7 +321,7 @@ minetest.after(2.5, function()
|
|||
|
||||
-- update all hud elements
|
||||
update_hud(player)
|
||||
|
||||
|
||||
if HUD_ENABLE_HUNGER then
|
||||
local controls = player:get_player_control()
|
||||
-- Determine if the player is walking
|
||||
|
@ -331,7 +331,7 @@ minetest.after(2.5, function()
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
if timer > 4 then timer = 0 end
|
||||
if timer2 > HUD_HUNGER_TICK then timer2 = 0 end
|
||||
|
|
|
@ -30,6 +30,6 @@ minetest.register_chatcommand("inv", {
|
|||
invlist = invlist..items.." | "
|
||||
end
|
||||
end
|
||||
minetest.chat_send_player(name, invlist)
|
||||
minetest.chat_send_player(name, invlist)
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -156,7 +156,7 @@ tweak.sort = function(player, mode, con)
|
|||
if inv then
|
||||
local list = inv:get_list("main")
|
||||
local tmp_list = {}
|
||||
|
||||
|
||||
--write whole list as table
|
||||
for _,stack in ipairs(list) do
|
||||
local tbl_stack = stack:to_table()
|
||||
|
|
|
@ -46,13 +46,13 @@ function irc:bot_command(msg, text)
|
|||
cmd = text
|
||||
args = ""
|
||||
end
|
||||
|
||||
|
||||
if not self.bot_commands[cmd] then
|
||||
self:reply("Unknown command '"..cmd.."'. Try 'list'."
|
||||
.." Or use @playername <message> to send a private message")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local success, message = self.bot_commands[cmd].func(msg.user, args)
|
||||
if message then
|
||||
self:reply(message)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ function irc:player_part(name)
|
|||
self.joined_players[name] = nil
|
||||
minetest.chat_send_player(name, "IRC: You are now out of the channel.")
|
||||
end
|
||||
|
||||
|
||||
function irc:player_join(name)
|
||||
if self.joined_players[name] then
|
||||
minetest.chat_send_player(name, "IRC: You are already in the channel.")
|
||||
|
@ -28,7 +28,7 @@ minetest.register_chatcommand("join", {
|
|||
irc:player_join(name)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
minetest.register_chatcommand("part", {
|
||||
description = "Part the IRC channel",
|
||||
privs = {shout=true},
|
||||
|
@ -36,7 +36,7 @@ minetest.register_chatcommand("part", {
|
|||
irc:player_part(name)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
minetest.register_chatcommand("who", {
|
||||
description = "Tell who is currently on the channel",
|
||||
privs = {},
|
||||
|
@ -49,13 +49,13 @@ minetest.register_chatcommand("who", {
|
|||
end
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
irc.joined_players[name] = irc.config.auto_join
|
||||
end)
|
||||
|
||||
|
||||
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
irc.joined_players[name] = nil
|
||||
|
|
|
@ -7,7 +7,7 @@ minetest.register_globalstep(function(dtime)
|
|||
if player:get_hp() > 0 or not enable_damage then
|
||||
local pos = player:getpos()
|
||||
local inv = player:get_inventory()
|
||||
|
||||
|
||||
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
|
||||
if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||
|
@ -20,7 +20,7 @@ minetest.register_globalstep(function(dtime)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
|
||||
if object:get_luaentity().always_collect then
|
||||
|
@ -37,7 +37,7 @@ minetest.register_globalstep(function(dtime)
|
|||
object:get_luaentity().object:set_properties({
|
||||
physical = false
|
||||
})
|
||||
|
||||
|
||||
minetest.after(1, function(args)
|
||||
local lua = object:get_luaentity()
|
||||
if object == nil or lua == nil or lua.itemstring == nil then
|
||||
|
@ -58,7 +58,7 @@ minetest.register_globalstep(function(dtime)
|
|||
})
|
||||
end
|
||||
end, {player, object})
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -86,7 +86,7 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
local obj
|
||||
local x = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then x = -x end
|
||||
|
||||
|
||||
local z = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then z = -z end
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ minetest.register_node("lantern:lantern", {
|
|||
sounds = default.node_sound_glass_defaults(),
|
||||
node_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = {-1/6, 1/6, -1/6, 1/6, 0.5, 1/6},
|
||||
wall_bottom = {-1/6, -0.5, -1/6, 1/6, -1/6, 1/6},
|
||||
wall_top = {-1/6, 1/6, -1/6, 1/6, 0.5, 1/6},
|
||||
wall_bottom = {-1/6, -0.5, -1/6, 1/6, -1/6, 1/6},
|
||||
wall_side = {-1/6, -1/6, -1/6, -0.5, 1/6, 1/6},
|
||||
},
|
||||
})
|
||||
|
@ -44,7 +44,7 @@ minetest.register_node("lantern:candle", {
|
|||
inventory_image = "candle_inv.png",
|
||||
tiles = {
|
||||
{name="candle.png", animation={type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 0.8}},
|
||||
},
|
||||
},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
|
@ -184,16 +184,16 @@ minetest.register_node("lantern:lamp1", {
|
|||
sounds = default.node_sound_glass_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -2.5, -0.5, 1.5, 1.5, 0.5},
|
||||
fixed = {-0.5, -2.5, -0.5, 1.5, 1.5, 0.5},
|
||||
},
|
||||
after_dig_node = function(pos)
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x + 1, y = pos.y + 1, z = pos.z })
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x + 1, y = pos.y + 1, z = pos.z })
|
||||
minetest.remove_node({x = pos.x + 1, y = pos.y , z = pos.z })
|
||||
minetest.remove_node({x = pos.x + 1, y = pos.y - 1, z = pos.z })
|
||||
minetest.remove_node({x = pos.x + 1, y = pos.y - 2, z = pos.z })
|
||||
minetest.remove_node({x = pos.x + 1, y = pos.y - 1, z = pos.z })
|
||||
minetest.remove_node({x = pos.x + 1, y = pos.y - 2, z = pos.z })
|
||||
end
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_node("lantern:lamp2", {
|
||||
description = "Lamp2",
|
||||
|
@ -207,16 +207,16 @@ minetest.register_node("lantern:lamp2", {
|
|||
sounds = default.node_sound_glass_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -2.5, -0.5, 0.5, 1.5, 1.5},
|
||||
fixed = {-0.5, -2.5, -0.5, 0.5, 1.5, 1.5},
|
||||
},
|
||||
after_dig_node = function(pos)
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z + 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z + 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y , z = pos.z + 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z + 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z + 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z + 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z + 1})
|
||||
end
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_node("lantern:lamp3", {
|
||||
description = "Lamp3",
|
||||
|
@ -230,16 +230,16 @@ minetest.register_node("lantern:lamp3", {
|
|||
sounds = default.node_sound_glass_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1.5, -2.5, -0.5, 0.5, 1.5, 0.5},
|
||||
fixed = {-1.5, -2.5, -0.5, 0.5, 1.5, 0.5},
|
||||
},
|
||||
after_dig_node = function(pos)
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x - 1, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x - 1, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x - 1, y = pos.y , z = pos.z})
|
||||
minetest.remove_node({x = pos.x - 1, y = pos.y - 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x - 1, y = pos.y - 2, z = pos.z})
|
||||
minetest.remove_node({x = pos.x - 1, y = pos.y - 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x - 1, y = pos.y - 2, z = pos.z})
|
||||
end
|
||||
})
|
||||
})
|
||||
|
||||
minetest.register_node("lantern:lamp4", {
|
||||
description = "Lamp4",
|
||||
|
@ -253,16 +253,16 @@ minetest.register_node("lantern:lamp4", {
|
|||
sounds = default.node_sound_glass_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -2.5, -1.5, 0.5, 1.5, 0.5},
|
||||
fixed = {-0.5, -2.5, -1.5, 0.5, 1.5, 0.5},
|
||||
},
|
||||
after_dig_node = function(pos)
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z - 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
|
||||
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z - 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y , z = pos.z - 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z - 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z - 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z - 1})
|
||||
minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z - 1})
|
||||
end
|
||||
})
|
||||
})
|
||||
|
||||
--
|
||||
-- register crafting recipes:
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user