Removed whitespaces

This commit is contained in:
LeMagnesium 2015-06-10 17:14:58 +02:00
parent 4bc80ddba1
commit f81b8ca677
126 changed files with 954 additions and 954 deletions

View File

@ -16,17 +16,17 @@ local IRC = [[
Voici les sanctions prevues pour les infractions aux regles ci-dessus. 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 Manque de respect envers autrui : Devoice une journee
Provocation envers autrui : Devoice une journee Provocation envers autrui : Devoice une journee
Insultes envers autrui : Kick + Devoice une journee Insultes envers autrui : Kick + Devoice une journee
- Infraction niveau STONE : - Infraction niveau STONE :
- Recidivide d'infraction niveau dirt : Kick + Ban 1/2 journee - Recidivide d'infraction niveau dirt : Kick + Ban 1/2 journee
- Flood, Discrimination : Kick + Devoice deux heures - Flood, Discrimination : Kick + Devoice deux heures
- Spam : Kick + Devoice 1 jour + Ban 1/2 journee - 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 - 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 - 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 - 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 - 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 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 - Violation des regles d'InchraNet : Kick + Ban definitif + Gline ou sanction defnie par l'equipe d'InchraNet
Autres regles de bienseances : Autres regles de bienseances :
- Ne demandez pas a faire partie des operateurs/semi-operateurs du canal. - Ne demandez pas a faire partie des operateurs/semi-operateurs du canal.

View File

@ -16,17 +16,17 @@ local IRC = [[
Voici les sanctions prévues pour les infractions aux règles ci-dessus. 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 Manque de respect envers autrui : Devoice une journée
Provocation envers autrui : Devoice une journée Provocation envers autrui : Devoice une journée
Insultes envers autrui : Kick + Devoice une journée Insultes envers autrui : Kick + Devoice une journée
- Infraction niveau STONE : - Infraction niveau STONE :
- Récidivide d'infraction niveau dirt : Kick + Ban 1/2 journée - Récidivide d'infraction niveau dirt : Kick + Ban 1/2 journée
- Flood, Discrimination : Kick + Devoice deux heures - Flood, Discrimination : Kick + Devoice deux heures
- Spam : Kick + Devoice 1 jour + Ban 1/2 journée - 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 - 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 - 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 - 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 - 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 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 - 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 : Autres règles de bienséances :
- Ne demandez pas à faire partie des opérateurs/semi-opérateurs du canal. - Ne demandez pas à faire partie des opérateurs/semi-opérateurs du canal.

View File

@ -2,7 +2,7 @@
--plants to place in openfarming --plants to place in openfarming
local plants = { ["farming:blueberries"]=1, ["farming:carrot"]=1, ["farming:coffee_beans"]=1, ["farming:corn"]=1, ["farming:cucumber"]=1, 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: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 --tools to dig in openfarming
@ -49,17 +49,17 @@ function areas:canInteract(pos, name)
if not player then return false end if not player then return false end
local wstack = player:get_wielded_item():get_name() local wstack = player:get_wielded_item():get_name()
if wstack == "" then wstack = "hand" end if wstack == "" then wstack = "hand" end
--on_place --on_place
if node == "air" and plants[wstack] ~= nil then if node == "air" and plants[wstack] ~= nil then
return true return true
end end
--on_dig --on_dig
if minetest.get_item_group(node, "plant") == 1 and in_hand[wstack] ~= nil then if minetest.get_item_group(node, "plant") == 1 and in_hand[wstack] ~= nil then
return true return true
end end
owned = true owned = true
else else
owned = true owned = true

View File

@ -60,7 +60,7 @@ minetest.register_chatcommand("set_owner", {
local id = areas:add(ownerName, areaName, pos1, pos2, nil) local id = areas:add(ownerName, areaName, pos1, pos2, nil)
areas:save() areas:save()
minetest.chat_send_player(ownerName, minetest.chat_send_player(ownerName,
"You have been granted control over area #".. "You have been granted control over area #"..
id..". Type /list_areas to show your areas.") id..". Type /list_areas to show your areas.")

View File

@ -1,27 +1,27 @@
--more_signs by addi --more_signs by addi
--Code and Textures are under the CC by-sa 3.0 licence --Code and Textures are under the CC by-sa 3.0 licence
--see: http://creativecommons.org/licenses/by-sa/3.0/ --see: http://creativecommons.org/licenses/by-sa/3.0/
arrow_signs={} arrow_signs={}
arrow_signs.formspec = "field[text;Sign text:;${text}]"; arrow_signs.formspec = "field[text;Sign text:;${text}]";
arrow_signs_on_place = function(itemstack, placer, pointed_thing) arrow_signs_on_place = function(itemstack, placer, pointed_thing)
local posabove = pointed_thing.above local posabove = pointed_thing.above
local posunder = pointed_thing.under local posunder = pointed_thing.under
local vector = placer:get_look_dir() local vector = placer:get_look_dir()
local place = true local place = true
if posabove.y>posunder.y then if posabove.y>posunder.y then
if(vector.z>0.5 and vector.z<=1) then if(vector.z>0.5 and vector.z<=1) then
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 10}) minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 10})
elseif (vector.x>0.5 and vector.x<=1) then elseif (vector.x>0.5 and vector.x<=1) then
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 19}) minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 19})
elseif(-0.5>vector.z and -1<=vector.z) then 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 elseif (-0.5>vector.x and -1<=vector.x) then
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 13}) minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 13})
else else
@ -33,7 +33,7 @@ arrow_signs_on_place = function(itemstack, placer, pointed_thing)
elseif (vector.x>0.5 and vector.x<=1) then elseif (vector.x>0.5 and vector.x<=1) then
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 17}) minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 17})
elseif(-0.5>vector.z and -1<=vector.z) then 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 elseif (-0.5>vector.x and -1<=vector.x) then
minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 15}) minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 15})
else else
@ -96,15 +96,15 @@ arrow_signs_on_place = function(itemstack, placer, pointed_thing)
else else
itemstack:take_item() itemstack:take_item()
end end
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
return itemstack return itemstack
end end
end end
function arrow_signs:savetext(pos, formname, fields, sender) function arrow_signs:savetext(pos, formname, fields, sender)
if not minetest.get_player_privs(sender:get_player_name())["interact"] then 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") minetest.chat_send_player(sender:get_player_name(), "error: you don't have permission to edit the sign. you need the interact priv")
return return
@ -140,8 +140,8 @@ minetest.override_item("default:sign_wall", {
minetest.register_node("arrow_signs:wall", { minetest.register_node("arrow_signs:wall", {
description = "Arrow signs", description = "Arrow signs",
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ 0.25, -0.25, 0.5, -0.25, 0.5, 0.47}, { 0.25, -0.25, 0.5, -0.25, 0.5, 0.47},
{ 0.1875, -0.3125, 0.5, -0.1875, -0.25, 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 = { selection_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ 0.25, -0.25, 0.5, -0.25, 0.5, 0.47}, { 0.25, -0.25, 0.5, -0.25, 0.5, 0.47},
{ 0.1875, -0.3125, 0.5, -0.1875, -0.25, 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, walkable = false,
groups = {choppy=2,dig_immediate=2,sign=1}, groups = {choppy=2,dig_immediate=2,sign=1},
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
on_place = arrow_signs_on_place, on_place = arrow_signs_on_place,
on_construct = function(pos) on_construct = function(pos)
--local n = minetest.get_node(pos) --local n = minetest.get_node(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)

View File

@ -150,7 +150,7 @@ function awards.register_achievement(name,data_table)
if data_table.custom_announce == nil or data_table.custom_announce == "" then if data_table.custom_announce == nil or data_table.custom_announce == "" then
data_table.custom_announce = "Achievement Unlocked:" data_table.custom_announce = "Achievement Unlocked:"
end end
-- add the achievement to the definition table -- add the achievement to the definition table
data_table.name = name data_table.name = name
awards.def[name] = data_table awards.def[name] = data_table
@ -191,7 +191,7 @@ end
function awards.give_achievement(name, award) function awards.give_achievement(name, award)
-- Access Player Data -- Access Player Data
local data = awards.players[name] local data = awards.players[name]
-- Perform checks -- Perform checks
if not data then if not data then
return return
@ -277,7 +277,7 @@ function awards.give_achievement(name, award)
position = {x = 0.5, y = 0}, position = {x = 0.5, y = 0},
offset = {x = 0, y = 40}, offset = {x = 0, y = 40},
alignment = {x = 0, y = -1} alignment = {x = 0, y = -1}
}) })
local three = player:hud_add({ local three = player:hud_add({
hud_elem_type = "text", hud_elem_type = "text",
name = "award_title", name = "award_title",
@ -287,7 +287,7 @@ function awards.give_achievement(name, award)
position = {x = 0.5, y = 0}, position = {x = 0.5, y = 0},
offset = {x = 30, y = 100}, offset = {x = 30, y = 100},
alignment = {x = 0, y = -1} alignment = {x = 0, y = -1}
}) })
local four = player:hud_add({ local four = player:hud_add({
hud_elem_type = "image", hud_elem_type = "image",
name = "award_icon", name = "award_icon",
@ -304,10 +304,10 @@ function awards.give_achievement(name, award)
player:hud_remove(four) player:hud_remove(four)
end) end)
end end
-- record this in the log -- record this in the log
minetest.log("action", name.." has unlocked award "..title) minetest.log("action", name.." has unlocked award "..title)
-- save playertable -- save playertable
awards.save() awards.save()
minetest.sound_play("award_award_won", {to_player = name, gain = 0.5*soundset.get_gain(name,"other")}) 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] local def = awards.def[str]
if def then if def then
if def.title then if def.title then
if def.description then if def.description then
minetest.chat_send_player(to, def.title..": "..def.description) minetest.chat_send_player(to, def.title..": "..def.description)
else else
minetest.chat_send_player(to, def.title) 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 if sid == nil or sid < 1 then
sid = 1 sid = 1
end end
local formspec = "size[11,5]" local formspec = "size[11,5]"
local listofawards = awards._order_awards(name) local listofawards = awards._order_awards(name)
-- Sidebar -- Sidebar
if sid then if sid then
local item = listofawards[sid+0] local item = listofawards[sid+0]
@ -417,7 +417,7 @@ function awards.showto(name, to, sid, text)
formspec = formspec .. "label[1,2.75;Secret Award]".. formspec = formspec .. "label[1,2.75;Secret Award]"..
"image[1,0;3,3;unknown.png]" "image[1,0;3,3;unknown.png]"
if def and def.description then 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 end
else else
local title = item.name local title = item.name
@ -435,13 +435,13 @@ function awards.showto(name, to, sid, text)
formspec = formspec .. "label[1,2.75;"..title..status.."]".. formspec = formspec .. "label[1,2.75;"..title..status.."]"..
"image[1,0;3,3;"..icon.."]" "image[1,0;3,3;"..icon.."]"
if def and def.description then 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 end
end end
-- Create list box -- Create list box
formspec = formspec .. "textlist[4.75,0;6,5;awards;" formspec = formspec .. "textlist[4.75,0;6,5;awards;"
local first = true local first = true
for _,award in pairs(listofawards) do for _,award in pairs(listofawards) do
local def = awards.def[award.name] local def = awards.def[award.name]
@ -450,14 +450,14 @@ function awards.showto(name, to, sid, text)
formspec = formspec .. "," formspec = formspec .. ","
end end
first = false first = false
if def.secret and not award.got then if def.secret and not award.got then
formspec = formspec .. "#ACACACSecret Award" formspec = formspec .. "#ACACACSecret Award"
else else
local title = award.name local title = award.name
if def and def.title then if def and def.title then
title = def.title title = def.title
end end
if award.got then if award.got then
formspec = formspec .. minetest.formspec_escape(title) formspec = formspec .. minetest.formspec_escape(title)
else else
@ -465,7 +465,7 @@ function awards.showto(name, to, sid, text)
end end
end end
end end
end end
formspec = formspec .. ";"..sid.."]" formspec = formspec .. ";"..sid.."]"
-- Show formspec to user -- Show formspec to user
@ -483,11 +483,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name() local name = player:get_player_name()
if fields.awards then if fields.awards then
local event = minetest.explode_textlist_event(fields.awards) local event = minetest.explode_textlist_event(fields.awards)
if event.type == "CHG" then if event.type == "CHG" then
awards.showto(name,name,event.index,false) awards.showto(name,name,event.index,false)
end end
end end
return true return true
end) end)

View File

@ -351,7 +351,7 @@ awards.register_onDeath(function(player,data)
local pos = player:getpos() local pos = player:getpos()
if pos and minetest.find_node_near(pos, 2, "fire:basic_flame") ~= nil then if pos and minetest.find_node_near(pos, 2, "fire:basic_flame") ~= nil then
return "award_burn" return "award_burn"
end end
return nil return nil
end) end)
@ -365,7 +365,7 @@ awards.register_onDeath(function(player,data)
local pos = player:getpos() local pos = player:getpos()
if pos and minetest.find_node_near(pos, 2, "default:lava_flowing") ~= nil then if pos and minetest.find_node_near(pos, 2, "default:lava_flowing") ~= nil then
return "award_in_the_flow" return "award_in_the_flow"
end end
return nil return nil
end) end)
@ -379,7 +379,7 @@ awards.register_onDeath(function(player,data)
local pos = player:getpos() local pos = player:getpos()
if pos and minetest.find_node_near(pos, 5, "default:stone_with_diamond") ~= nil then if pos and minetest.find_node_near(pos, 5, "default:stone_with_diamond") ~= nil then
return "award_this_is_sad" return "award_this_is_sad"
end end
return nil return nil
end) end)
@ -392,7 +392,7 @@ awards.register_onDeath(function(player,data)
local pos = player:getpos() local pos = player:getpos()
if pos and minetest.find_node_near(pos, 5, "bones:bones") ~= nil then if pos and minetest.find_node_near(pos, 5, "bones:bones") ~= nil then
return "award_the_stack" return "award_the_stack"
end end
return nil return nil
end) end)

View File

@ -128,14 +128,14 @@ minetest.register_on_dieplayer(function(player)
if not player or not name or name=="" then if not player or not name or name=="" then
return return
end end
-- Get player -- Get player
awards.assertPlayer(name) awards.assertPlayer(name)
local data = awards.players[name] local data = awards.players[name]
-- Increment counter -- Increment counter
data.deaths = data.deaths + 1 data.deaths = data.deaths + 1
-- Run callbacks and triggers -- Run callbacks and triggers
for _,trigger in pairs(awards.onDeath) do for _,trigger in pairs(awards.onDeath) do
local res = nil local res = nil
@ -160,14 +160,14 @@ minetest.register_on_joinplayer(function(player)
if not player or not name or name=="" then if not player or not name or name=="" then
return return
end end
-- Get player -- Get player
awards.assertPlayer(name) awards.assertPlayer(name)
local data = awards.players[name] local data = awards.players[name]
-- Increment counter -- Increment counter
data.joins = data.joins + 1 data.joins = data.joins + 1
-- Run callbacks and triggers -- Run callbacks and triggers
for _,trigger in pairs(awards.onJoin) do for _,trigger in pairs(awards.onJoin) do
local res = nil local res = nil
@ -197,11 +197,11 @@ minetest.register_on_chat_message(function(name, message)
awards.assertPlayer(name) awards.assertPlayer(name)
local data = awards.players[name] local data = awards.players[name]
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
-- Increment counter -- Increment counter
data.chats = data.chats + 1 data.chats = data.chats + 1
-- Run callbacks and triggers -- Run callbacks and triggers
for _,trigger in pairs(awards.onChat) do for _,trigger in pairs(awards.onChat) do
local res = nil local res = nil
if type(trigger) == "function" then if type(trigger) == "function" then

View File

@ -1,10 +1,10 @@
--[[ --[[
Beginners_chest mod Beginners_chest mod
Put some useful stuff in chests for the new players Put some useful stuff in chests for the new players
Version : 1.1 - 11/8/2014_14h48UTC Version : 1.1 - 11/8/2014_14h48UTC
Last modification by Mg on the : 14/3/2015 @ 14h48 UTC Last modification by Mg on the : 14/3/2015 @ 14h48 UTC
Mod ßý Mg, based on an idea of MinetestForFun/Darcidride Mod ßý Mg, based on an idea of MinetestForFun/Darcidride
]]-- ]]--
@ -118,7 +118,7 @@ local chests = {
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
local i = 1 local i = 1
while i < table.getn(chests)+1 do while i < table.getn(chests)+1 do
if not chests[i].stuff then if not chests[i].stuff then
chests[i].stuff = { chests[i].stuff = {
[1] = "default:wood", [1] = "default:wood",
@ -128,12 +128,12 @@ minetest.register_globalstep(function(dtime)
if not chests[i].interval_timer then if not chests[i].interval_timer then
chests[i].interval_timer = 0 chests[i].interval_timer = 0
end end
if not chests[i].interval_max then if not chests[i].interval_max then
chests[i].interval_max = 7200 -- Using default value : 2h chests[i].interval_max = 7200 -- Using default value : 2h
end end
chests[i].interval_timer = chests[i].interval_timer + dtime 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 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 chests[i].interval_timer = 0
local node = minetest.get_node(chests[i].position) local node = minetest.get_node(chests[i].position)
@ -160,7 +160,7 @@ minetest.register_globalstep(function(dtime)
inv:set_list("main", chests[i].stuff) 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) minetest.log("action","[b_chest]["..i.."] Chest reloaded at "..chests[i].position.x..", "..chests[i].position.y..", "..chests[i].position.z)
else 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.") 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 end

View File

@ -187,8 +187,8 @@ minetest.register_abm(
for k, obj in pairs(objs) do for k, obj in pairs(objs) do
obj:set_hp(obj:get_hp()-100) obj:set_hp(obj:get_hp()-100)
minetest.sound_play("bobblocks_trap_fall", 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
end, end,
}) })

View File

@ -76,7 +76,7 @@ end
function generate_tree(pos, trunk, leaves) function generate_tree(pos, trunk, leaves)
pos.y = pos.y-1 pos.y = pos.y-1
local nodename = minetest.get_node(pos).name local nodename = minetest.get_node(pos).name
pos.y = pos.y+1 pos.y = pos.y+1
if not minetest.get_node_light(pos) then if not minetest.get_node_light(pos) then
return return
@ -210,7 +210,7 @@ elseif string.find(n.name, "farming:pumpkin_") ~= nil then
else else
minetest.set_node(pos, {name="farming:pumpkin"}) minetest.set_node(pos, {name="farming:pumpkin"})
end end
elseif n.name == "default:dirt_with_grass" then elseif n.name == "default:dirt_with_grass" then
for i = -2, 3, 1 do for i = -2, 3, 1 do
for j = -3, 2, 1 do for j = -3, 2, 1 do
@ -225,8 +225,8 @@ elseif n.name == "default:dirt_with_grass" then
else else
minetest.set_node(pos, {name=plant_tab[math.random(0, 5)]}) minetest.set_node(pos, {name=plant_tab[math.random(0, 5)]})
end end
end end
end end
end end

View File

@ -145,7 +145,7 @@ function add_protected_bukket_liquid(nameofbukket,liquidsourcename)
end end
-- Check if pointing to a buildable node -- Check if pointing to a buildable node
local n = minetest.get_node(pointed_thing.under) local n = minetest.get_node(pointed_thing.under)
if is_protected_area(pointed_thing.under, 4 ,user:get_player_name()) then 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)") 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 if minetest.is_protected(pointed_thing.under,user:get_player_name()) then
@ -153,7 +153,7 @@ function add_protected_bukket_liquid(nameofbukket,liquidsourcename)
end end
return itemstack return itemstack
end end
if minetest.registered_nodes[n.name].buildable_to then if minetest.registered_nodes[n.name].buildable_to then
-- buildable; replace the node -- buildable; replace the node
minetest.log("action", user:get_player_name().. " use "..nameofbukket.." at ".. minetest.pos_to_string(pointed_thing.under)) minetest.log("action", user:get_player_name().. " use "..nameofbukket.." at ".. minetest.pos_to_string(pointed_thing.under))

View File

@ -35,7 +35,7 @@ minetest.register_entity(":__builtin:falling_node", {
} }
self.object:set_properties(prop) self.object:set_properties(prop)
end, end,
set_owner = function(self, owner) set_owner = function(self, owner)
if owner ~= nil then if owner ~= nil then
self.owner = "falling" self.owner = "falling"
@ -181,7 +181,7 @@ if PROTECT_LAVA_REALTIME == 1 then
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local 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 if meta:get_string("owner") ~= nil and minetest.is_protected(pos, meta:get_string("owner")) then
minetest.add_node(pos,{name="air"}) minetest.add_node(pos,{name="air"})
end end
@ -196,7 +196,7 @@ if PROTECT_WATER_REALTIME == 1 then
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
local 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 if meta:get_string("owner") ~= nil and minetest.is_protected(pos, meta:get_string("owner")) then
minetest.add_node(pos,{name="air"}) minetest.add_node(pos,{name="air"})
end end
@ -224,7 +224,7 @@ end
-- local meta = minetest.get_meta(area:position(p_pos)) -- 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 -- 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 -- data[p_pos] = c_air
-- end -- end
-- vm:set_data(data) -- vm:set_data(data)
-- vm:write_to_map() -- vm:write_to_map()
-- vm:update_map() -- vm:update_map()

View File

@ -18,7 +18,7 @@ minetest.register_entity(":__builtin:item", {
is_visible = false, is_visible = false,
timer = 0, timer = 0,
}, },
itemstring = "", itemstring = "",
physical_state = true, physical_state = true,
@ -83,7 +83,7 @@ minetest.register_entity(":__builtin:item", {
self.object:setacceleration({x=0, y=-10, z=0}) self.object:setacceleration({x=0, y=-10, z=0})
self:set_item(self.itemstring) self:set_item(self.itemstring)
end, end,
on_step = function(self, dtime) on_step = function(self, dtime)
if not self.timer then if not self.timer then
self.timer = 0 self.timer = 0
@ -92,16 +92,16 @@ minetest.register_entity(":__builtin:item", {
if time ~= 0 and (self.timer > time) then if time ~= 0 and (self.timer > time) then
self.object:remove() self.object:remove()
end end
local p = self.object:getpos() local p = self.object:getpos()
local name = minetest.get_node(p).name 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 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}) minetest.sound_play("builtin_item_lava", {pos = self.object:getpos(), gain = 0.5})
self.object:remove() self.object:remove()
return return
end end
--[[ if name == "default:water_source" then --[[ if name == "default:water_source" then
self.object:setacceleration({x = 0, y = 4, z = 0}) self.object:setacceleration({x = 0, y = 4, z = 0})
else else
@ -119,13 +119,13 @@ minetest.register_entity(":__builtin:item", {
else else
pos.z = pos.z+d pos.z = pos.z+d
end end
local name = minetest.get_node(pos).name local name = minetest.get_node(pos).name
local par2 = minetest.get_node(pos).param2 local par2 = minetest.get_node(pos).param2
if name == "default:water_flowing" and par2 < param2 then if name == "default:water_flowing" and par2 < param2 then
return pos return pos
end end
if i<3 then if i<3 then
pos.x = pos.x-d pos.x = pos.x-d
else else
@ -133,7 +133,7 @@ minetest.register_entity(":__builtin:item", {
end end
end end
end end
local vec = get_flowing_dir(self) local vec = get_flowing_dir(self)
if vec then if vec then
local v = self.object:getvelocity() local v = self.object:getvelocity()
@ -159,7 +159,7 @@ minetest.register_entity(":__builtin:item", {
return return
end end
end end
p.y = p.y - 0.3 p.y = p.y - 0.3
local nn = minetest.get_node(p).name local nn = minetest.get_node(p).name
-- If node is not registered or node is walkably solid. -- If node is not registered or node is walkably solid.

View File

@ -106,7 +106,7 @@ chesttools.on_receive_fields = function(pos, formname, fields, player)
selected = 'main'; selected = 'main';
end end
local inv_list = 'main'; local inv_list = 'main';
if( selected == 'main' ) then if( selected == 'main' ) then
inv_list = 'main'; inv_list = 'main';
elseif( selected == 'craft' ) then elseif( selected == 'craft' ) then
inv_list = 'craft'; inv_list = 'craft';
@ -254,8 +254,8 @@ chesttools.update_chest = function(pos, formname, fields, player)
elseif( fields.shared ) then elseif( fields.shared ) then
price = 1; price = 1;
end end
elseif( node.name=='chesttools:shared_chest') then elseif( node.name=='chesttools:shared_chest') then
if( fields.shared) then if( fields.shared) then
return; return;
end end
@ -321,7 +321,7 @@ chesttools.update_chest = function(pos, formname, fields, player)
minetest.swap_node( pos, { name = target, param2 = node.param2 }); minetest.swap_node( pos, { name = target, param2 = node.param2 });
minetest.chat_send_player( pname, 'Chest changed to '..tostring( minetest.registered_nodes[ target].description ).. 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 end
@ -334,7 +334,7 @@ chesttools.form_input_handler = function( player, formname, fields)
elseif( formname == "chesttools:update") then elseif( formname == "chesttools:update") then
chesttools.update_chest( pos, formname, fields, player); chesttools.update_chest( pos, formname, fields, player);
end end
return; return;
end end
end end
@ -435,9 +435,9 @@ minetest.register_node( 'chesttools:shared_chest', {
return nil; return nil;
end end
if( node.name=='default:chest' if( node.name=='default:chest'
or node.name=='default:chest_locked' or node.name=='default:chest_locked'
or node.name=='chesttools:shared_chest') then or node.name=='chesttools:shared_chest') then
local formspec = "size[8,4]".. local formspec = "size[8,4]"..
"label[2,0.4;Change chest type:]".. "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]'.. formspec = formspec..'item_image[5,1;1.5,1.5;chesttools:shared_chest]'..
'label[5,2.5;shared]'; 'label[5,2.5;shared]';
end end
minetest.show_formspec( name, "chesttools:update", formspec ); minetest.show_formspec( name, "chesttools:update", formspec );
end end
return nil; return nil;
end, end,

View File

@ -136,7 +136,7 @@ minetest.register_craft({
}) })
-------------------------- --------------------------
-- presents - -- presents -
-------------------------- --------------------------
-- paper colour craft -- -- paper colour craft --

View File

@ -11,7 +11,7 @@ minetest.register_node("christmas_craft:snowman", {
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {crumbly=3}, groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(), sounds = default.node_sound_sand_defaults(),
}) })
@ -30,7 +30,7 @@ minetest.register_node("christmas_craft:christmas_lights", {
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
}, },
groups = {oddly_breakable_by_hand = 3}, groups = {oddly_breakable_by_hand = 3},
}) })
minetest.register_node("christmas_craft:christmas_wreath", { minetest.register_node("christmas_craft:christmas_wreath", {
@ -46,7 +46,7 @@ minetest.register_node("christmas_craft:christmas_wreath", {
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
}, },
groups = {oddly_breakable_by_hand = 3}, groups = {oddly_breakable_by_hand = 3},
}) })
minetest.register_node("christmas_craft:christmas_star", { minetest.register_node("christmas_craft:christmas_star", {
@ -92,9 +92,9 @@ minetest.register_node("christmas_craft:red_baubles", {
fixed = { fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side, -- side , top , side , side , bottom, side,
}, },
}, },
selection_box = { selection_box = {
@ -119,9 +119,9 @@ minetest.register_node("christmas_craft:yellow_baubles", {
fixed = { fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side, -- side , top , side , side , bottom, side,
}, },
}, },
selection_box = { selection_box = {
@ -146,9 +146,9 @@ minetest.register_node("christmas_craft:green_baubles", {
fixed = { fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side, -- side , top , side , side , bottom, side,
}, },
}, },
selection_box = { selection_box = {
@ -174,9 +174,9 @@ minetest.register_node("christmas_craft:blue_baubles", {
fixed = { fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side, -- side , top , side , side , bottom, side,
}, },
}, },
selection_box = { selection_box = {
@ -201,9 +201,9 @@ minetest.register_node("christmas_craft:orange_baubles", {
fixed = { fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side, -- side , top , side , side , bottom, side,
}, },
}, },
selection_box = { selection_box = {
@ -228,9 +228,9 @@ minetest.register_node("christmas_craft:violet_baubles", {
fixed = { fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side, -- side , top , side , side , bottom, side,
}, },
}, },
selection_box = { selection_box = {
@ -255,9 +255,9 @@ minetest.register_node("christmas_craft:pink_baubles", {
fixed = { fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side, -- side , top , side , side , bottom, side,
}, },
}, },
selection_box = { selection_box = {
@ -282,9 +282,9 @@ minetest.register_node("christmas_craft:silver_baubles", {
fixed = { fixed = {
{-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25},
{-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08},
-- side , top , side , side , bottom, side, -- side , top , side , side , bottom, side,
}, },
}, },
selection_box = { selection_box = {
@ -298,9 +298,9 @@ minetest.register_node("christmas_craft:silver_baubles", {
------------ ------------
--nodes-- --nodes--
-- presents -- -- presents --
minetest.register_node("christmas_craft:present_box", { minetest.register_node("christmas_craft:present_box", {
description = "Present Box", description = "Present Box",
tiles = {"christmas_craft_present_box.png"}, tiles = {"christmas_craft_present_box.png"},
@ -309,7 +309,7 @@ minetest.register_node("christmas_craft:silver_baubles", {
groups = {crumbly=3}, groups = {crumbly=3},
sounds = default.node_sound_sand_defaults(), sounds = default.node_sound_sand_defaults(),
}) })
minetest.register_node("christmas_craft:Christmas_present", { minetest.register_node("christmas_craft:Christmas_present", {
description = "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"}, 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 = {'fake_fire:flint_and_steel'}, rarity = 90,},
{items = {'default:chest_locked'}, rarity = 80,}, {items = {'default:chest_locked'}, rarity = 80,},
{items = {'default:brick'}, 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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
}) })
minetest.register_node("christmas_craft:Christmas_present_green", { minetest.register_node("christmas_craft:Christmas_present_green", {
description = "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"}, 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 = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,}, {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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
}) })
minetest.register_node("christmas_craft:Christmas_present_red", { minetest.register_node("christmas_craft:Christmas_present_red", {
description = "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"}, 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 = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,}, {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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, 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 = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,}, {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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
}) })
minetest.register_node("christmas_craft:Christmas_present_yellow", { minetest.register_node("christmas_craft:Christmas_present_yellow", {
description = "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"}, 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 = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,}, {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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
}) })
minetest.register_node("christmas_craft:Christmas_present_red", { minetest.register_node("christmas_craft:Christmas_present_red", {
description = "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"}, 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 = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,}, {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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
}) })
minetest.register_node("christmas_craft:Christmas_present_violet", { minetest.register_node("christmas_craft:Christmas_present_violet", {
description = "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"}, 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 = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,}, {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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
}) })
minetest.register_node("christmas_craft:Christmas_present_orange", { minetest.register_node("christmas_craft:Christmas_present_orange", {
description = "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"}, 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 = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,}, {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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
}) })
minetest.register_node("christmas_craft:Christmas_present_pink", { minetest.register_node("christmas_craft:Christmas_present_pink", {
description = "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"}, 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 = {'fake_fire:flint_and_steel'}, rarity = 15,},
{items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:chest_locked'}, rarity = 20,},
{items = {'default:brick'}, rarity = 25,}, {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({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
@ -643,32 +643,32 @@ minetest.register_node("christmas_craft:silver_baubles", {
stack_max = 99, stack_max = 99,
liquids_pointable = false, liquids_pointable = false,
}) })
-- string -- -- string --
minetest.register_craftitem("christmas_craft:red_ribbon", { minetest.register_craftitem("christmas_craft:red_ribbon", {
description = "Red Ribbon", description = "Red Ribbon",
inventory_image = "christmas_craft_red_ribbon.png", inventory_image = "christmas_craft_red_ribbon.png",
stack_max = 99, stack_max = 99,
liquids_pointable = false, liquids_pointable = false,
}) })
-- wish list -- -- wish list --
minetest.register_craftitem("christmas_craft:wish_list", { minetest.register_craftitem("christmas_craft:wish_list", {
description = "Wish list", description = "Wish list",
inventory_image = "christmas_craft_which_list.png", inventory_image = "christmas_craft_which_list.png",
stack_max = 99, stack_max = 99,
liquids_pointable = false, liquids_pointable = false,
}) })
------------ ------------
-- minetest.register_craftitem("christmas_craft:snow_ball", { -- minetest.register_craftitem("christmas_craft:snow_ball", {
-- description = "Snow ball", -- description = "Snow ball",
-- inventory_image = "snow_ball.png", -- inventory_image = "snow_ball.png",
-- stack_max = 16, -- 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_DAMAGE=0.5
snowball_GRAVITY=9 snowball_GRAVITY=9
@ -734,7 +734,7 @@ snow_snowball_ENTITY={
textures = {"snowball.png"}, textures = {"snowball.png"},
lastpos={}, lastpos={},
collisionbox = {-0.25,-0.25,-0.25, 0.25,0.25,0.25}, 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 self.timer=self.timer+dtime
local pos = self.object:getpos() local pos = self.object:getpos()
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
--Become item when hitting a node. --Become item when hitting a node.
if self.lastpos.x~=nil then --If there is no lastpos for some reason. if self.lastpos.x~=nil then --If there is no lastpos for some reason.
if node.name ~= "air" then 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,}) {pos = pos, gain = 1.0, max_hear_distance = 32,})
self.object:remove() self.object:remove()
end end
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 self.lastpos={x=pos.x, y=pos.y, z=pos.z} -- Set lastpos-->Node will be added at last pos outside the node
end end
minetest.register_entity("christmas_craft:snowball_entity", snow_snowball_ENTITY) minetest.register_entity("christmas_craft:snowball_entity", snow_snowball_ENTITY)

View File

@ -1,6 +1,6 @@
print (" ---- mods override is Loading! ---- ") print (" ---- mods override is Loading! ---- ")
-- leaves -- -- leaves --
--minetest.register_node(":4seasons:leaves_winter", { --minetest.register_node(":4seasons:leaves_winter", {
@ -29,7 +29,7 @@ minetest.register_node(":4seasons:grass_winter", {
drop = { drop = {
max_items = 2, items = { max_items = 2, items = {
{items = {'default:dirt'}, rarity = 0,}, {items = {'default:dirt'}, rarity = 0,},
{items = {'christmas_craft:snowball'}, rarity = 0,}, {items = {'christmas_craft:snowball'}, rarity = 0,},
}}, }},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
@ -45,7 +45,7 @@ minetest.register_node(":4seasons:sand_winter", {
drop = {'default:sand', drop = {'default:sand',
max_items = 2, items = { max_items = 2, items = {
{items = {'default:sand'}, rarity = 0,}, {items = {'default:sand'}, rarity = 0,},
{items = {'christmas_craft:snowball'}, rarity = 0,}, {items = {'christmas_craft:snowball'}, rarity = 0,},
}}, }},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
@ -61,7 +61,7 @@ minetest.register_node(":4seasons:desertsand_winter", {
drop = {'default:desert_sand', drop = {'default:desert_sand',
max_items = 2, items = { max_items = 2, items = {
{items = {'default:desert_sand'}, rarity = 0,}, {items = {'default:desert_sand'}, rarity = 0,},
{items = {'christmas_craft:snowball'}, rarity = 0,}, {items = {'christmas_craft:snowball'}, rarity = 0,},
}}, }},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
@ -78,7 +78,7 @@ minetest.register_node(":4seasons:cactus_winter", {
drop = {'default:cactus', drop = {'default:cactus',
max_items = 2, items = { max_items = 2, items = {
{items = {'default:cactus'}, rarity = 0,}, {items = {'default:cactus'}, rarity = 0,},
{items = {'christmas_craft:snowball'}, rarity = 0,}, {items = {'christmas_craft:snowball'}, rarity = 0,},
}}, }},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })

View File

@ -52,10 +52,10 @@ minetest.register_node(":default:leaves", {
selection_box = { selection_box = {
type = "fixed", type = "fixed",
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 -- remplace jungleleaves
minetest.register_node(":default:jungleleaves", { minetest.register_node(":default:jungleleaves", {
description = "Jungle Leaves", description = "Jungle Leaves",
@ -90,7 +90,7 @@ minetest.register_node(":default:jungleleaves", {
selection_box = { selection_box = {
type = "fixed", type = "fixed",
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},
}, },
}, },
}) })

View File

@ -37,7 +37,7 @@ for shade = 1, 3 do
drawtype = "fencelike", drawtype = "fencelike",
description = nodedesc, description = nodedesc,
tiles = { pngname }, tiles = { pngname },
inventory_image = pngnameinv, inventory_image = pngnameinv,
wield_image = pngnameinv, wield_image = pngnameinv,
sunlight_propagates = colored_block_sunlight, sunlight_propagates = colored_block_sunlight,
paramtype = "light", paramtype = "light",
@ -54,7 +54,7 @@ for shade = 1, 3 do
drawtype = "fencelike", drawtype = "fencelike",
description = s50nodedesc, description = s50nodedesc,
tiles = { s50pngname }, tiles = { s50pngname },
inventory_image = s50pngnameinv, inventory_image = s50pngnameinv,
wield_image = s50pngnameinv, wield_image = s50pngnameinv,
sunlight_propagates = colored_block_sunlight, sunlight_propagates = colored_block_sunlight,
paramtype = "light", paramtype = "light",
@ -151,7 +151,7 @@ for hue = 1, 12 do
drawtype = "fencelike", drawtype = "fencelike",
description = nodedesc, description = nodedesc,
tiles = { pngname }, tiles = { pngname },
inventory_image = pngnameinv, inventory_image = pngnameinv,
wield_image = pngnameinv, wield_image = pngnameinv,
sunlight_propagates = colored_block_sunlight, sunlight_propagates = colored_block_sunlight,
paramtype = "light", paramtype = "light",
@ -252,7 +252,7 @@ for grey = 1,5 do
drawtype = "fencelike", drawtype = "fencelike",
description = nodedesc, description = nodedesc,
tiles = { pngname }, tiles = { pngname },
inventory_image = pngnameinv, inventory_image = pngnameinv,
wield_image = pngnameinv, wield_image = pngnameinv,
sunlight_propagates = colored_block_sunlight, sunlight_propagates = colored_block_sunlight,
paramtype = "light", paramtype = "light",

View File

@ -98,7 +98,7 @@ for hue = 1, 12 do
} }
}) })
end end
-- ============================================================ -- ============================================================
-- The 5 levels of greyscale. -- The 5 levels of greyscale.

View File

@ -20,7 +20,7 @@ local colored_block_sound = "default.node_sound_wood_defaults()"
-- Show the wood planks in the crafting guide: -- Show the wood planks in the crafting guide:
-- Value copy the groups table to another one to pass to stairsplus:register_all() -- 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 -- 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 = {} local stairsplus_groups = {}
if coloredwood.enable_stairsplus then if coloredwood.enable_stairsplus then
for k, v in pairs(colored_block_groups) do for k, v in pairs(colored_block_groups) do
@ -179,7 +179,7 @@ for hue = 1, 12 do
}, },
}) })
end end
-- ============================================================ -- ============================================================
-- The 5 levels of greyscale. -- The 5 levels of greyscale.

View File

@ -22,7 +22,7 @@
-- Version 0.6 -- Version 0.6
-- Changelog: -- Changelog:
-- 23.05.15 As all dyes can be crafted into other dyes, only white dye is consumed - provided the -- 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. -- other dyes needed for the crafting chain are stored.
-- 22.05.15 Added support for new homedecor meshnodes. -- 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. -- Added some more labels in the main menu to make it easier to understand.
-- 22.07.13 Added textures provided by Vanessae -- 22.07.13 Added textures provided by Vanessae
-- fixed a bug concerning normal dyes (when unifieddyes is not installed) -- 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 -- adds a function to check ownership of a node; taken from VanessaEs homedecor mod
colormachine = {}; 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!); -- 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 -- 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 "", "default:cactus", "", "", "", -- no lime, no aqua, no cyan, no skyblue
"flowers:geranium", "flowers:viola", "", "", -- no magenta, no redviolet "flowers:geranium", "flowers:viola", "", "", -- no magenta, no redviolet
"default:clay_lump", "", "", "", "default:coal_lump" }; "default:clay_lump", "", "", "", "default:coal_lump" };
-- if flowers is not installed -- if flowers is not installed
colormachine.alternate_basic_dye_sources = { colormachine.alternate_basic_dye_sources = {
"default:apple", "default:desert_stone", "default:sand", "default:apple", "default:desert_stone", "default:sand",
"", "default:cactus", "", "", "", "", "default:cactus", "", "", "",
"default:leaves", "", "", "" , "default:leaves", "", "", "" ,
"default:clay_lump", "", "", "", "default:coal_lump" }; "default:clay_lump", "", "", "", "default:coal_lump" };
@ -115,11 +115,11 @@ colormachine.dye_mixes = { red = {}, -- base color
white = {}, -- base color white = {}, -- base color
lightgrey = {13,15}, -- white + grey lightgrey = {13,15}, -- white + grey
grey = {13,17}, -- black + white grey = {13,17}, -- black + white
darkgrey = {15,17}, -- grey + black darkgrey = {15,17}, -- grey + black
black = {}, -- base color black = {}, -- base color
} }
-- construct the formspec for the color selector -- construct the formspec for the color selector
@ -140,7 +140,7 @@ end
-- defines the order in which blocks are shown -- 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 -- 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 -- for checking if the mod is installed and for creating colored blocks
-- shades: some mods (or parts thereof) do not support all possible shades -- 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) -- 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}, 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}, 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' }, 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' }, 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]"; "label[0.3,1;light]";
-- not all mods offer all shades (and some offer even more) -- 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 if( supported[2]==0 ) then
form = form.. form = form..
@ -510,7 +510,7 @@ colormachine.decode_color_name = function( meta, new_color )
table.remove( liste, 1 ); -- the color has been selected table.remove( liste, 1 ); -- the color has been selected
end end
end end
-- the color was not found! error! keep the old color -- the color was not found! error! keep the old color
if( selected_color == -1 ) then if( selected_color == -1 ) then
if( meta ) 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 if( meta ~= nil ) then
c = tonumber(meta:get_string('selected_color')); c = tonumber(meta:get_string('selected_color'));
s = tonumber(meta:get_string('selected_shade')); s = tonumber(meta:get_string('selected_shade'));
g = tonumber(meta:get_string('selected_grey_shade')); g = tonumber(meta:get_string('selected_grey_shade'));
end end
@ -608,7 +608,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
local k_orig = k; local k_orig = k;
-- unifieddyes_ does not supply all colors -- 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 ))) 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==1 and c==1 ) -- pink
or (g==-1 and s==7 and c==5 ) -- dark brown 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 ''); return 'homedecor:'..colormachine.data[k].add..'brown'..(colormachine.data[k].postfix or '');
end end
end end
if( k=='homedecor_table_' and as_obj_name==1 and new_color=='dark_orange' ) then 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 ''); return 'homedecor:'..colormachine.data[k].add..'mahogany'..(colormachine.data[k].postfix or '');
end end
@ -661,8 +661,8 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
end end
-- beds and sofas are available in less colors -- beds and sofas are available in less colors
if( g==-1 if( g==-1
and (c==7 or c==11) 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 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; return nil;
@ -674,7 +674,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
local color_used = ""; local color_used = "";
if( s==1 and c==1 ) then if( s==1 and c==1 ) then
color_used = 'pink'; -- in blox, this is called "pink"; normally "light_red" 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 ]; color_used = colormachine.grey_names[ g ];
elseif( s ~= 3 ) then elseif( s ~= 3 ) then
return nil; -- only normal saturation supported 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'; return 'blox_'..( color_used )..( colormachine.data[k].add )..'.png';
end end
end end
local postfix = '.png'; local postfix = '.png';
local prefix = k; 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 return nil; -- no grey values for them
end 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_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 h = h_trans[ colormachine.colors[c] ];
local b = ""; local b = "";
local sat = ""; local sat = "";
if( k == 'stained_glass_' ) then if( k == 'stained_glass_' ) then
prefix = "stained_glass:"..(colormachine.colors[c]).."_"; prefix = "stained_glass:"..(colormachine.colors[c]).."_";
if( s==1 or s==2) then b = "8"; -- light 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 elseif( s==7 or s==8) then b = "3"; -- dark
end end
prefix = prefix.."_"; prefix = prefix.."_";
sat = "7"; sat = "7";
if( s==2 or s==4 or s==6 or s==8 ) then -- saturation if( s==2 or s==4 or s==6 or s==8 ) then -- saturation
sat = "6"; 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 if( s==1 and new_color=='light_blue' ) then -- only light blue is supported
return prefix..'light_blue'..postfix; return prefix..'light_blue'..postfix;
elseif( new_color=='dark_green' ) then elseif( new_color=='dark_green' ) then
return prefix..'forest_green'..postfix; 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 elseif( new_color=='orange' ) then
return prefix..'oak'..postfix; return prefix..'oak'..postfix;
end end
end end
if( k=='cotton_' and new_color=='grey') then if( k=='cotton_' and new_color=='grey') then
new_color = 'mediumgrey'; new_color = 'mediumgrey';
end end
if( k=='framedglass_' and as_obj_name ~= 1) then if( k=='framedglass_' and as_obj_name ~= 1) then
postfix = 'glass.png'; postfix = 'glass.png';
@ -791,7 +791,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
end end
-- those have split textures... -- 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; return 'coloredblocks_'..new_color..postfix;
elseif( new_color..'_' == colormachine.data[k].add ) then elseif( new_color..'_' == colormachine.data[k].add ) then
prefix = 'coloredblocks:'; prefix = 'coloredblocks:';
--]] --]]
@ -827,7 +827,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob
end end
if( colormachine.data[k].modname == 'plasticbox' if( colormachine.data[k].modname == 'plasticbox'
and new_color == 'dark_green') then and new_color == 'dark_green') then
return prefix..'darkgreen'..postfix; return prefix..'darkgreen'..postfix;
end 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 if( as_obj_name == 1 and colormachine.data[k].obj_postfix ) then
postfix = (colormachine.data[k].obj_postfix) ..postfix; postfix = (colormachine.data[k].obj_postfix) ..postfix;
end end
-- normal dyes (also used for wool) use a diffrent naming scheme -- normal dyes (also used for wool) use a diffrent naming scheme
if( colormachine.data[k].u == 0) then if( colormachine.data[k].u == 0) then
if( new_color == 'darkgrey' and k ~= 'framedglass_') 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 elseif( new_color == 'dark_orange' ) then
return prefix..'brown'..postfix; return prefix..'brown'..postfix;
elseif( new_color == 'dark_green' ) then 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 elseif( new_color == 'light_red' ) then
return prefix..'pink'..postfix; return prefix..'pink'..postfix;
-- lime, aqua, skyblue and redviolet do not exist as standard wool/dye colors -- 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; return nil;
-- all other colors of normal dye/wool exist only in normal shade -- all other colors of normal dye/wool exist only in normal shade
elseif( g == -1 and s~= 3 and k_orig ~= 'unifieddyes_') then 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 if( mod_name == v.modname ) then
table.insert( found, k ); table.insert( found, k );
end end
end end
if( #found < 1 ) then if( #found < 1 ) then
return { error_code ="Sorry, this block is not supported by the spray booth.", return { error_code ="Sorry, this block is not supported by the spray booth.",
found_name = "", found_name = "",
blocktype = ""}; blocktype = ""};
end end
-- another case of special treatment needed; at least the color is given in the tiles -- 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 if( mod_name =='stained_glass' and stained_glass_exception==1) then
local original_node = minetest.registered_items[ bname ]; local original_node = minetest.registered_items[ bname ];
if( original_node ~= nil ) then if( original_node ~= nil ) then
@ -891,7 +891,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
end end
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 if( mod_name =='framedglass' ) then
block_name = string.sub( block_name, 28 ); block_name = string.sub( block_name, 28 );
end end
@ -909,13 +909,13 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
local bloxdescr = original_node.description; local bloxdescr = original_node.description;
-- bloxparts[1] will be filled with the name of the color: -- bloxparts[1] will be filled with the name of the color:
local bloxparts = string.split( bloxdescr, " "); local bloxparts = string.split( bloxdescr, " ");
-- now extract the blocktype information -- now extract the blocktype information
if( bloxparts ~= nil and #bloxparts > 0 ) then if( bloxparts ~= nil and #bloxparts > 0 ) then
-- we split with the color name -- we split with the color name
local found_name = bloxparts[1]; local found_name = bloxparts[1];
local blocktype = 'blox_'..string.sub( block_name, string.len( found_name )+1 )..'_'; local blocktype = 'blox_'..string.sub( block_name, string.len( found_name )+1 )..'_';
-- handle pink and purple -- handle pink and purple
if( found_name == 'pink' ) then if( found_name == 'pink' ) then
found_name = 'light_red'; 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 -- 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.", return { error_code = "Error: Failed to decode color of this blox-block.",
found_name = "", found_name = "",
blocktype = "" }; blocktype = "" };
end end
@ -944,9 +944,9 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
elseif( block_name == 'shutter_mahogany' ) then elseif( block_name == 'shutter_mahogany' ) then
block_name = 'shutter_dark_orange'; block_name = 'shutter_dark_orange';
-- this is the default, unpainted one..which can also be considered as "orange" in the menu -- 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'; -- block_name = 'shutter_orange';
end end
end end
@ -968,7 +968,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
if( colormachine.data[k].obj_postfix ) then if( colormachine.data[k].obj_postfix ) then
local l = string.len( colormachine.data[k].obj_postfix); 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 and string.sub( block_name, -1*l ) == colormachine.data[k].obj_postfix ) then
block_name = string.sub( block_name, 1, (-1*l)-1 ); 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'; liste[ curr_index ] = 'dark';
table.insert( liste, 'orange' ); table.insert( liste, 'orange' );
curr_index = curr_index + 1; curr_index = curr_index + 1;
-- pink <=> light_red -- pink <=> light_red
elseif( #liste > 0 and liste[ curr_index ]=='pink' ) then elseif( #liste > 0 and liste[ curr_index ]=='pink' ) then
liste[ curr_index ] = 'light'; liste[ curr_index ] = 'light';
table.insert( liste, 'red' ); table.insert( liste, 'red' );
curr_index = curr_index + 1; curr_index = curr_index + 1;
end end
-- find out the saturation - either "s50" or omitted -- find out the saturation - either "s50" or omitted
local sat = 0; local sat = 0;
if( curr_index > 1 and liste[ curr_index ] == "s50" ) then 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 -- for blocks that do not follow the naming scheme - the color cannot be decoded
if( g==-1 and c==0 ) then 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 = "", found_name = "",
blocktype = ""}; blocktype = ""};
end end
@ -1072,7 +1072,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name )
for k,v in pairs( colormachine.data ) do for k,v in pairs( colormachine.data ) do
-- prefix and postfix have to fit -- 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 -- if a postfix exists, we did check for that before and set blocktype accordingly
and( not( blocktype ) or blocktype=='' or blocktype==k)) then and( not( blocktype ) or blocktype=='' or blocktype==k)) then
add = v.add; add = v.add;
@ -1133,13 +1133,13 @@ colormachine.blocktype_menu = function( meta, new_color, page )
local y = 2; local y = 2;
for i,k in ipairs( colormachine.ordered ) do for i,k in ipairs( colormachine.ordered ) do
-- only installed mods are of intrest -- 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 -- that particular mod may not offer this color
form = form.."button["..tostring(x)..","..tostring(y-0.8).. ";1,1;"..k..";"..colormachine.data[k].descr.."]".. 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 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 if( button ~= "" ) then
@ -1198,7 +1198,7 @@ colormachine.main_menu_formspec = function( pos, option )
"label[3,0.0;1. Input - Insert material to paint:]".. "label[3,0.0;1. Input - Insert material to paint:]"..
"list[current_name;input;4.5,0.5;1,1;]".. "list[current_name;input;4.5,0.5;1,1;]"..
"label[9.3,-0.5;Additional storage for dyes:]".. "label[9.3,-0.5;Additional storage for dyes:]"..
"list[current_name;extrastore;9.3,0;5,9]"; "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 if( bname == v.block and colormachine.data[ k ].installed==1) then
table.insert( found, k ); table.insert( found, k );
end end
end end
-- make sure all output fields are empty -- make sure all output fields are empty
for i = 1, inv:get_size( "output" ) do for i = 1, inv:get_size( "output" ) do
@ -1288,13 +1288,13 @@ colormachine.main_menu_formspec = function( pos, option )
end end
-- so that we can determine the factor when taking blocks from the output slots -- so that we can determine the factor when taking blocks from the output slots
meta:set_string('p_values', minetest.serialize( p_values )); meta:set_string('p_values', minetest.serialize( p_values ));
-- this color was not supported -- this color was not supported
if( anz_found == 0 ) then if( anz_found == 0 ) then
form = form.."label[2.2,3.0;Block is not available in that color.]"; form = form.."label[2.2,3.0;Block is not available in that color.]";
return form; return form;
end end
form = form.."label[3.0,1.2;2. Select color for any style:]".. form = form.."label[3.0,1.2;2. Select color for any style:]"..
"label[3.0,2.9;3. Take output (determines 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;]"; "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).."]"; form = form.."label[2.2,3.0;ERROR! Failed to analyze the name of this node: "..tostring(bname).."]";
return form; return form;
end end
-- it may be a dye source -- it may be a dye source
for i,v in ipairs( colormachine.basic_dye_sources ) do 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 -- the previous analyse was necessary in order to determine which block we ought to use
if( option == 'remove_paint' ) then 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 )); inv:set_stack( "input", 1, colormachine.data[ found_color_data.blocktype ].block.." "..tostring( anz_blocks ));
-- update display (we changed the input!) -- update display (we changed the input!)
return colormachine.main_menu_formspec(pos, "analyze"); return colormachine.main_menu_formspec(pos, "analyze");
@ -1353,7 +1353,7 @@ colormachine.main_menu_formspec = function( pos, option )
else else
form = form.."label[5.5,2.0;This is the selected color.]"; form = form.."label[5.5,2.0;This is the selected color.]";
end end
return form; return form;
end end
@ -1368,7 +1368,7 @@ colormachine.get_node_name_painted = function( old_node_name, dye_node_name )
table.insert( possible_blocks, k ); table.insert( possible_blocks, k );
unpainted_block = old_node_name; unpainted_block = old_node_name;
end end
end end
if( unpainted_block == "" ) then if( unpainted_block == "" ) then
local parts = string.split(old_node_name,":"); 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 ); table.insert( possible_blocks, k );
end end
end end
end end
-- remove paint -- remove paint
if( not( dye_node_name ) or dye_node_name == "") then 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 ); 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 ); table.insert( found, new_block_name );
end end
if( #found < 1 ) then if( #found < 1 ) then
return; return;
end end
@ -1468,7 +1468,7 @@ colormachine.allow_inventory_access = function(pos, listname, index, stack, play
local stack_name = stack:get_name(); local stack_name = stack:get_name();
-- the dyes are a bit special - they accept only powder of the correct 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 ~= ("dye:".. colormachine.colors_and_greys[ index ])
and stack_name ~= ("unifieddyes:"..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" ) 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 ) colormachine.on_metadata_inventory_put = function( pos, listname, index, stack, player )
local meta = minetest.get_meta(pos); local meta = minetest.get_meta(pos);
local inv = meta:get_inventory(); local inv = meta:get_inventory();
@ -1558,7 +1558,7 @@ end
colormachine.on_metadata_inventory_take = function( pos, listname, index, stack, player ) colormachine.on_metadata_inventory_take = function( pos, listname, index, stack, player )
local meta = minetest.get_meta(pos); local meta = minetest.get_meta(pos);
local inv = meta:get_inventory(); local inv = meta:get_inventory();
@ -1598,7 +1598,7 @@ colormachine.on_metadata_inventory_take = function( pos, listname, index, stack,
else else
inv:set_stack( "input", 1, inv:get_stack("input",1):get_name().." "..tostring( anz_present )); inv:set_stack( "input", 1, inv:get_stack("input",1):get_name().." "..tostring( anz_present ));
end end
-- the main menu needs to be updated as well -- the main menu needs to be updated as well
meta:set_string( 'formspec', colormachine.main_menu_formspec( pos, "analyze" )); meta:set_string( 'formspec', colormachine.main_menu_formspec( pos, "analyze" ));
return; return;
@ -1637,7 +1637,7 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume )
needed[ colormachine.colors[ c ]] = 1; needed[ colormachine.colors[ c ]] = 1;
-- handle saturation -- handle saturation
if( s==1 ) then needed[ "white" ]=1; -- light 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==4 ) then needed[ "white" ]=2; needed[ "black" ] =1; -- normal, low saturation
elseif( s==5 ) then needed[ "black" ] =1; -- medium dark elseif( s==5 ) then needed[ "black" ] =1; -- medium dark
elseif( s==6 ) then needed[ "white" ]=1; needed[ "black" ] =1; -- medium dark, low saturation 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; anz_pigments = anz_pigments + v;
end end
-- n: portions of *mixtures* needed -- n: portions of *mixtures* needed
local n = 1; local n = 1;
-- if the colors are to be consumed, we need to calculate how many we actually need -- 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 -- now we need to check how many pigments of each color we have
for i,v in ipairs( colormachine.colors_and_greys ) do 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 -- find out how many blocks of this type we can actually color
local stack = inv:get_stack( "dyes", i ); 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 ); n = math.min( anz_white, need_white );
end end
-- return how many *could* be colored -- return how many *could* be colored
if( amount_needed > 0 and do_consume ~= 1 ) then if( amount_needed > 0 and do_consume ~= 1 ) then
return n*anz_pigments; 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 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 -- show how many pigments of this color are needed for the selected mixture
-- normal color -- normal color
if( i <= #colormachine.colors ) then 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 if( amount_needed > 0 and n > 0 ) then
local stack = inv:get_stack( "dyes", i ); local stack = inv:get_stack( "dyes", i );
local found = stack:get_count(); 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 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 else
inv:set_stack( "dyes", i, "" ); inv:set_stack( "dyes", i, "" );
end 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 -- in case pigments where consumed, return how many blocks where colored successfully
if( amount_needed > 0 and n > 0 ) then 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; return n*anz_pigments;
end end
@ -1763,9 +1763,9 @@ colormachine.mix_colors = function( inv, i, sender )
local stack1 = inv:get_stack( "dyes", mix[1] ); local stack1 = inv:get_stack( "dyes", mix[1] );
local stack2 = inv:get_stack( "dyes", mix[2] ); local stack2 = inv:get_stack( "dyes", mix[2] );
local stack3 = inv:get_stack( "dyes", i ); 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 stack1:get_count() > 0
and stack2:get_count() > 0 ) then and stack2:get_count() > 0 ) then
@ -1794,12 +1794,12 @@ colormachine.mix_colors = function( inv, i, sender )
elseif( stack3:get_free_space() > 1 ) then elseif( stack3:get_free_space() > 1 ) then
minetest.chat_send_player( sender:get_player_name(), 'Need '..colormachine.colors_and_greys[ mix[1] ]..' and '.. 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
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() colormachine.init = function()
local liste = {}; local liste = {};
-- create formspecs for all machines -- create formspecs for all machines
@ -1820,7 +1820,7 @@ colormachine.init = function()
end end
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; colormachine.ordered = liste;
-- if no flowers are present, take dye sources from default (so we only have to depend on dyes) -- 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 -- align colors horizontal
for i,k in ipairs( colormachine.colors ) do for i,k in ipairs( colormachine.colors ) do
local prefix = 'dye:'; local prefix = 'dye:';
if( i==4 or i==6 or i==8 or i==12 or i==14 ) then if( i==4 or i==6 or i==8 or i==12 or i==14 ) then
if( colormachine.data[ 'unifieddyes_' ].installed == 1 ) 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.."]"; form = form.."item_image["..tostring(i)..",1;1,1;"..source.."]";
-- even those colors may be additionally mixed -- 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]"; form = form.. "button["..tostring(i-0.1)..",1.9;0.8,0.2;mix_"..colormachine.colors_and_greys[ i ]..";mix]";
end end
-- a color that can be mixed -- 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 mixes = colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ];
local source1 = 'dye:'..colormachine.colors_and_greys[ mixes[1] ]; local source1 = 'dye:'..colormachine.colors_and_greys[ mixes[1] ];
local source2 = 'dye:'..colormachine.colors_and_greys[ mixes[2] ]; 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.."]".. "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]"; "button["..tostring(i-0.1)..",1.9;0.8,0.2;mix_"..colormachine.colors_and_greys[ i ]..";mix]";
end end
form = form.. "item_image["..tostring(i)..",2;1,1;"..tostring( prefix..colormachine.colors[ i ] ).."]".. 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 ] ).."]"; "label["..tostring(i)..",3.6;" ..tostring( colormachine.colors_and_greys[ i ] ).."]";
else else
@ -1897,14 +1897,14 @@ colormachine.init = function()
-- align grey-values vertical -- align grey-values vertical
for i,k in ipairs( colormachine.grey_names ) do for i,k in ipairs( colormachine.grey_names ) do
if( i ~= 2 or colormachine.data[ 'unifieddyes_' ].installed == 1 ) then if( i ~= 2 or colormachine.data[ 'unifieddyes_' ].installed == 1 ) then
local source = colormachine.basic_dye_sources[ #colormachine.colors + i ]; local source = colormachine.basic_dye_sources[ #colormachine.colors + i ];
if( source and source ~= "" ) then if( source and source ~= "" ) then
form = form.."item_image[10,"..tostring(i+4)..";1,1;"..source.."]"; 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 ] ]; 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.."]".. "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]"; "button[9.8," ..tostring(i+4.9)..";0.8,0.2;mix_"..colormachine.colors_and_greys[ #colormachine.colors + i ]..";mix]";
end end
local dye_name = 'dye:'..k; local dye_name = 'dye:'..k;
-- lightgrey exists only in unifieddyes -- lightgrey exists only in unifieddyes
@ -1930,7 +1930,7 @@ colormachine.init = function()
elseif( i==4 ) then elseif( i==4 ) then
dye_name = 'dye:dark_grey'; dye_name = 'dye:dark_grey';
end end
if( dye_name ~= "" ) then if( dye_name ~= "" ) then
form = form.. "item_image[11,"..tostring(i+4)..";1,1;"..tostring( dye_name ).."]".. 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 ] ).."]"; "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]"; form = form.."label[12.2,"..tostring(i+4)..";n/a]";
end end
end end
colormachine.dye_management_formspec = form; colormachine.dye_management_formspec = form;
end end
@ -1957,7 +1957,7 @@ minetest.after( 0, colormachine.init );
-- unifiedbricks: clay blocks, brick blocks (skip individual clay lumps and bricks!) -- unifiedbricks: clay blocks, brick blocks (skip individual clay lumps and bricks!)
-- multicolor: 3 shades, usual amount of colors -- multicolor: 3 shades, usual amount of colors
-- cotton: (by jordach) probably the same as coloredwood -- cotton: (by jordach) probably the same as coloredwood
-- --
-- stained_glass: 9 shades/intensities -- stained_glass: 9 shades/intensities
@ -2051,15 +2051,15 @@ minetest.register_node("colormachine:colormachine", {
return; return;
elseif( colormachine.data[ k ] ) then elseif( colormachine.data[ k ] ) then
-- remember the page we where at -- 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).."]" ); "field[20,20;0.1,0.1;page;;"..tostring(fields.page).."]" );
return; return;
elseif( k=='key_escape') then elseif( k=='key_escape') then
-- nothing to do -- nothing to do
else else
local inv = meta:get_inventory(); 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 for i,f in ipairs( colormachine.colors_and_greys ) do
if( k==("mix_"..f )) then if( k==("mix_"..f )) then
colormachine.mix_colors( inv, i, sender ); colormachine.mix_colors( inv, i, sender );
@ -2083,8 +2083,8 @@ minetest.register_node("colormachine:colormachine", {
elseif( k=='last_page') then elseif( k=='last_page') then
fields.page = math.ceil(#colormachine.ordered/(3*13)-1); fields.page = math.ceil(#colormachine.ordered/(3*13)-1);
end end
meta:set_string( 'formspec', colormachine.blocktype_menu( meta, k, fields.page )); meta:set_string( 'formspec', colormachine.blocktype_menu( meta, k, fields.page ));
else else
@ -2102,7 +2102,7 @@ minetest.register_node("colormachine:colormachine", {
return 0; return 0;
end, end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player) allow_metadata_inventory_put = function(pos, listname, index, stack, player)
return colormachine.allow_inventory_access(pos, listname, index, stack, player, "put" ); return colormachine.allow_inventory_access(pos, listname, index, stack, player, "put" );
end, end,
@ -2131,13 +2131,13 @@ minetest.register_node("colormachine:colormachine", {
if( not( inv:is_empty("input")) if( not( inv:is_empty("input"))
or not( inv:is_empty("refill"))) then 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!"); 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)); meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0));
return false; return false;
end end
if( not( inv:is_empty("dyes"))) then if( not( inv:is_empty("dyes"))) then
minetest.chat_send_player( player:get_player_name(), "Please remove the stored dyes first!"); 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 )); meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0 ));
return false; return false;
end end

View File

@ -18,8 +18,8 @@ minetest.register_craft({
} }
}) })
-- Bracket -- Bracket
minetest.register_node("columnia:bracket", { minetest.register_node("columnia:bracket", {
description = 'Bracket (Column)', description = 'Bracket (Column)',
tiles = {"columnia_rusty.png",}, tiles = {"columnia_rusty.png",},
drawtype = "nodebox", drawtype = "nodebox",
@ -40,7 +40,7 @@ minetest.register_node("columnia:bracket", {
groups = {choppy=2, oddly_breakable_by_hand=2,}, groups = {choppy=2, oddly_breakable_by_hand=2,},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = 'columnia:bracket 4', output = 'columnia:bracket 4',
recipe = { recipe = {
@ -70,7 +70,7 @@ minetest.register_node("columnia:lamp_ceiling", {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.1875, 0.4375, -0.1875, 0.1875, 0.5, 0.1875}, {-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(), sounds = default.node_sound_glass_defaults(),
@ -189,7 +189,7 @@ function columnia.register_column_top(subname, recipeitem, groups, images, descr
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.25, -0.5, -0.25, 0.25, 0.5, 0.25}, {-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}, {-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 Link",
"Stone Column Linkdown", "Stone Column Linkdown",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
columnia.register_column_ia("stonebrick", "default:stonebrick", columnia.register_column_ia("stonebrick", "default:stonebrick",
{cracky=3}, {cracky=3},
{"default_stone_brick.png"}, {"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 Crosslink",
"Desert Stone Brick Column Link", "Desert Stone Brick Column Link",
"Desert Stone Brick Column Linkdown", "Desert Stone Brick Column Linkdown",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
columnia.register_column_ia("desert_stone", "default:desert_stone", columnia.register_column_ia("desert_stone", "default:desert_stone",
{cracky=3}, {cracky=3},
@ -577,8 +577,8 @@ columnia.register_column_ia("desert_stone", "default:desert_stone",
"Desert Stone Column Crosslink", "Desert Stone Column Crosslink",
"Desert Stone Column Link", "Desert Stone Column Link",
"Desert Stone Column Linkdown", "Desert Stone Column Linkdown",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
columnia.register_column_ia("cobble", "default:cobble", columnia.register_column_ia("cobble", "default:cobble",
{cracky=3}, {cracky=3},
{"default_cobble.png"}, {"default_cobble.png"},
@ -599,8 +599,8 @@ columnia.register_column_ia("brick", "default:brick",
"Brick Column Crosslink", "Brick Column Crosslink",
"Brick Column Link", "Brick Column Link",
"Brick Column Linkdown", "Brick Column Linkdown",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
columnia.register_column_ia("sandstone", "default:sandstone", columnia.register_column_ia("sandstone", "default:sandstone",
{crumbly=2,cracky=2}, {crumbly=2,cracky=2},
{"default_sandstone.png"}, {"default_sandstone.png"},
@ -611,7 +611,7 @@ columnia.register_column_ia("sandstone", "default:sandstone",
"Sandstone Column Link", "Sandstone Column Link",
"Sandstone Column Linkdown", "Sandstone Column Linkdown",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
columnia.register_column_ia("sandstonebrick", "default:sandstonebrick", columnia.register_column_ia("sandstonebrick", "default:sandstonebrick",
{crumbly=2,cracky=2}, {crumbly=2,cracky=2},
{"default_sandstone_brick.png"}, {"default_sandstone_brick.png"},
@ -622,7 +622,7 @@ columnia.register_column_ia("sandstonebrick", "default:sandstonebrick",
"Sandstone Brick Column Link", "Sandstone Brick Column Link",
"Sandstone Brick Column Linkdown", "Sandstone Brick Column Linkdown",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
columnia.register_column_ia("wood", "default:wood", columnia.register_column_ia("wood", "default:wood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3}, {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{"default_wood.png"}, {"default_wood.png"},

View File

@ -139,7 +139,7 @@ minetest.register_craftitem("compassgps:cgpsmap_marked", {
e:setyaw(yaw) e:setyaw(yaw)
local dist=math.abs(pos.x-x)+math.abs(pos.y-y)+math.abs(pos.z-z) local dist=math.abs(pos.x-x)+math.abs(pos.y-y)+math.abs(pos.z-z)
if growing_wall_maps == false then 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 elseif dist>30000 then
e:set_properties({visual_size={x=3.45,y=3.45}}) e:set_properties({visual_size={x=3.45,y=3.45}})
elseif dist>15000 then elseif dist>15000 then

View File

@ -100,7 +100,7 @@ if minetest.get_modpath("farming") == nil then
{"default:dry_shrub","default:dry_shrub"}, {"default:dry_shrub","default:dry_shrub"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "darkage:straw 2", output = "darkage:straw 2",
recipe = { recipe = {
@ -131,7 +131,7 @@ else
{"default:dry_shrub","default:dry_shrub"}, {"default:dry_shrub","default:dry_shrub"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "farming:straw 2", output = "farming:straw 2",
recipe = { recipe = {
@ -139,7 +139,7 @@ else
{"darkage:dry_leaves","darkage:dry_leaves"}, {"darkage:dry_leaves","darkage:dry_leaves"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "darkage:straw_bale", output = "darkage:straw_bale",
recipe = { recipe = {
@ -147,7 +147,7 @@ else
{"farming:straw","farming:straw"}, {"farming:straw","farming:straw"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "darkage:adobe 4", output = "darkage:adobe 4",
recipe = { recipe = {

View File

@ -155,7 +155,7 @@ local function generate_claylike(name, minp, maxp, seed, chance, minh, maxh, dir
end end
if num_water_around >= 3 then if num_water_around >= 3 then
is_shallow = false is_shallow = false
end end
if is_shallow then if is_shallow then
for x1=-divlen,divlen do for x1=-divlen,divlen do
for z1=-divlen,divlen do for z1=-divlen,divlen do

View File

@ -7,7 +7,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "marble", "darkage:marble", { stairsplus:register_all("darkage", "marble", "darkage:marble", {
description = "Marble", description = "Marble",
tiles = {"darkage_marble.png"}, tiles = {"darkage_marble.png"},
@ -15,7 +15,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "serpentine", "darkage:serpentine", { stairsplus:register_all("darkage", "serpentine", "darkage:serpentine", {
description = "Serpentine", description = "Serpentine",
tiles = {"darkage_serpentine.png"}, tiles = {"darkage_serpentine.png"},
@ -23,7 +23,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "ors", "darkage:ors", { stairsplus:register_all("darkage", "ors", "darkage:ors", {
description = "Old Red Sandstone", description = "Old Red Sandstone",
tiles = {"darkage_ors.png"}, tiles = {"darkage_ors.png"},
@ -31,7 +31,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "schist", "darkage:schist", { stairsplus:register_all("darkage", "schist", "darkage:schist", {
description = "Schist", description = "Schist",
tiles = {"darkage_schist.png"}, tiles = {"darkage_schist.png"},
@ -39,7 +39,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "slate", "darkage:slate", { stairsplus:register_all("darkage", "slate", "darkage:slate", {
description = "Slate", description = "Slate",
tiles = {"darkage_slate.png"}, tiles = {"darkage_slate.png"},
@ -47,7 +47,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "gneiss", "darkage:gneiss", { stairsplus:register_all("darkage", "gneiss", "darkage:gneiss", {
description = "Gneiss", description = "Gneiss",
tiles = {"darkage_gneiss.png"}, tiles = {"darkage_gneiss.png"},
@ -55,7 +55,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "chalk", "darkage:chalk", { stairsplus:register_all("darkage", "chalk", "darkage:chalk", {
description = "Chalk", description = "Chalk",
tiles = {"darkage_chalk.png"}, tiles = {"darkage_chalk.png"},
@ -63,7 +63,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "slate_cobble", "darkage:slate_cobble", { stairsplus:register_all("darkage", "slate_cobble", "darkage:slate_cobble", {
description = "Slate Cobble", description = "Slate Cobble",
tiles = {"darkage_slate_cobble.png"}, tiles = {"darkage_slate_cobble.png"},
@ -71,7 +71,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "ors_cobble", "darkage:ors_cobble", { stairsplus:register_all("darkage", "ors_cobble", "darkage:ors_cobble", {
description = "Old Red Sandstone Cobble", description = "Old Red Sandstone Cobble",
tiles = {"darkage_ors_cobble.png"}, tiles = {"darkage_ors_cobble.png"},
@ -79,7 +79,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "gneiss_cobble", "darkage:gneiss_cobble", { stairsplus:register_all("darkage", "gneiss_cobble", "darkage:gneiss_cobble", {
description = "Gneiss Cobble", description = "Gneiss Cobble",
tiles = {"darkage_gneiss_cobble.png"}, tiles = {"darkage_gneiss_cobble.png"},
@ -87,7 +87,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "basalt_cobble", "darkage:basalt_cobble", { stairsplus:register_all("darkage", "basalt_cobble", "darkage:basalt_cobble", {
description = "Basalt Cobble", description = "Basalt Cobble",
tiles = {"darkage_basalt_cobble.png"}, tiles = {"darkage_basalt_cobble.png"},
@ -113,7 +113,7 @@ if stairsplus then
sunlight_propagates = true, sunlight_propagates = true,
}) })
end end
stairsplus:register_all("darkage", "straw_bale", "darkage:straw_bale", { stairsplus:register_all("darkage", "straw_bale", "darkage:straw_bale", {
description = "Straw Bale", description = "Straw Bale",
tiles = {"darkage_straw_bale.png"}, tiles = {"darkage_straw_bale.png"},
@ -121,7 +121,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "slate_tile", "darkage:slate_tile", { stairsplus:register_all("darkage", "slate_tile", "darkage:slate_tile", {
description = "Slate Tile", description = "Slate Tile",
tiles = {"darkage_slate_tile.png"}, tiles = {"darkage_slate_tile.png"},
@ -129,7 +129,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "marble_tile", "darkage:marble_tile", { stairsplus:register_all("darkage", "marble_tile", "darkage:marble_tile", {
description = "Marble Tile", description = "Marble Tile",
tiles = {"darkage_marble_tile.png"}, tiles = {"darkage_marble_tile.png"},
@ -137,7 +137,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "stone_brick", "darkage:stone_brick", { stairsplus:register_all("darkage", "stone_brick", "darkage:stone_brick", {
description = "Stone Brick", description = "Stone Brick",
tiles = {"darkage_stone_brick.png"}, tiles = {"darkage_stone_brick.png"},
@ -145,7 +145,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "reinforced_chalk", "darkage:reinforced_chalk", { stairsplus:register_all("darkage", "reinforced_chalk", "darkage:reinforced_chalk", {
description = "Reinforced Chalk", description = "Reinforced Chalk",
tiles = {"darkage_chalk.png^darkage_reinforce.png"}, tiles = {"darkage_chalk.png^darkage_reinforce.png"},
@ -153,7 +153,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "glass", "darkage:glass", { stairsplus:register_all("darkage", "glass", "darkage:glass", {
description = "Medieval Glass", description = "Medieval Glass",
tiles = {"darkage_glass.png"}, tiles = {"darkage_glass.png"},
@ -161,7 +161,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "glow_glass", "darkage:glow_glass", { stairsplus:register_all("darkage", "glow_glass", "darkage:glow_glass", {
description = "Medieval Glow Glass", description = "Medieval Glow Glass",
tiles = {"darkage_glass.png"}, tiles = {"darkage_glass.png"},
@ -171,7 +171,7 @@ if stairsplus then
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true, sunlight_propagates = true,
}) })
stairsplus:register_all("darkage", "reinforced_wood", "darkage:reinforced_wood", { stairsplus:register_all("darkage", "reinforced_wood", "darkage:reinforced_wood", {
description = "Reinforced Wood", description = "Reinforced Wood",
tiles = {"default_wood.png^darkage_reinforce.png"}, tiles = {"default_wood.png^darkage_reinforce.png"},
@ -189,7 +189,7 @@ elseif stairs then
"Basalt Slab", "Basalt Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("marble", "darkage:marble", stairs.register_stair_and_slab("marble", "darkage:marble",
{cracky=3}, {cracky=3},
{"darkage_marble.png"}, {"darkage_marble.png"},
@ -197,7 +197,7 @@ elseif stairs then
"Marble Slab", "Marble Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("marble", "darkage:serpentine", stairs.register_stair_and_slab("marble", "darkage:serpentine",
{cracky=3}, {cracky=3},
{"darkage_serpentine.png"}, {"darkage_serpentine.png"},
@ -205,7 +205,7 @@ elseif stairs then
"Serpentine Slab", "Serpentine Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("ors", "darkage:ors", stairs.register_stair_and_slab("ors", "darkage:ors",
{crumbly=2,cracky=2}, {crumbly=2,cracky=2},
{"darkage_ors.png"}, {"darkage_ors.png"},
@ -213,7 +213,7 @@ elseif stairs then
"Old Red Sandstone Slab", "Old Red Sandstone Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("schist", "darkage:schist", stairs.register_stair_and_slab("schist", "darkage:schist",
{cracky=3}, {cracky=3},
{"darkage_schist.png"}, {"darkage_schist.png"},
@ -221,7 +221,7 @@ elseif stairs then
"Schist Slab", "Schist Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("slate", "darkage:slate", stairs.register_stair_and_slab("slate", "darkage:slate",
{cracky=2}, {cracky=2},
{"darkage_slate.png"}, {"darkage_slate.png"},
@ -229,7 +229,7 @@ elseif stairs then
"Slate Slab", "Slate Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("gneiss", "darkage:gneiss", stairs.register_stair_and_slab("gneiss", "darkage:gneiss",
{cracky=3}, {cracky=3},
{"darkage_gneiss.png"}, {"darkage_gneiss.png"},
@ -237,7 +237,7 @@ elseif stairs then
"Gneiss Slab", "Gneiss Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("chalk", "darkage:chalk", stairs.register_stair_and_slab("chalk", "darkage:chalk",
{crumbly=2,cracky=2}, {crumbly=2,cracky=2},
{"darkage_chalk.png"}, {"darkage_chalk.png"},
@ -245,7 +245,7 @@ elseif stairs then
"Chalk Slab", "Chalk Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("slate_cobble", "darkage:slate_cobble", stairs.register_stair_and_slab("slate_cobble", "darkage:slate_cobble",
{cracky=2}, {cracky=2},
{"darkage_slate_cobble.png"}, {"darkage_slate_cobble.png"},
@ -253,7 +253,7 @@ elseif stairs then
"Slate Cobble Slab", "Slate Cobble Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("ors_cobble", "darkage:ors_cobble", stairs.register_stair_and_slab("ors_cobble", "darkage:ors_cobble",
{crumbly=2,cracky=2}, {crumbly=2,cracky=2},
{"darkage_ors_cobble.png"}, {"darkage_ors_cobble.png"},
@ -261,7 +261,7 @@ elseif stairs then
"Old Red Sandstone Cobble Slab", "Old Red Sandstone Cobble Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("gneiss_cobble", "darkage:gneiss_cobble", stairs.register_stair_and_slab("gneiss_cobble", "darkage:gneiss_cobble",
{crumbly=2,cracky=2}, {crumbly=2,cracky=2},
{"darkage_gneiss_cobble.png"}, {"darkage_gneiss_cobble.png"},
@ -269,7 +269,7 @@ elseif stairs then
"Gneiss Cobble Slab", "Gneiss Cobble Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("basalt_cobble", "darkage:basalt_cobble", stairs.register_stair_and_slab("basalt_cobble", "darkage:basalt_cobble",
{cracky=3}, {cracky=3},
{"darkage_basalt_cobble.png"}, {"darkage_basalt_cobble.png"},
@ -302,7 +302,7 @@ elseif stairs then
"Straw Bale Slab", "Straw Bale Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("slate_tile", "darkage:slate_tile", stairs.register_stair_and_slab("slate_tile", "darkage:slate_tile",
{cracky=2}, {cracky=2},
{"darkage_slate_tile.png"}, {"darkage_slate_tile.png"},
@ -310,7 +310,7 @@ elseif stairs then
"Slate Tile Slab", "Slate Tile Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("marble_tile", "darkage:marble_tile", stairs.register_stair_and_slab("marble_tile", "darkage:marble_tile",
{cracky=2}, {cracky=2},
{"darkage_marble_tile.png"}, {"darkage_marble_tile.png"},
@ -318,7 +318,7 @@ elseif stairs then
"Marble Tile Slab", "Marble Tile Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("stone_brick", "darkage:stone_brick", stairs.register_stair_and_slab("stone_brick", "darkage:stone_brick",
{cracky=3}, {cracky=3},
{"darkage_stone_brick.png"}, {"darkage_stone_brick.png"},
@ -326,7 +326,7 @@ elseif stairs then
"Stone Brick Slab", "Stone Brick Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("reinforced_chalk", "darkage:reinforced_chalk", stairs.register_stair_and_slab("reinforced_chalk", "darkage:reinforced_chalk",
{cracky=3}, {cracky=3},
{"darkage_chalk.png^darkage_reinforce.png"}, {"darkage_chalk.png^darkage_reinforce.png"},
@ -334,7 +334,7 @@ elseif stairs then
"Reinforced Chalk Slab", "Reinforced Chalk Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("glass", "darkage:glass", stairs.register_stair_and_slab("glass", "darkage:glass",
{snappy=2,cracky=3,oddly_breakable_by_hand=3}, {snappy=2,cracky=3,oddly_breakable_by_hand=3},
{"darkage_glass.png"}, {"darkage_glass.png"},
@ -342,7 +342,7 @@ elseif stairs then
"Medieval Glass Slab", "Medieval Glass Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("glow_glass", "darkage:glow_glass", stairs.register_stair_and_slab("glow_glass", "darkage:glow_glass",
{snappy=2,cracky=3,oddly_breakable_by_hand=3}, {snappy=2,cracky=3,oddly_breakable_by_hand=3},
{"darkage_glass.png"}, {"darkage_glass.png"},
@ -350,7 +350,7 @@ elseif stairs then
"Medieval Glow Glass Slab", "Medieval Glow Glass Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
stairs.register_stair_and_slab("reinforced_wood", "darkage:reinforced_wood", stairs.register_stair_and_slab("reinforced_wood", "darkage:reinforced_wood",
{snappy=2,choppy=3,oddly_breakable_by_hand=3,flammable=3}, {snappy=2,choppy=3,oddly_breakable_by_hand=3,flammable=3},
{"default_wood.png^darkage_reinforce.png"}, {"default_wood.png^darkage_reinforce.png"},
@ -358,5 +358,5 @@ elseif stairs then
"Reinforced Wood Slab", "Reinforced Wood Slab",
default.node_sound_stone_defaults() default.node_sound_stone_defaults()
) )
end end

View File

@ -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")}) 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()) sound_play_all(player:get_player_name())
end) end)
else else
minetest.register_on_dieplayer(function(player) minetest.register_on_dieplayer(function(player)
local player_name = player:get_player_name() local player_name = player:get_player_name()

View File

@ -42,7 +42,7 @@ minetest.register_on_dieplayer(function(player)
-- Drop unified_inventory bags and their contents -- Drop unified_inventory bags and their contents
if minetest.get_modpath("unified_inventory") then if minetest.get_modpath("unified_inventory") then
local bag_id = {"bag1", "bag2", "bag3", "bag4"} local bag_id = {"bag1", "bag2", "bag3", "bag4"}
local contents_id = "" local contents_id = ""
local n = 0 local n = 0

View File

@ -60,7 +60,7 @@ minetest.register_node("eventobjects:surprise_node", {
end end
end, end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
end, end,
on_punch = function(pos, node, puncher, pointed_things) on_punch = function(pos, node, puncher, pointed_things)
-- Spawn betweek 5 and 20 random nodes -- Spawn betweek 5 and 20 random nodes

View File

@ -31,14 +31,14 @@ function factions_chat.init()
give_to_singleplayer = true, give_to_singleplayer = true,
} }
) )
minetest.register_privilege("faction_admin", minetest.register_privilege("faction_admin",
{ {
description = "this user is allowed to create or delete factions", description = "this user is allowed to create or delete factions",
give_to_singleplayer = true, give_to_singleplayer = true,
} }
) )
minetest.register_chatcommand("factions", minetest.register_chatcommand("factions",
{ {
params = "<cmd> <parameter 1> .. <parameter n>", params = "<cmd> <parameter 1> .. <parameter n>",
@ -47,7 +47,7 @@ function factions_chat.init()
func = factions_chat.cmdhandler, func = factions_chat.cmdhandler,
} }
) )
minetest.register_chatcommand("af", minetest.register_chatcommand("af",
{ {
params = "text", params = "text",
@ -56,7 +56,7 @@ function factions_chat.init()
func = factions_chat.allfactions_chathandler, func = factions_chat.allfactions_chathandler,
} }
) )
minetest.register_chatcommand("f", minetest.register_chatcommand("f",
{ {
params = "<factionname> text", params = "<factionname> text",
@ -82,13 +82,13 @@ function factions_chat.cmdhandler(playername,parameter)
local player = minetest.get_player_by_name(playername) local player = minetest.get_player_by_name(playername)
local params = parameter:split(" ") local params = parameter:split(" ")
local cmd = params[1] local cmd = params[1]
--handle common commands --handle common commands
if parameter == nil or if parameter == nil or
parameter == "" then parameter == "" then
local playerfactions = factions.get_factions(player) local playerfactions = factions.get_factions(player)
local tosend = "Factions: " .. playername .. " factions:" local tosend = "Factions: " .. playername .. " factions:"
for i,v in ipairs(playerfactions) do for i,v in ipairs(playerfactions) do
if i ~= #playerfactions then if i ~= #playerfactions then
@ -96,33 +96,33 @@ function factions_chat.cmdhandler(playername,parameter)
else else
tosend = tosend .. " " .. v tosend = tosend .. " " .. v
end end
end end
minetest.chat_send_player(playername, tosend, false) minetest.chat_send_player(playername, tosend, false)
return return
end end
--list all known factions --list all known factions
if cmd == "list" then if cmd == "list" then
local list = factions.get_faction_list() local list = factions.get_faction_list()
local tosend = "Factions: current available factions:" local tosend = "Factions: current available factions:"
for i,v in ipairs(list) do for i,v in ipairs(list) do
if i ~= #list then if i ~= #list then
tosend = tosend .. " " .. v .. "," tosend = tosend .. " " .. v .. ","
else else
tosend = tosend .. " " .. v tosend = tosend .. " " .. v
end end
end end
minetest.chat_send_player(playername, tosend, false) minetest.chat_send_player(playername, tosend, false)
return return
end end
--show factions mod version --show factions mod version
if cmd == "version" then if cmd == "version" then
minetest.chat_send_player(playername, "Factions: version " .. factions_version , false) minetest.chat_send_player(playername, "Factions: version " .. factions_version , false)
return return
end end
--show description of faction --show description of faction
if cmd == "info" then if cmd == "info" then
if params[2] ~= nil then if params[2] ~= nil then
@ -132,7 +132,7 @@ function factions_chat.cmdhandler(playername,parameter)
return return
end end
end end
if cmd == "leave" then if cmd == "leave" then
if params[2] ~= nil then if params[2] ~= nil then
if params[3] ~= 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 if minetest.check_player_privs(playername,{ faction_admin=true }) or
factions.is_admin(params[2],playername) and factions.is_admin(params[2],playername) and
toremove ~= nil then toremove ~= nil then
factions.member_remove(params[2],toremove) factions.member_remove(params[2],toremove)
minetest.chat_send_player(playername, minetest.chat_send_player(playername,
"Factions: " .. params[3] .. " has been removed from " "Factions: " .. params[3] .. " has been removed from "
.. params[2], false) .. params[2], false)
return return
end end
else else
factions.member_remove(params[2],player) factions.member_remove(params[2],player)
minetest.chat_send_player(playername, minetest.chat_send_player(playername,
"Factions: You have left " .. params[2], false) "Factions: You have left " .. params[2], false)
return return
end end
end end
end end
--handle superadmin only commands --handle superadmin only commands
if minetest.check_player_privs(playername,{ faction_admin=true }) then if minetest.check_player_privs(playername,{ faction_admin=true }) then
--create new faction --create new faction
@ -176,14 +176,14 @@ function factions_chat.cmdhandler(playername,parameter)
end end
end end
end end
if cmd == "join" then if cmd == "join" then
if params[2] ~= nil then if params[2] ~= nil then
if params[3] ~= nil and if params[3] ~= nil and
minetest.check_player_privs(playername,{ faction_admin=true }) then minetest.check_player_privs(playername,{ faction_admin=true }) then
local toadd = minetest.get_player_by_name(params[3]) local toadd = minetest.get_player_by_name(params[3])
if toadd ~= nil then if toadd ~= nil then
if factions.member_add(params[2],toadd) then if factions.member_add(params[2],toadd) then
minetest.chat_send_player(playername, minetest.chat_send_player(playername,
@ -219,16 +219,16 @@ function factions_chat.cmdhandler(playername,parameter)
"Factions: you are not allowed to join " .. params[2], "Factions: you are not allowed to join " .. params[2],
false) false)
return return
end end
end end
end end
end end
--all following commands require at least two parameters --all following commands require at least two parameters
if params[2] ~= nil then if params[2] ~= nil then
if minetest.check_player_privs(playername,{ faction_admin=true }) or if minetest.check_player_privs(playername,{ faction_admin=true }) or
factions.is_admin(params[2],playername) then factions.is_admin(params[2],playername) then
--delete faction --delete faction
if cmd == "delete" then if cmd == "delete" then
if factions.delete_faction(params[2]) then if factions.delete_faction(params[2]) then
@ -243,19 +243,19 @@ function factions_chat.cmdhandler(playername,parameter)
return return
end end
end end
if cmd == "set_free" then if cmd == "set_free" then
if params[3] ~= nil and if params[3] ~= nil and
(params[3] == "true" or params[3] == "false")then (params[3] == "true" or params[3] == "false")then
local value = false local value = false
if params[3] == "true" then if params[3] == "true" then
value = true value = true
end end
if factions.set_free(params[2],value) then if factions.set_free(params[2],value) then
minetest.chat_send_player(playername, 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], " has been set to " .. params[3],
false) false)
else else
@ -266,20 +266,20 @@ function factions_chat.cmdhandler(playername,parameter)
end end
end end
end end
--set player admin status --set player admin status
if cmd == "admin" then if cmd == "admin" then
if params[3] ~= nil and params[4] ~= nil and if params[3] ~= nil and params[4] ~= nil and
(params[4] == "true" or params[4] == "false") then (params[4] == "true" or params[4] == "false") then
local value = false local value = false
if params[4] == "true" then if params[4] == "true" then
value = true value = true
end end
if factions.set_admin(params[2],params[3],value) then if factions.set_admin(params[2],params[3],value) then
minetest.chat_send_player(playername, minetest.chat_send_player(playername,
"Factions: adminstate of " .. params[3] .. "Factions: adminstate of " .. params[3] ..
" has been set to " .. params[4], " has been set to " .. params[4],
false) false)
else else
@ -291,40 +291,40 @@ function factions_chat.cmdhandler(playername,parameter)
end end
return return
end end
if cmd == "description" and if cmd == "description" and
params[2] ~= nil and params[2] ~= nil and
params[3] ~= nil then params[3] ~= nil then
local desc = params[3] local desc = params[3]
for i=4, #params, 1 do for i=4, #params, 1 do
desc = desc .. " " .. params[i] desc = desc .. " " .. params[i]
end end
if factions.set_description(params[2],desc) then if factions.set_description(params[2],desc) then
minetest.chat_send_player(playername, minetest.chat_send_player(playername,
"Factions: updated description of faction " .. "Factions: updated description of faction " ..
params[2], params[2],
false) false)
return return
else else
minetest.chat_send_player(playername, minetest.chat_send_player(playername,
"Factions: FAILED to update description of faction " .. "Factions: FAILED to update description of faction " ..
params[2], params[2],
false) false)
return return
end end
end end
if cmd == "invite" and if cmd == "invite" and
params[2] ~= nil and params[2] ~= nil and
params[3] ~= nil then params[3] ~= nil then
if factions.member_invite(params[2],params[3]) then if factions.member_invite(params[2],params[3]) then
minetest.chat_send_player(params[3], minetest.chat_send_player(params[3],
"Factions: " .. params[3] .. "Factions: " .. params[3] ..
" you have been invited to join faction " .. params[2], " you have been invited to join faction " .. params[2],
false) false)
minetest.chat_send_player(playername, minetest.chat_send_player(playername,
"Factions: " .. params[3] .. "Factions: " .. params[3] ..
" has been invited to join faction " .. params[2], " has been invited to join faction " .. params[2],
false) false)
return return
@ -353,22 +353,22 @@ end
--! @param parameter data supplied to command --! @param parameter data supplied to command
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
function factions_chat.allfactions_chathandler(playername,parameter) function factions_chat.allfactions_chathandler(playername,parameter)
local player = minetest.get_player_by_name(playername) local player = minetest.get_player_by_name(playername)
if player ~= nil then if player ~= nil then
local recipients = {} local recipients = {}
for faction,value in pairs(factions.get_factions(player)) do for faction,value in pairs(factions.get_factions(player)) do
for name,value in pairs(factions.dynamic_data.membertable[faction]) do for name,value in pairs(factions.dynamic_data.membertable[faction]) do
local object_to_check = minetest.get_player_by_name(name) local object_to_check = minetest.get_player_by_name(name)
if object_to_check ~= nil then if object_to_check ~= nil then
recipients[name] = true recipients[name] = true
end end
end end
end end
for recipient,value in pairs(recipients) do for recipient,value in pairs(recipients) do
if recipient ~= playername then if recipient ~= playername then
minetest.chat_send_player(recipient,playername ..": " .. parameter,false) minetest.chat_send_player(recipient,playername ..": " .. parameter,false)
@ -390,26 +390,26 @@ end
--! @param parameter data supplied to command --! @param parameter data supplied to command
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
function factions_chat.chathandler(playername,parameter) 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 if player ~= nil then
local line = parameter:split(" ") local line = parameter:split(" ")
local target_faction = line[1] local target_faction = line[1]
local text = line[2] local text = line[2]
for i=3,#line,1 do for i=3,#line,1 do
text = text .. " " .. line[i] text = text .. " " .. line[i]
end end
local valid_faction = false local valid_faction = false
for faction,value in pairs(factions.get_factions(player)) do for faction,value in pairs(factions.get_factions(player)) do
if target_faction == faction then if target_faction == faction then
valid_faction = true valid_faction = true
end end
end end
if faction ~= nil and valid_faction and if faction ~= nil and valid_faction and
factions.dynamic_data.membertable[faction] ~= nil then factions.dynamic_data.membertable[faction] ~= nil then
for name,value in pairs(factions.dynamic_data.membertable[faction]) do 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) local MSG = function(text)
minetest.chat_send_player(playername,text,false) minetest.chat_send_player(playername,text,false)
end end
MSG("Factions mod") MSG("Factions mod")
MSG("Usage:") MSG("Usage:")
MSG("\tUser commands:") 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 leave <factionname> -> leave specified faction")
MSG("\t\t/factions join <factionname> -> join specified faction") MSG("\t\t/factions join <factionname> -> join specified faction")
MSG("\t\t/factions version -> show version number of mod") MSG("\t\t/factions version -> show version number of mod")
MSG("\tAdmin commands:") MSG("\tAdmin commands:")
MSG("\t\t/factions create <factionname> -> create a new faction") MSG("\t\t/factions create <factionname> -> create a new faction")
MSG("\t\t/factions delete <factionname> -> delete a faction faction") MSG("\t\t/factions delete <factionname> -> delete a faction faction")

View File

@ -53,11 +53,11 @@ function factions.add_faction(name)
factions.data.factions[name].base_reputation = {} factions.data.factions[name].base_reputation = {}
factions.data.factions[name].adminlist = {} factions.data.factions[name].adminlist = {}
factions.data.factions[name].invitations = {} factions.data.factions[name].invitations = {}
factions.dynamic_data.membertable[name] = {} factions.dynamic_data.membertable[name] = {}
factions.save() factions.save()
return true return true
end end
@ -81,7 +81,7 @@ function factions.set_base_reputation(faction1,faction2,value)
if factions.data.factions[faction1] ~= nil and if factions.data.factions[faction1] ~= nil and
factions.data.factions[faction2] ~= nil then factions.data.factions[faction2] ~= nil then
factions.data.factions[faction1].base_reputation[faction2] = value factions.data.factions[faction1].base_reputation[faction2] = value
factions.data.factions[faction2].base_reputation[faction1] = value factions.data.factions[faction2].base_reputation[faction1] = value
factions.save() factions.save()
@ -166,13 +166,13 @@ end
--! @return true/false --! @return true/false
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
function factions.exists(name) function factions.exists(name)
for key,value in pairs(factions.data.factions) do for key,value in pairs(factions.data.factions) do
if key == name then if key == name then
return true return true
end end
end end
return false return false
end end
@ -188,11 +188,11 @@ end
function factions.get_faction_list() function factions.get_faction_list()
local retval = {} local retval = {}
for key,value in pairs(factions.data.factions) do for key,value in pairs(factions.data.factions) do
table.insert(retval,key) table.insert(retval,key)
end end
return retval return retval
end end
@ -210,9 +210,9 @@ end
function factions.delete_faction(name) function factions.delete_faction(name)
factions.data.factions[name] = nil factions.data.factions[name] = nil
factions.save() factions.save()
if factions.data.factions[name] == nil then if factions.data.factions[name] == nil then
return true return true
end end
@ -235,25 +235,25 @@ end
function factions.member_add(name, object) function factions.member_add(name, object)
local new_entry = {} local new_entry = {}
new_entry.factions = {} new_entry.factions = {}
if object.object ~= nil then if object.object ~= nil then
object = object.object object = object.object
end end
if not factions.exists(name) then if not factions.exists(name) then
print("Unable to add to NON existant faction >" .. name .. "<") print("Unable to add to NON existant faction >" .. name .. "<")
return false return false
end end
new_entry.name,new_entry.temporary = factions.get_name(object) new_entry.name,new_entry.temporary = factions.get_name(object)
factions.dbg_lvl2("Adding name=" .. dump(new_entry.name) .. " to faction: " .. name ) factions.dbg_lvl2("Adding name=" .. dump(new_entry.name) .. " to faction: " .. name )
if new_entry.name ~= nil then if new_entry.name ~= nil then
if factions.data.objects[new_entry.name] == nil then if factions.data.objects[new_entry.name] == nil then
factions.data.objects[new_entry.name] = new_entry factions.data.objects[new_entry.name] = new_entry
end end
if factions.data.objects[new_entry.name].factions[name] == nil then if factions.data.objects[new_entry.name].factions[name] == nil then
factions.data.objects[new_entry.name].factions[name] = true factions.data.objects[new_entry.name].factions[name] = true
factions.dynamic_data.membertable[name][new_entry.name] = true factions.dynamic_data.membertable[name][new_entry.name] = true
@ -262,7 +262,7 @@ function factions.member_add(name, object)
return true return true
end end
end end
--return false if no valid object or already member --return false if no valid object or already member
return false return false
end end
@ -287,7 +287,7 @@ function factions.member_invite(name, playername)
factions.save() factions.save()
return true return true
end end
--return false if not a valid faction or player already invited --return false if not a valid faction or player already invited
return false return false
end end
@ -307,9 +307,9 @@ end
function factions.member_remove(name,object) function factions.member_remove(name,object)
local id,type = factions.get_name(object) local id,type = factions.get_name(object)
factions.dbg_lvl2("removing name=" .. dump(id) .. " to faction: " .. name ) factions.dbg_lvl2("removing name=" .. dump(id) .. " to faction: " .. name )
if id ~= nil and if id ~= nil and
factions.data.objects[id] ~= nil and factions.data.objects[id] ~= nil and
factions.data.objects[id].factions[name] ~= nil then factions.data.objects[id].factions[name] ~= nil then
@ -318,7 +318,7 @@ function factions.member_remove(name,object)
factions.save() factions.save()
return true return true
end end
if id ~= nil and if id ~= nil and
factions.data.factions[name].invitations[id] ~= nil then factions.data.factions[name].invitations[id] ~= nil then
factions.data.factions[name].invitations[id] = nil factions.data.factions[name].invitations[id] = nil
@ -414,7 +414,7 @@ function factions.is_free(name)
factions.data.factions[name].open then factions.data.factions[name].open then
return true return true
end end
return false return false
end end
@ -436,7 +436,7 @@ function factions.is_admin(name,playername)
factions.data.factions[name].adminlist[playername] == true then factions.data.factions[name].adminlist[playername] == true then
return true return true
end end
return false return false
end end
@ -459,7 +459,7 @@ function factions.is_invited(name,playername)
factions.data.factions[name].open == true) then factions.data.factions[name].open == true) then
return true return true
end end
return false return false
end end
@ -477,7 +477,7 @@ end
function factions.get_factions(object) function factions.get_factions(object)
local id,type = factions.get_name(object) local id,type = factions.get_name(object)
local retval = {} local retval = {}
if id ~= nil and if id ~= nil and
factions.data.objects[id] ~= nil then factions.data.objects[id] ~= nil then
@ -485,7 +485,7 @@ function factions.get_factions(object)
table.insert(retval,key) table.insert(retval,key)
end end
end end
return retval return retval
end end
@ -504,7 +504,7 @@ end
function factions.is_member(name,object) function factions.is_member(name,object)
local retval = false local retval = false
local id,type = factions.get_name(object) local id,type = factions.get_name(object)
if id ~= nil and if id ~= nil and
@ -516,7 +516,7 @@ function factions.is_member(name,object)
end end
end end
end end
return retval return retval
end end
@ -536,14 +536,14 @@ end
function factions.get_reputation(name,object) function factions.get_reputation(name,object)
local id,type = factions.get_name(object) local id,type = factions.get_name(object)
factions.dbg_lvl3("get_reputation: " .. name .. "<-->" .. dump(id)) factions.dbg_lvl3("get_reputation: " .. name .. "<-->" .. dump(id))
if id ~= nil and if id ~= nil and
factions.data.factions[name] ~= nil then factions.data.factions[name] ~= nil then
factions.dbg_lvl3("get_reputation: object reputation: " .. dump(factions.data.factions[name].reputation[id])) factions.dbg_lvl3("get_reputation: object reputation: " .. dump(factions.data.factions[name].reputation[id]))
if factions.data.factions[name].reputation[id] == nil then if factions.data.factions[name].reputation[id] == nil then
factions.data.factions[name].reputation[id] factions.data.factions[name].reputation[id]
= factions.calc_base_reputation(name,object) = factions.calc_base_reputation(name,object)
@ -571,21 +571,21 @@ end
--! @return true/false --! @return true/false
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
function factions.modify_reputation(name,object,delta) function factions.modify_reputation(name,object,delta)
local id,type = factions.get_name(object) local id,type = factions.get_name(object)
if factions.data.factions[name] ~= nil then if factions.data.factions[name] ~= nil then
if factions.data.factions[name].reputation[id] == nil then if factions.data.factions[name].reputation[id] == nil then
factions.data.factions[name].reputation[id] factions.data.factions[name].reputation[id]
= factions.calc_base_reputation(name,object) = factions.calc_base_reputation(name,object)
end end
factions.data.factions[name].reputation[id] factions.data.factions[name].reputation[id]
= factions.data.factions[name].reputation[id] + delta = factions.data.factions[name].reputation[id] + delta
factions.save() factions.save()
return true return true
end end
return false return false
end end
@ -604,21 +604,21 @@ function factions.get_name(object)
if object == nil then if object == nil then
return nil,true return nil,true
end end
if object.object ~= nil then if object.object ~= nil then
object = object.object object = object.object
end end
if object:is_player() then if object:is_player() then
return object:get_player_name(),false return object:get_player_name(),false
else else
local luaentity = object:get_luaentity() local luaentity = object:get_luaentity()
if luaentity ~= nil then if luaentity ~= nil then
return tostring(luaentity),true return tostring(luaentity),true
end end
end end
return nil,true return nil,true
end end
@ -639,9 +639,9 @@ function factions.calc_base_reputation(name,object)
--calculate initial reputation based uppon all groups --calculate initial reputation based uppon all groups
local object_factions = factions.get_factions(object) local object_factions = factions.get_factions(object)
local rep_value = 0 local rep_value = 0
factions.dbg_lvl3("calc_base_reputation: " .. name .. " <--> " .. tostring(object)) factions.dbg_lvl3("calc_base_reputation: " .. name .. " <--> " .. tostring(object))
if object_factions ~= nil then if object_factions ~= nil then
factions.dbg_lvl3("calc_base_reputation: " .. tostring(object) .. " is in " .. #object_factions .. " factions") factions.dbg_lvl3("calc_base_reputation: " .. tostring(object) .. " is in " .. #object_factions .. " factions")
for k,v in pairs(object_factions) do for k,v in pairs(object_factions) do
@ -655,10 +655,10 @@ function factions.calc_base_reputation(name,object)
end end
end end
end end
rep_value = rep_value / #object_factions rep_value = rep_value / #object_factions
end end
return rep_value return rep_value
end end
@ -675,16 +675,16 @@ function factions.save()
--due to figuring out which data to save and which is temporary only --due to figuring out which data to save and which is temporary only
--all data is saved here --all data is saved here
--this implies data needs to be cleant up on load --this implies data needs to be cleant up on load
local file,error = io.open(factions_worldid .. "/" .. "factions.conf","w") local file,error = io.open(factions_worldid .. "/" .. "factions.conf","w")
if file ~= nil then if file ~= nil then
file:write(minetest.serialize(factions.data)) file:write(minetest.serialize(factions.data))
file:close() file:close()
else else
minetest.log("error","MOD factions: unable to save factions world specific data!: " .. error) minetest.log("error","MOD factions: unable to save factions world specific data!: " .. error)
end end
end end
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -698,23 +698,23 @@ end
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
function factions.load() function factions.load()
local file,error = io.open(factions_worldid .. "/" .. "factions.conf","r") local file,error = io.open(factions_worldid .. "/" .. "factions.conf","r")
if file ~= nil then if file ~= nil then
local raw_data = file:read("*a") local raw_data = file:read("*a")
file:close() file:close()
if raw_data ~= nil and if raw_data ~= nil and
raw_data ~= "" then raw_data ~= "" then
local raw_table = minetest.deserialize(raw_data) local raw_table = minetest.deserialize(raw_data)
--read object data --read object data
local temp_objects = {} local temp_objects = {}
if raw_table.objects ~= nil then if raw_table.objects ~= nil then
for key,value in pairs(raw_table.objects) do for key,value in pairs(raw_table.objects) do
if value.temporary == false then if value.temporary == false then
factions.data.objects[key] = value factions.data.objects[key] = value
else else
@ -722,7 +722,7 @@ function factions.load()
end end
end end
end end
if raw_table.factions ~= nil then if raw_table.factions ~= nil then
for key,value in pairs(raw_table.factions) do for key,value in pairs(raw_table.factions) do
factions.data.factions[key] = {} factions.data.factions[key] = {}
@ -730,18 +730,18 @@ function factions.load()
factions.data.factions[key].adminlist = value.adminlist factions.data.factions[key].adminlist = value.adminlist
factions.data.factions[key].open = value.open factions.data.factions[key].open = value.open
factions.data.factions[key].invitations = value.invitations factions.data.factions[key].invitations = value.invitations
factions.data.factions[key].reputation = {} factions.data.factions[key].reputation = {}
for repkey,repvalue in pairs(value.reputation) do for repkey,repvalue in pairs(value.reputation) do
if temp_objects[repkey] == nil then if temp_objects[repkey] == nil then
factions.data.factions[key].reputation[repkey] = repvalue factions.data.factions[key].reputation[repkey] = repvalue
end end
end end
factions.dynamic_data.membertable[key] = {} factions.dynamic_data.membertable[key] = {}
end end
end end
--populate dynamic faction member table --populate dynamic faction member table
for id,object in pairs(factions.data.objects) do for id,object in pairs(factions.data.objects) do
for name,value in pairs(factions.data.objects[id].factions) do for name,value in pairs(factions.data.objects[id].factions) do
@ -753,7 +753,7 @@ function factions.load()
end end
else else
local file,error = io.open(factions_worldid .. "/" .. "factions.conf","w") local file,error = io.open(factions_worldid .. "/" .. "factions.conf","w")
if file ~= nil then if file ~= nil then
file:close() file:close()
else else

View File

@ -24,7 +24,7 @@ end
minetest.log("action","[FailPoints] CooKies baked") minetest.log("action","[FailPoints] CooKies baked")
-- Global callbacks -- Global callbacks
minetest.register_on_shutdown(function() minetest.register_on_shutdown(function()
-- Stocking CooKies -- Stocking CooKies
pntf = io.open(data.oven,"w") pntf = io.open(data.oven,"w")
for i,v in pairs(data.cookies) do 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,"/cookie <subcommand> | <playername>")
minetest.chat_send_player(name,"Available subcommands :") minetest.chat_send_player(name,"Available subcommands :")
minetest.chat_send_player(name," - help : show this help") 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 return
elseif param == "settings" then elseif param == "settings" then
if not minetest.get_player_privs(name)["server"] 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)") minetest.chat_send_player(name,"You're not allowed to perform this command. (Missing privilege : server)")
return return
end end
minetest.chat_send_player(name,"=== CK_DEBUG_LINES SENT ===") minetest.chat_send_player(name,"=== CK_DEBUG_LINES SENT ===")
print("=== CK_DEBUG_LINES ===") print("=== CK_DEBUG_LINES ===")
local send_admin = function(msg) local send_admin = function(msg)
minetest.chat_send_player(name,msg) minetest.chat_send_player(name,msg)
end end
send_admin("CK File") send_admin("CK File")
if pntf ~= nil then if pntf ~= nil then
send_admin("Found") send_admin("Found")
@ -69,7 +69,7 @@ minetest.register_chatcommand("cookie", {
send_admin("Missing!") send_admin("Missing!")
end end
table.foreach(data,print) table.foreach(data,print)
return return
elseif param == "view" then elseif param == "view" then
if param2 == "" or param2 == nil 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.") minetest.chat_send_player(name,"-CK- You own "..owncookies.." CooKies.")
return true return true
end end
if data.cookies[param2] ~= nil and data.cookies[param2] > 0 then if data.cookies[param2] ~= nil and data.cookies[param2] > 0 then
minetest.chat_send_player(name,"-CK- Player "..param2.." owns "..data.cookies[param2].." CooKies.") minetest.chat_send_player(name,"-CK- Player "..param2.." owns "..data.cookies[param2].." CooKies.")
else else
minetest.chat_send_player(name,"-CK- Player "..param2.." doesn't seem to own any CooKie.") minetest.chat_send_player(name,"-CK- Player "..param2.." doesn't seem to own any CooKie.")
end end
else else
-- If not any known command -- If not any known command
if name == param then if name == param then
if minetest.get_player_privs(name)["baker"] == true then if minetest.get_player_privs(name)["baker"] == true then
@ -100,7 +100,7 @@ minetest.register_chatcommand("cookie", {
end end
return false return false
end end
if param == "" then if param == "" then
minetest.chat_send_player(name,"-CK- You failed: Not enough parameters given, type /cookie help for help") minetest.chat_send_player(name,"-CK- You failed: Not enough parameters given, type /cookie help for help")
return false return false
@ -110,7 +110,7 @@ minetest.register_chatcommand("cookie", {
minetest.chat_send_player(name,"-CK- You failed: Sorry, "..param.." isn't online.") minetest.chat_send_player(name,"-CK- You failed: Sorry, "..param.." isn't online.")
return false return false
end end
-- Take, or not, cookies from name's account to give them to param -- Take, or not, cookies from name's account to give them to param
if minetest.get_player_privs(name)["baker"] ~= true then if minetest.get_player_privs(name)["baker"] ~= true then
if data.cookies[name] == nil or data.failpoints[name] == 0 then if data.cookies[name] == nil or data.failpoints[name] == 0 then
@ -122,14 +122,14 @@ minetest.register_chatcommand("cookie", {
else else
minetest.log("action","[FailPoints] "..name.." has baked a CooKie.") minetest.log("action","[FailPoints] "..name.." has baked a CooKie.")
end end
-- Give/Add the CooKie to param' account -- Give/Add the CooKie to param' account
if data.cookies[param] == nil then if data.cookies[param] == nil then
data.cookies[param] = 1 data.cookies[param] = 1
else else
data.cookies[param] = data.cookies[param]+1 data.cookies[param] = data.cookies[param]+1
end end
minetest.log("action","[FailPoints] "..name.." has given a CooKie to "..param) 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] "..param.." now own "..data.cookies[param].."CKs")
minetest.log("action","[FailPoints] "..name.." now own "..(data.cookies[name] or 0).."CKs") minetest.log("action","[FailPoints] "..name.." now own "..(data.cookies[name] or 0).."CKs")

View File

@ -1,6 +1,6 @@
-- Fails mod By Mg <mg[dot]minetest[at]gmail[dot]com> -- 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 data.is_player_available = minetest.get_player_by_name
if data.STRICT_PLAYER_CHECK == false then if data.STRICT_PLAYER_CHECK == false then
data.is_player_available = function (name) data.is_player_available = function (name)
return (io.open(minetest.get_worldpath().."/players/"..name) ~= nil) return (io.open(minetest.get_worldpath().."/players/"..name) ~= nil)
end end
@ -68,7 +68,7 @@ end
minetest.log("action","[FailPoints] Loaded") minetest.log("action","[FailPoints] Loaded")
-- Global callbacks -- Global callbacks
minetest.register_on_shutdown(function() minetest.register_on_shutdown(function()
-- Saving failpoints -- Saving failpoints
pntf = io.open(data.fp_file,"w") pntf = io.open(data.fp_file,"w")
for i,v in pairs(data.failpoints) do 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,"Available subcommands :")
minetest.chat_send_player(name," - help : show this help") minetest.chat_send_player(name," - help : show this help")
minetest.chat_send_player(name," - version : show actual fail version") 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 return
elseif param == "settings" then elseif param == "settings" then
if not minetest.get_player_privs(name)["server"] 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)") minetest.chat_send_player(name,"You're not allowed to perform this command. (Missing privilege : server)")
return return
end end
minetest.chat_send_player(name,"=== FP_DEBUG_LINES SENT ===") minetest.chat_send_player(name,"=== FP_DEBUG_LINES SENT ===")
print("=== FP_DEBUG_LINES ===") print("=== FP_DEBUG_LINES ===")
local send_admin = function(msg) local send_admin = function(msg)
minetest.chat_send_player(name,msg) minetest.chat_send_player(name,msg)
end end
send_admin("FP File") send_admin("FP File")
if pntf ~= nil then if pntf ~= nil then
send_admin("Found") send_admin("Found")
@ -117,7 +117,7 @@ minetest.register_chatcommand("fail", {
send_admin("Missing!") send_admin("Missing!")
end end
table.foreach(data,print) table.foreach(data,print)
return return
elseif param == "view" then elseif param == "view" then
if param2 == "" or param2 == nil 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.") minetest.chat_send_player(name,"-FP- You own "..ownfail.." FailPoints.")
return true return true
end end
if data.failpoints[param2] ~= nil and data.failpoints[param2] > 0 then if data.failpoints[param2] ~= nil and data.failpoints[param2] > 0 then
minetest.chat_send_player(name,"-FP- Player "..param2.." owns "..data.failpoints[param2].." FailPoints.") minetest.chat_send_player(name,"-FP- Player "..param2.." owns "..data.failpoints[param2].." FailPoints.")
else else
minetest.chat_send_player(name,"-FP- Player "..param2.." doesn't seem to own any FailPoint.") minetest.chat_send_player(name,"-FP- Player "..param2.." doesn't seem to own any FailPoint.")
end end
else else
-- If not any known command -- If not any known command
if name == param then if name == param then
if minetest.get_player_privs(name)["fp_create"] == true then if minetest.get_player_privs(name)["fp_create"] == true then
@ -148,7 +148,7 @@ minetest.register_chatcommand("fail", {
end end
return false return false
end end
if param == "" then if param == "" then
minetest.chat_send_player(name,"-FP- You failed: Not enough parameters given, type /fail help for help") minetest.chat_send_player(name,"-FP- You failed: Not enough parameters given, type /fail help for help")
return false return false
@ -158,7 +158,7 @@ minetest.register_chatcommand("fail", {
minetest.chat_send_player(name,"-FP- You failed: Sorry, "..param.." isn't online.") minetest.chat_send_player(name,"-FP- You failed: Sorry, "..param.." isn't online.")
return false return false
end end
-- Take, or not, failpoints from name's account to give them to param -- Take, or not, failpoints from name's account to give them to param
if minetest.get_player_privs(name)["fp_create"] ~= true then if minetest.get_player_privs(name)["fp_create"] ~= true then
if data.failpoints[name] == nil or data.failpoints[name] == 0 then if data.failpoints[name] == nil or data.failpoints[name] == 0 then
@ -170,14 +170,14 @@ minetest.register_chatcommand("fail", {
else else
minetest.log("action","[FailPoints] "..name.." has created a FailPoint.") minetest.log("action","[FailPoints] "..name.." has created a FailPoint.")
end end
-- Give/Add the failpoint to param' account -- Give/Add the failpoint to param' account
if data.failpoints[param] == nil then if data.failpoints[param] == nil then
data.failpoints[param] = 1 data.failpoints[param] = 1
else else
data.failpoints[param] = data.failpoints[param]+1 data.failpoints[param] = data.failpoints[param]+1
end end
minetest.log("action","[FailPoints] "..name.." has given a failpoint to "..param) 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] "..param.." now own "..data.failpoints[param].."FPs")
minetest.log("action","[FailPoints] "..name.." now own "..(data.failpoints[name] or 0).."FPs") minetest.log("action","[FailPoints] "..name.." now own "..(data.failpoints[name] or 0).."FPs")

View File

@ -8,9 +8,9 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname)
if not pt and pt.type ~= "node" then if not pt and pt.type ~= "node" then
return return
end end
local under = minetest.get_node(pt.under) local under = minetest.get_node(pt.under)
-- return if any of the nodes is not registered -- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then if not minetest.registered_nodes[under.name] then
return return
@ -20,7 +20,7 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname)
if under.name ~= "default:jungletree" then if under.name ~= "default:jungletree" then
return return
end end
-- add the node and remove 1 item from the itemstack -- add the node and remove 1 item from the itemstack
minetest.add_node(pt.above, {name=plantname}) minetest.add_node(pt.above, {name=plantname})
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
@ -144,7 +144,7 @@ minetest.register_abm({
elseif dir == 4 then pos.z = pos.z -1 elseif dir == 4 then pos.z = pos.z -1
else return else return
end end
if minetest.get_node(pos).name == "air" and minetest.get_node_light(pos) > 12 then if minetest.get_node(pos).name == "air" and minetest.get_node_light(pos) > 12 then
-- print ("COCOA", pos.x, pos.y, pos.z) -- print ("COCOA", pos.x, pos.y, pos.z)
minetest.set_node(pos,{name="farming:cocoa_"..tostring(math.random(1,3))}) minetest.set_node(pos,{name="farming:cocoa_"..tostring(math.random(1,3))})

View File

@ -28,7 +28,7 @@ minetest.register_craft({
--= Ethanol (Thanks to JKMurray for this idea) --= Ethanol (Thanks to JKMurray for this idea)
minetest.register_craftitem("farming:bottle_ethanol", { minetest.register_craftitem("farming:bottle_ethanol", {
description = "Bottle of Ethanol", description = "Bottle of Ethanol",
inventory_image = "farming_bottle_ethanol.png", inventory_image = "farming_bottle_ethanol.png",
}) })

View File

@ -66,7 +66,7 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
if not pt or pt.type ~= "node" then if not pt or pt.type ~= "node" then
return return
end end
local under = minetest.get_node(pt.under) local under = minetest.get_node(pt.under)
local upos = pointed_thing.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 p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local above = minetest.get_node(p) local above = minetest.get_node(p)
-- return if any of the nodes is not registered -- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] if not minetest.registered_nodes[under.name]
or not minetest.registered_nodes[above.name] then or not minetest.registered_nodes[above.name] then
return return
end end
-- check if the node above the pointed thing is air -- check if the node above the pointed thing is air
if above.name ~= "air" then if above.name ~= "air" then
return return
end end
-- check if pointing at dirt -- check if pointing at dirt
if minetest.get_item_group(under.name, "soil") ~= 1 then if minetest.get_item_group(under.name, "soil") ~= 1 then
return return
end end
-- turn the node into soil, wear out item and play sound -- turn the node into soil, wear out item and play sound
minetest.set_node(pt.under, {name="farming:soil"}) minetest.set_node(pt.under, {name="farming:soil"})
minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5,}) minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5,})

View File

@ -404,7 +404,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
-- can I replace above node, and am I pointing at soil -- can I replace above node, and am I pointing at soil
if not minetest.registered_nodes[above.name].buildable_to 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 or minetest.get_item_group(above.name, "plant") ~= 0 then -- ADDED this line for multiple seed placement bug
return return
end end
@ -471,7 +471,7 @@ farming.register_plant = function(name, def)
{items = {mname .. ":seed_" .. pname}, rarity = 18 - i * 2}, {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} 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 -- Last step doesn't need growing=1 so Abm never has to check these
if i == def.steps then if i == def.steps then

View File

@ -48,15 +48,15 @@ local function find_dock(pos, second)
local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2}
if second > 0 then if second > 0 then
local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} 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 end
elseif code == 0 then elseif code == 0 then
if second == 2 then if second == 2 then
local tmp_node = {name="fences:fence_wood", param1=me.param1, param2=me.param2} 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 end
end end
local function punch(pos, puncher) local function punch(pos, puncher)
@ -576,7 +576,7 @@ minetest.register_craft({
local meta2 local meta2
local state2 = 0 local state2 = 0
local function update_gate(pos, node) local function update_gate(pos, node)
minetest.set_node(pos, node) minetest.set_node(pos, node)
end end

View File

@ -39,17 +39,17 @@ minetest.register_alias("flowers_plus:seaweed", "flowers:seaweed") -- exception
local PLaNTS = { local PLaNTS = {
-- MoD* iTeM MeSSaGe ("You caught "..) -- MoD* iTeM MeSSaGe ("You caught "..)
{"flowers", "waterlily", "a Waterlily." }, {"flowers", "waterlily", "a Waterlily." },
{"flowers", "waterlily_225", "a Waterlily." }, {"flowers", "waterlily_225", "a Waterlily." },
{"flowers", "waterlily_45", "a Waterlily." }, {"flowers", "waterlily_45", "a Waterlily." },
{"flowers", "waterlily_675", "a Waterlily." }, {"flowers", "waterlily_675", "a Waterlily." },
{"flowers", "waterlily_s1", "a Waterlily." }, {"flowers", "waterlily_s1", "a Waterlily." },
{"flowers", "waterlily_s2", "a Waterlily." }, {"flowers", "waterlily_s2", "a Waterlily." },
{"flowers", "waterlily_s3", "a Waterlily." }, {"flowers", "waterlily_s3", "a Waterlily." },
{"flowers", "waterlily_s4", "a Waterlily." }, {"flowers", "waterlily_s4", "a Waterlily." },
{"flowers", "seaweed", "some Seaweed."}, {"flowers", "seaweed", "some Seaweed."},
{"flowers", "seaweed_2", "some Seaweed."}, {"flowers", "seaweed_2", "some Seaweed."},
{"flowers", "seaweed_3", "some Seaweed."}, {"flowers", "seaweed_3", "some Seaweed."},
{"flowers", "seaweed_4", "some Seaweed."}, {"flowers", "seaweed_4", "some Seaweed."},
{"trunks", "twig_1", "a Twig." }, {"trunks", "twig_1", "a Twig." },
{"trunks", "twig_2", "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", "fishing_bobber.png",
"fishing_bobber.png^[transformFX" "fishing_bobber.png^[transformFX"
}, -- }, --
groups = {not_in_creative_inventory=1}, groups = {not_in_creative_inventory=1},
}) })
@ -123,7 +123,7 @@ local FISHING_BOBBER_ENTITY={
}) })
self.object:remove() self.object:remove()
end, 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) on_rightclick = function (self, clicker)
local item = clicker:get_wielded_item() local item = clicker:get_wielded_item()
local player = clicker:get_player_name() 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"}) 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 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=""}) 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 end
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
if inv:room_for_item("main", {name="fishing:bait_worm", count=1, wear=0, metadata=""}) 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" iTeM = "fish_blue_white"
WeaR = 0 WeaR = 0
MeSSaGe = S("a Blue white fish.") MeSSaGe = S("a Blue white fish.")
obj:remove() obj:remove()
end end
end end
-- add (in)visible fish to inventory -- add (in)visible fish to inventory
if inv:room_for_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""}) 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=""}) 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 end
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
if GeTBaiTBack == true 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 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=""}) 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 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
end end
end end
-- weither player has fishing pole or not -- weither player has fishing pole or not
-- make sound and remove bobber -- make sound and remove bobber
minetest.sound_play("fishing_bobber1", { minetest.sound_play("fishing_bobber1", {
@ -240,7 +240,7 @@ local FISHING_BOBBER_ENTITY={
end end
end end
end end
if math.random(1, 4) == 1 then if math.random(1, 4) == 1 then
self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/2880*math.pi)) self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/2880*math.pi))
end end
@ -259,9 +259,9 @@ local FISHING_BOBBER_ENTITY={
minetest.sound_play("fishing_bobber1", {pos = self.object:getpos(),gain = 0.5,}) minetest.sound_play("fishing_bobber1", {pos = self.object:getpos(),gain = 0.5,})
self.object:remove() self.object:remove()
end end
if self.object:get_hp() > 310 then 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) 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 for k, obj in pairs(find_fish) do
@ -274,8 +274,8 @@ local FISHING_BOBBER_ENTITY={
end end
end end
end end
local do_env_damage = function(self) local do_env_damage = function(self)
self.object:set_hp(self.object:get_hp()-self.water_damage) self.object:set_hp(self.object:get_hp()-self.water_damage)
if self.object:get_hp() == 600 then 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}) self.object:moveto({x=pos.x,y=pos.y+0.0625,z=pos.z})
elseif self.object:get_hp() == 285 then elseif self.object:get_hp() == 285 then
self.object:moveto({x=pos.x,y=pos.y-0.1,z=pos.z}) 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: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)) self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/1440*math.pi))
elseif self.object:get_hp() == 0 then elseif self.object:get_hp() == 0 then

View File

@ -34,17 +34,17 @@ local CaTCH_BiG = {
local PLaNTS = { local PLaNTS = {
-- MoD* iTeM MeSSaGe ("You caught "..) -- MoD* iTeM MeSSaGe ("You caught "..)
{"flowers", "waterlily", "a Waterlily." }, {"flowers", "waterlily", "a Waterlily." },
{"flowers", "waterlily_225", "a Waterlily." }, {"flowers", "waterlily_225", "a Waterlily." },
{"flowers", "waterlily_45", "a Waterlily." }, {"flowers", "waterlily_45", "a Waterlily." },
{"flowers", "waterlily_675", "a Waterlily." }, {"flowers", "waterlily_675", "a Waterlily." },
{"flowers", "waterlily_s1", "a Waterlily." }, {"flowers", "waterlily_s1", "a Waterlily." },
{"flowers", "waterlily_s2", "a Waterlily." }, {"flowers", "waterlily_s2", "a Waterlily." },
{"flowers", "waterlily_s3", "a Waterlily." }, {"flowers", "waterlily_s3", "a Waterlily." },
{"flowers", "waterlily_s4", "a Waterlily." }, {"flowers", "waterlily_s4", "a Waterlily." },
{"flowers", "seaweed", "some Seaweed."}, {"flowers", "seaweed", "some Seaweed."},
{"flowers", "seaweed_2", "some Seaweed."}, {"flowers", "seaweed_2", "some Seaweed."},
{"flowers", "seaweed_3", "some Seaweed."}, {"flowers", "seaweed_3", "some Seaweed."},
{"flowers", "seaweed_4", "some Seaweed."}, {"flowers", "seaweed_4", "some Seaweed."},
{"trunks", "twig_1", "a Twig." }, {"trunks", "twig_1", "a Twig." },
{"trunks", "twig_2", "a Twig." }, {"trunks", "twig_2", "a Twig." },
@ -83,7 +83,7 @@ local FISHING_BOBBER_ENTITY_SHARK={
}) })
self.object:remove() self.object:remove()
end, 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) on_rightclick = function (self, clicker)
local item = clicker:get_wielded_item() local item = clicker:get_wielded_item()
local player = clicker:get_player_name() 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"}) 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 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=""}) 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 end
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
if inv:room_for_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""}) 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 minetest.get_modpath(MoD) ~= nil then
if inv:room_for_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""}) 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=""}) 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 end
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
if GeTBaiTBack == true 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 if MESSAGES == true then say(player, S("Your fish escaped."), false) end -- fish escaped
end end
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 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 not minetest.setting_getbool("creative_mode") then
if math.random(1, 3) == 1 then if math.random(1, 3) == 1 then
if inv:room_for_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""}) 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=""}) 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 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
--end --end
else else
if MESSAGES == true then say(player, S("Your fish escaped."), false) end -- fish escaped if MESSAGES == true then say(player, S("Your fish escaped."), false) end -- fish escaped
end end
minetest.sound_play("fishing_bobber1", { minetest.sound_play("fishing_bobber1", {
pos = self.object:getpos(), 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}) self.object:moveto({x=pos.x,y=pos.y+0.0625,z=pos.z})
elseif self.object:get_hp() == 285 then elseif self.object:get_hp() == 285 then
self.object:moveto({x=pos.x,y=pos.y-0.0625,z=pos.z}) 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: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)) self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/720*math.pi))
elseif self.object:get_hp() == 0 then elseif self.object:get_hp() == 0 then

View File

@ -14,7 +14,7 @@
-- Wooden Fishing Pole -- Wooden Fishing Pole
minetest.register_craft({ minetest.register_craft({
output = "fishing:pole", output = "fishing:pole",
recipe = { recipe = {
{"", "", "group:stick" }, {"", "", "group:stick" },
{"", "group:stick", "farming:string"}, {"", "group:stick", "farming:string"},
{"group:stick", "", "farming:string"}, {"group:stick", "", "farming:string"},
@ -24,7 +24,7 @@ minetest.register_craft({
if minetest.get_modpath("moreblocks") ~= nil then if minetest.get_modpath("moreblocks") ~= nil then
minetest.register_craft({ minetest.register_craft({
output = "fishing:pole", output = "fishing:pole",
recipe = { recipe = {
{"", "", "group:stick" }, {"", "", "group:stick" },
{"", "group:stick", "moreblocks:rope" }, {"", "group:stick", "moreblocks:rope" },
{"group:stick", "", "moreblocks:rope" }, {"group:stick", "", "moreblocks:rope" },
@ -35,7 +35,7 @@ end
if minetest.get_modpath("ropes") ~= nil then if minetest.get_modpath("ropes") ~= nil then
minetest.register_craft({ minetest.register_craft({
output = "fishing:pole", output = "fishing:pole",
recipe = { recipe = {
{"", "", "group:stick" }, {"", "", "group:stick" },
{"", "group:stick", "ropes:rope" }, {"", "group:stick", "ropes:rope" },
{"group:stick", "", "ropes:rope" }, {"group:stick", "", "ropes:rope" },
@ -47,7 +47,7 @@ end
if minetest.get_modpath("moreores") ~= nil then if minetest.get_modpath("moreores") ~= nil then
minetest.register_craft({ minetest.register_craft({
output = "fishing:pole_perfect", output = "fishing:pole_perfect",
recipe = { recipe = {
{"", "", "moreores:mithril_ingot" }, {"", "", "moreores:mithril_ingot" },
{"", "moreores:mithril_ingot", "mobs:spider_cobweb" }, {"", "moreores:mithril_ingot", "mobs:spider_cobweb" },
{"moreores:mithril_ingot", "", "mobs:spider_cobweb" }, {"moreores:mithril_ingot", "", "mobs:spider_cobweb" },
@ -86,7 +86,7 @@ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = "fishing:sushi", output = "fishing:sushi",
recipe = {"fishing:fish_raw", "farming:seed_wheat", "seaplants:kelpgreen" }, recipe = {"fishing:fish_raw", "farming:seed_wheat", "seaplants:kelpgreen" },
}) })
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------

View File

@ -58,7 +58,7 @@ minetest.register_craftitem("fishing:shark", {
inventory_image = "fishing_shark_cooked.png", inventory_image = "fishing_shark_cooked.png",
on_use = minetest.item_eat(6), on_use = minetest.item_eat(6),
}) })
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
-- Pike -- Pike
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------

View File

@ -77,10 +77,10 @@ minetest.register_tool("fishing:pole", {
gain = 0.5, 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") 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 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 else
return {name="fishing:pole", count=1, wear=0, metadata=""} return {name="fishing:pole", count=1, wear=0, metadata=""}
end end
@ -94,10 +94,10 @@ minetest.register_tool("fishing:pole", {
gain = 0.5, 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") 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 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 else
return {name="fishing:pole", count=1, wear=0, metadata=""} return {name="fishing:pole", count=1, wear=0, metadata=""}
end end
@ -150,10 +150,10 @@ minetest.register_tool("fishing:pole_perfect", {
gain = 0.5, 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") 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 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 else
return {name="fishing:pole_perfect", count=1, wear=0, metadata=""} return {name="fishing:pole_perfect", count=1, wear=0, metadata=""}
end end
@ -167,10 +167,10 @@ minetest.register_tool("fishing:pole_perfect", {
gain = 0.5, 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") 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 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 else
return {name="fishing:pole_perfect", count=1, wear=0, metadata=""} return {name="fishing:pole_perfect", count=1, wear=0, metadata=""}
end end
@ -240,7 +240,7 @@ if SIMPLE_DECO_FISHING_POLE == true then
minetest.remove_node(pos) minetest.remove_node(pos)
end, end,
}) })
--Canne à pêche parfaite deco --Canne à pêche parfaite deco
minetest.register_node("fishing:pole_perfect_deco", { minetest.register_node("fishing:pole_perfect_deco", {
description = S("Perfect Fishing Pole"), description = S("Perfect Fishing Pole"),
@ -348,7 +348,7 @@ else
minetest.remove_node(pos) minetest.remove_node(pos)
end, end,
}) })
--Canne à pêche parfaite deco --Canne à pêche parfaite deco
minetest.register_node("fishing:pole_perfect_deco", { minetest.register_node("fishing:pole_perfect_deco", {
description = S("Perfect Fishing Pole"), description = S("Perfect Fishing Pole"),
@ -455,11 +455,11 @@ else
if pt.type ~= "node" then if pt.type ~= "node" then
return return
end end
local under = minetest.get_node(pt.under) local under = minetest.get_node(pt.under)
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local above = minetest.get_node(p) local above = minetest.get_node(p)
-- return if any of the nodes is not registered -- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then if not minetest.registered_nodes[under.name] then
return return
@ -467,24 +467,24 @@ else
if not minetest.registered_nodes[above.name] then if not minetest.registered_nodes[above.name] then
return return
end end
-- check if the node above the pointed thing is air -- check if the node above the pointed thing is air
if above.name ~= "air" then if above.name ~= "air" then
return return
end end
-- check if pointing at dirt -- check if pointing at dirt
if minetest.get_item_group(under.name, "soil") ~= 1 then if minetest.get_item_group(under.name, "soil") ~= 1 then
return return
end end
-- turn the node into soil, play sound, get worm and wear out item -- turn the node into soil, play sound, get worm and wear out item
minetest.set_node(pt.under, {name="farming:soil"}) minetest.set_node(pt.under, {name="farming:soil"})
minetest.sound_play("default_dig_crumbly", { minetest.sound_play("default_dig_crumbly", {
pos = pt.under, pos = pt.under,
gain = 0.5, gain = 0.5,
}) })
if math.random(1, 100) < WORM_CHANCE then if math.random(1, 100) < WORM_CHANCE then
if WORM_IS_MOB == true 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") minetest.add_entity({x=pt.under.x, y=pt.under.y+0.4, z=pt.under.z}, "fishing:bait_worm_entity")

View File

@ -80,11 +80,11 @@ for i in pairs(TRoPHY) do
return has_trophy_privilege(meta, player) return has_trophy_privilege(meta, player)
end, end,
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = "fishing:trophy_"..iTeM, output = "fishing:trophy_"..iTeM,
recipe = {MoD..":"..iTeM, "default:sign_wall"}, recipe = {MoD..":"..iTeM, "default:sign_wall"},
}) })
end end

View File

@ -69,16 +69,16 @@ minetest.register_entity("fishing:bait_worm_entity", {
if n.name == "air" then -- fall when in air 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:moveto({x=pos.x,y=pos.y-0.5,z=pos.z})
self.object:set_hp(self.object:get_hp()-75) self.object:set_hp(self.object:get_hp()-75)
--if n.name == "snappy" then -- fall when leaves or similar --if n.name == "snappy" then -- fall when leaves or similar
elseif minetest.get_item_group(n.name, "snappy") ~= 0 then 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)))}) 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 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:moveto({x=pos.x,y=pos.y-0.25,z=pos.z})
self.object:set_hp(self.object:get_hp()-37) self.object:set_hp(self.object:get_hp()-37)
elseif minetest.get_item_group(n.name, "soil") ~= 0 then 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 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) 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_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_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_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_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_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_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") 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 there's dirt nearby, go there
if goal_01 ~= 0 or goal_1a ~= 0 then 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 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 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 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 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
end end
look_whats_up(self) look_whats_up(self)
end, end,

View File

@ -24,7 +24,7 @@ function ForceloadManager(filetoopen, hide_file_errors)
end end
end end
for i = 1, #blocks do 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])) minetest.log("error", "Failed to load block " .. minetest.pos_to_string(blocks[i]))
end end
end end
@ -40,7 +40,7 @@ function ForceloadManager(filetoopen, hide_file_errors)
end, end,
unload = function(self, pos) unload = function(self, pos)
for i = 1, #self._blocks do 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) minetest.forceload_free_block(pos)
table.remove(self._blocks, i) table.remove(self._blocks, i)
return true return true
@ -56,16 +56,16 @@ function ForceloadManager(filetoopen, hide_file_errors)
end end
end, end,
verify = function(self) verify = function(self)
return self:verify_each(function(pos, block) return self:verify_each(function(pos, block)
local name = "ignore" local name = "ignore"
if block ~= nil then if block ~= nil then
name = block.name name = block.name
end end
if name == "ignore" then if name == "ignore" then
if not pos.last or elapsed_time > pos.last + 15 then if not pos.last or elapsed_time > pos.last + 15 then
pos.last = elapsed_time 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)) minetest.log("error", "Failed to force load " .. minetest.pos_to_string(pos))
pos.remove = true pos.remove = true
end end
@ -74,15 +74,15 @@ function ForceloadManager(filetoopen, hide_file_errors)
elseif name == "forceload:anchor" then elseif name == "forceload:anchor" then
pos.last = elapsed_time pos.last = elapsed_time
return true return true
else else
minetest.log("error", minetest.pos_to_string(pos) .. " shouldn't be loaded") minetest.log("error", minetest.pos_to_string(pos) .. " shouldn't be loaded")
pos.remove = true pos.remove = true
return false return false
end end
end) end)
end, end,
verify_each = function(self, func) verify_each = function(self, func)
local not_loaded = {} local not_loaded = {}
for i = 1, #self._blocks do for i = 1, #self._blocks do
local res = minetest.get_node(self._blocks[i]) local res = minetest.get_node(self._blocks[i])
if not func(self._blocks[i], res) then 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(), if not minetest.check_player_privs(placer:get_player_name(),
{forceload = true}) then {forceload = true}) then
minetest.chat_send_player(placer:get_player_name(), "The forceload privilege is required to do that.") 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") flm:save(minetest.get_worldpath().."/flm.json")
return return
end end
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
return true return true
end end

View File

@ -87,7 +87,7 @@ function add_coloured_framedglass(name, desc, dye)
use_texture_alpha = true, use_texture_alpha = true,
groups = {cracky=3}, groups = {cracky=3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",

View File

@ -12,7 +12,7 @@ local hp_bar = {
function hp_bar:on_step(dtime) function hp_bar:on_step(dtime)
local wielder = self.wielder local wielder = self.wielder
if wielder == nil then if wielder == nil then
self.object:remove() self.object:remove()
return return
elseif minetest.get_player_by_name(wielder:get_player_name()) == nil then elseif minetest.get_player_by_name(wielder:get_player_name()) == nil then

View File

@ -18,7 +18,7 @@ end
function hud.set_armor(player_name, ges_state, items) function hud.set_armor(player_name, ges_state, items)
local max_items = 4 local max_items = 4
if items == 5 then if items == 5 then
max_items = items max_items = items
end end
local max = max_items * 65535 local max = max_items * 65535

View File

@ -17,7 +17,7 @@ local function poisenp(tick, time, time_left, player)
if player:get_hp()-1 > 0 then if player:get_hp()-1 > 0 then
player:set_hp(player:get_hp()-1) player:set_hp(player:get_hp()-1)
end end
end end
function hud.item_eat(hunger_change, replace_with_item, poisen, heal) 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:chicken_cooked", 4)
overwrite("mobs:egg", 1) overwrite("mobs:egg", 1)
overwrite("mobs:chicken_egg_fried", 2) 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") overwrite("mobs:bucket_milk", 3, "bucket:bucket_empty")
end end
end end

View File

@ -49,7 +49,7 @@ HUD_TICK = 0.1
--Some hunger settings --Some hunger settings
hud.exhaustion = {} -- Exhaustion is experimental! 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_DIG = 3 -- exhaustion increased this value after digged node
HUD_HUNGER_EXHAUST_PLACE = 1 -- exhaustion increased this value after placed 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 HUD_HUNGER_EXHAUST_MOVE = 0.3 -- exhaustion increased this value if player movement detected
@ -69,7 +69,7 @@ end
--load custom settings --load custom settings
local set = io.open(minetest.get_modpath("hud").."/hud.conf", "r") local set = io.open(minetest.get_modpath("hud").."/hud.conf", "r")
if set then if set then
dofile(minetest.get_modpath("hud").."/hud.conf") dofile(minetest.get_modpath("hud").."/hud.conf")
set:close() set:close()
else else
@ -243,7 +243,7 @@ hud.set_hunger = function(player)
if not inv or not value then return nil end if not inv or not value then return nil end
if value > 30 then value = 30 end if value > 30 then value = 30 end
if value < 0 then value = 0 end if value < 0 then value = 0 end
inv:set_stack("hunger", 1, ItemStack({name=":", count=value+1})) inv:set_stack("hunger", 1, ItemStack({name=":", count=value+1}))
return true return true
@ -321,7 +321,7 @@ minetest.after(2.5, function()
-- update all hud elements -- update all hud elements
update_hud(player) update_hud(player)
if HUD_ENABLE_HUNGER then if HUD_ENABLE_HUNGER then
local controls = player:get_player_control() local controls = player:get_player_control()
-- Determine if the player is walking -- Determine if the player is walking
@ -331,7 +331,7 @@ minetest.after(2.5, function()
end end
end end
end end
end end
if timer > 4 then timer = 0 end if timer > 4 then timer = 0 end
if timer2 > HUD_HUNGER_TICK then timer2 = 0 end if timer2 > HUD_HUNGER_TICK then timer2 = 0 end

View File

@ -30,6 +30,6 @@ minetest.register_chatcommand("inv", {
invlist = invlist..items.." | " invlist = invlist..items.." | "
end end
end end
minetest.chat_send_player(name, invlist) minetest.chat_send_player(name, invlist)
end, end,
}) })

View File

@ -156,7 +156,7 @@ tweak.sort = function(player, mode, con)
if inv then if inv then
local list = inv:get_list("main") local list = inv:get_list("main")
local tmp_list = {} local tmp_list = {}
--write whole list as table --write whole list as table
for _,stack in ipairs(list) do for _,stack in ipairs(list) do
local tbl_stack = stack:to_table() local tbl_stack = stack:to_table()

View File

@ -46,13 +46,13 @@ function irc:bot_command(msg, text)
cmd = text cmd = text
args = "" args = ""
end end
if not self.bot_commands[cmd] then if not self.bot_commands[cmd] then
self:reply("Unknown command '"..cmd.."'. Try 'list'." self:reply("Unknown command '"..cmd.."'. Try 'list'."
.." Or use @playername <message> to send a private message") .." Or use @playername <message> to send a private message")
return return
end end
local success, message = self.bot_commands[cmd].func(msg.user, args) local success, message = self.bot_commands[cmd].func(msg.user, args)
if message then if message then
self:reply(message) self:reply(message)

View File

@ -10,7 +10,7 @@ function irc:player_part(name)
self.joined_players[name] = nil self.joined_players[name] = nil
minetest.chat_send_player(name, "IRC: You are now out of the channel.") minetest.chat_send_player(name, "IRC: You are now out of the channel.")
end end
function irc:player_join(name) function irc:player_join(name)
if self.joined_players[name] then if self.joined_players[name] then
minetest.chat_send_player(name, "IRC: You are already in the channel.") minetest.chat_send_player(name, "IRC: You are already in the channel.")
@ -28,7 +28,7 @@ minetest.register_chatcommand("join", {
irc:player_join(name) irc:player_join(name)
end end
}) })
minetest.register_chatcommand("part", { minetest.register_chatcommand("part", {
description = "Part the IRC channel", description = "Part the IRC channel",
privs = {shout=true}, privs = {shout=true},
@ -36,7 +36,7 @@ minetest.register_chatcommand("part", {
irc:player_part(name) irc:player_part(name)
end end
}) })
minetest.register_chatcommand("who", { minetest.register_chatcommand("who", {
description = "Tell who is currently on the channel", description = "Tell who is currently on the channel",
privs = {}, privs = {},
@ -49,13 +49,13 @@ minetest.register_chatcommand("who", {
end end
}) })
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
local name = player:get_player_name() local name = player:get_player_name()
irc.joined_players[name] = irc.config.auto_join irc.joined_players[name] = irc.config.auto_join
end) end)
minetest.register_on_leaveplayer(function(player) minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name() local name = player:get_player_name()
irc.joined_players[name] = nil irc.joined_players[name] = nil

View File

@ -7,7 +7,7 @@ minetest.register_globalstep(function(dtime)
if player:get_hp() > 0 or not enable_damage then if player:get_hp() > 0 or not enable_damage then
local pos = player:getpos() local pos = player:getpos()
local inv = player:get_inventory() local inv = player:get_inventory()
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do 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 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 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 end
end end
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do 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 not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
if object:get_luaentity().always_collect then if object:get_luaentity().always_collect then
@ -37,7 +37,7 @@ minetest.register_globalstep(function(dtime)
object:get_luaentity().object:set_properties({ object:get_luaentity().object:set_properties({
physical = false physical = false
}) })
minetest.after(1, function(args) minetest.after(1, function(args)
local lua = object:get_luaentity() local lua = object:get_luaentity()
if object == nil or lua == nil or lua.itemstring == nil then if object == nil or lua == nil or lua.itemstring == nil then
@ -58,7 +58,7 @@ minetest.register_globalstep(function(dtime)
}) })
end end
end, {player, object}) end, {player, object})
end end
end end
end end
@ -86,7 +86,7 @@ function minetest.handle_node_drops(pos, drops, digger)
local obj local obj
local x = math.random(1, 5) local x = math.random(1, 5)
if math.random(1,2) == 1 then x = -x end if math.random(1,2) == 1 then x = -x end
local z = math.random(1, 5) local z = math.random(1, 5)
if math.random(1,2) == 1 then z = -z end if math.random(1,2) == 1 then z = -z end

View File

@ -17,8 +17,8 @@ minetest.register_node("lantern:lantern", {
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
node_box = { node_box = {
type = "wallmounted", type = "wallmounted",
wall_top = {-1/6, 1/6, -1/6, 1/6, 0.5, 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_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}, 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", inventory_image = "candle_inv.png",
tiles = { tiles = {
{name="candle.png", animation={type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 0.8}}, {name="candle.png", animation={type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 0.8}},
}, },
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
@ -184,16 +184,16 @@ minetest.register_node("lantern:lamp1", {
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
selection_box = { selection_box = {
type = "fixed", 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) 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})
minetest.remove_node({x = pos.x + 1, 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 , 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 - 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 - 2, z = pos.z })
end end
}) })
minetest.register_node("lantern:lamp2", { minetest.register_node("lantern:lamp2", {
description = "Lamp2", description = "Lamp2",
@ -207,16 +207,16 @@ minetest.register_node("lantern:lamp2", {
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
selection_box = { selection_box = {
type = "fixed", 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) 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})
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 + 1})
minetest.remove_node({x = pos.x, y = pos.y , 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 - 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 - 2, z = pos.z + 1})
end end
}) })
minetest.register_node("lantern:lamp3", { minetest.register_node("lantern:lamp3", {
description = "Lamp3", description = "Lamp3",
@ -230,16 +230,16 @@ minetest.register_node("lantern:lamp3", {
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
selection_box = { selection_box = {
type = "fixed", 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) 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})
minetest.remove_node({x = pos.x - 1, 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 , 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 - 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 - 2, z = pos.z})
end end
}) })
minetest.register_node("lantern:lamp4", { minetest.register_node("lantern:lamp4", {
description = "Lamp4", description = "Lamp4",
@ -253,16 +253,16 @@ minetest.register_node("lantern:lamp4", {
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
selection_box = { selection_box = {
type = "fixed", 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) 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})
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 - 1})
minetest.remove_node({x = pos.x, y = pos.y , 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 - 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 - 2, z = pos.z - 1})
end end
}) })
-- --
-- register crafting recipes: -- register crafting recipes:

View File

@ -17,7 +17,7 @@ minetest.register_globalstep(function(dtime)
if string.sub(wielded_item, 0, 18) == "lavatemple:dagger_" then if string.sub(wielded_item, 0, 18) == "lavatemple:dagger_" then
player:set_wielded_item("lavatemple:dagger_"..compass_image) player:set_wielded_item("lavatemple:dagger_"..compass_image)
else else
if player:get_inventory() then if player:get_inventory() then
for i,stack in ipairs(player:get_inventory():get_list("main")) do for i,stack in ipairs(player:get_inventory():get_list("main")) do
if string.sub(stack:get_name(), 0, 18) == "lavatemple:dagger_" and if string.sub(stack:get_name(), 0, 18) == "lavatemple:dagger_" and
stack:get_name() ~= "lavatemple:dagger_"..compass_image then stack:get_name() ~= "lavatemple:dagger_"..compass_image then

View File

@ -2,11 +2,11 @@ lavatemple.mapgen_data = {}
lavatemple.file = minetest.get_worldpath()..'/lavatemple.mt' lavatemple.file = minetest.get_worldpath()..'/lavatemple.mt'
-- try to load the data from file -- try to load the data from file
local f = io.open(lavatemple.file, "r") local f = io.open(lavatemple.file, "r")
if f then if f then
local contents = f:read() local contents = f:read()
io.close(f) io.close(f)
if contents ~= nil then if contents ~= nil then
lavatemple.mapgen_data = minetest.deserialize(contents) lavatemple.mapgen_data = minetest.deserialize(contents)
end end
end end
@ -25,7 +25,7 @@ if type (lavatemple.mapgen_data) ~= "table" or
y=math.random(-500,-50), y=math.random(-500,-50),
z=math.random(-2000,2000) z=math.random(-2000,2000)
} }
-- save data -- save data
local f = io.open(lavatemple.file, "w") local f = io.open(lavatemple.file, "w")
f:write(minetest.serialize(lavatemple.mapgen_data)) f:write(minetest.serialize(lavatemple.mapgen_data))

View File

@ -26,7 +26,7 @@ minetest.register_node("lavatemple:ladder", {
sunlight_propagates = true, sunlight_propagates = true,
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
climbable = true, climbable = true,
walkable = true, walkable = true,
node_box = { node_box = {
type = "wallmounted", type = "wallmounted",
wall_top = {-0.375, 0.4375, -0.5, 0.375, 0.5, 0.5}, wall_top = {-0.375, 0.4375, -0.5, 0.375, 0.5, 0.5},

View File

@ -39,7 +39,7 @@ end
API functions API functions
]===] ]===]
function mana.set(playername, value) function mana.set(playername, value)
if value < 0 then if value < 0 then
minetest.log("info", "[mana] Warning: mana.set was called with negative value!") minetest.log("info", "[mana] Warning: mana.set was called with negative value!")
value = 0 value = 0
@ -108,7 +108,7 @@ function mana.add(playername, value)
local t = mana.playerlist[playername] local t = mana.playerlist[playername]
value = mana.round(value) value = mana.round(value)
if(t ~= nil and ((t.mana + value) <= t.maxmana) and value >= 0) then if(t ~= nil and ((t.mana + value) <= t.maxmana) and value >= 0) then
t.mana = t.mana + value t.mana = t.mana + value
mana.hud_update(playername) mana.hud_update(playername)
return true return true
else else
@ -120,7 +120,7 @@ function mana.subtract(playername, value)
local t = mana.playerlist[playername] local t = mana.playerlist[playername]
value = mana.round(value) value = mana.round(value)
if(t ~= nil and t.mana >= value and value >= 0) then if(t ~= nil and t.mana >= value and value >= 0) then
t.mana = t.mana -value t.mana = t.mana -value
mana.hud_update(playername) mana.hud_update(playername)
return true return true
else else
@ -212,7 +212,7 @@ end)
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
local playername = player:get_player_name() local playername = player:get_player_name()
if mana.playerlist[playername] == nil then if mana.playerlist[playername] == nil then
mana.playerlist[playername] = {} mana.playerlist[playername] = {}
mana.playerlist[playername].mana = 0 mana.playerlist[playername].mana = 0
@ -285,7 +285,7 @@ else
function mana.manastring(playername) function mana.manastring(playername)
return string.format("Mana: %d/%d", mana.get(playername), mana.getmax(playername)) return string.format("Mana: %d/%d", mana.get(playername), mana.getmax(playername))
end end
function mana.hud_add(playername) function mana.hud_add(playername)
local player = minetest.get_player_by_name(playername) local player = minetest.get_player_by_name(playername)
id = player:hud_add({ id = player:hud_add({
@ -312,12 +312,12 @@ else
mana.playerlist[playername].hudid = id mana.playerlist[playername].hudid = id
return id return id
end end
function mana.hud_update(playername) function mana.hud_update(playername)
local player = minetest.get_player_by_name(playername) local player = minetest.get_player_by_name(playername)
player:hud_change(mana.playerlist[playername].hudid, "text", mana.manastring(playername)) player:hud_change(mana.playerlist[playername].hudid, "text", mana.manastring(playername))
end end
function mana.hud_remove(playername) function mana.hud_remove(playername)
local player = minetest.get_player_by_name(playername) local player = minetest.get_player_by_name(playername)
player:hud_remove(mana.playerlist[playername].hudid) player:hud_remove(mana.playerlist[playername].hudid)

View File

@ -438,15 +438,15 @@ local function find_dock(pos, second)
local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2}
if second > 0 then if second > 0 then
local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} 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 end
elseif code == 0 then elseif code == 0 then
if second == 2 then if second == 2 then
local tmp_node = {name="fences:fence_wood", param1=me.param1, param2=me.param2} 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 end
end end

View File

@ -100,10 +100,10 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se
table.insert( id_list, id ); table.insert( id_list, id );
end end
end end
elseif( mode=='all' ) then elseif( mode=='all' ) then
title = 'All areas:'; title = 'All areas:';
tlabel = '*all areas*'; tlabel = '*all areas*';
for id, area in pairs(areas.areas) do for id, area in pairs(areas.areas) do
@ -128,7 +128,7 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se
"label[4.7,0;"..tlabel.."]".. "label[4.7,0;"..tlabel.."]"..
"label[0.5,8.5;Doubleclick to select area.]".. "label[0.5,8.5;Doubleclick to select area.]"..
"label[4.7,8.5;Areas found: "..tostring( #id_list )..".]".. "label[4.7,8.5;Areas found: "..tostring( #id_list )..".]"..
"textlist[0.5,0.5;7,8;markers_area_list_selection;"; "textlist[0.5,0.5;7,8;markers_area_list_selection;";
local liste = ''; local liste = '';
for i,v in ipairs( id_list ) do for i,v in ipairs( id_list ) do
@ -136,7 +136,7 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se
liste = liste..','; liste = liste..',';
end end
liste = liste..minetest.formspec_escape( areas:toString( v ) ); liste = liste..minetest.formspec_escape( areas:toString( v ) );
end end
-- highlight selected entry -- highlight selected entry
@ -145,14 +145,14 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se
else else
formspec = formspec..liste..';]'; formspec = formspec..liste..';]';
end end
local pname = player:get_player_name(); local pname = player:get_player_name();
if( not( markers.menu_data_by_player[ pname ] )) then if( not( markers.menu_data_by_player[ pname ] )) then
markers.menu_data_by_player[ pname ] = {}; markers.menu_data_by_player[ pname ] = {};
end end
-- display information about the location of the area the player clicked on -- display information about the location of the area the player clicked on
if( selected if( selected
and id_list[ selected ] and id_list[ selected ]
and areas.areas[ id_list[ selected ]] ) then and areas.areas[ id_list[ selected ]] ) then
@ -171,7 +171,7 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se
if( this_area.parent) then if( this_area.parent) then
formspec = formspec.. formspec = formspec..
'button[8.0,0.5;2,0.5;show_parent;'.. 'button[8.0,0.5;2,0.5;show_parent;'..
minetest.formspec_escape( areas.areas[ this_area.parent ].name )..']'; minetest.formspec_escape( areas.areas[ this_area.parent ].name )..']';
end end
@ -180,7 +180,7 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se
'button[8.0,1.0;2,0.5;list_subareas;'.. 'button[8.0,1.0;2,0.5;list_subareas;'..
minetest.formspec_escape( 'List subareas ('..tostring( #subareas )..')')..']'; minetest.formspec_escape( 'List subareas ('..tostring( #subareas )..')')..']';
end end
if( mode=='player' ) then if( mode=='player' ) then
formspec = formspec.. formspec = formspec..
@ -208,8 +208,8 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se
selected = id_list[ selected ], selected = id_list[ selected ],
}; };
return formspec; return formspec;
end end
@ -264,7 +264,7 @@ markers.get_area_desc_formspec = function( id, player, pos )
and this_area.parent and this_area.parent
and areas.areas[ this_area.parent ] and areas.areas[ this_area.parent ]
and areas.areas[ this_area.parent ].owner == pname ) then and areas.areas[ this_area.parent ].owner == pname ) then
formspec = formspec.. formspec = formspec..
'button_exit[8.0,1.0;2,0.5;delete;Delete subarea]'.. 'button_exit[8.0,1.0;2,0.5;delete;Delete subarea]'..
'button_exit[8.0,2.0;2,0.5;list_player_areas;Player\'s areas]'; 'button_exit[8.0,2.0;2,0.5;list_player_areas;Player\'s areas]';
@ -311,12 +311,12 @@ markers.get_area_desc_formspec = function( id, player, pos )
else else
formspec = formspec.. formspec = formspec..
'label[4.7,2.5;-none-]'; 'label[4.7,2.5;-none-]';
if( is_owner ) then if( is_owner ) then
formspec = formspec.. formspec = formspec..
'button_exit[8.0,2.5;2,0.5;add_owner;Add]'; 'button_exit[8.0,2.5;2,0.5;add_owner;Add]';
end end
end end
-- is the area a subarea? -- is the area a subarea?
@ -326,7 +326,7 @@ markers.get_area_desc_formspec = function( id, player, pos )
'label[4.7,3.0;'..minetest.formspec_escape( areas.areas[ this_area.parent ].name..' ['..this_area.parent..']' )..']'.. 'label[4.7,3.0;'..minetest.formspec_escape( areas.areas[ this_area.parent ].name..' ['..this_area.parent..']' )..']'..
'button_exit[8.0,3.0;2,0.5;show_parent;Show main area]'; 'button_exit[8.0,3.0;2,0.5;show_parent;Show main area]';
end end
-- does the area have subareas, i.e. is it a parent area for others? -- does the area have subareas, i.e. is it a parent area for others?
local sub_areas = {}; local sub_areas = {};
@ -377,14 +377,14 @@ markers.get_area_desc_formspec = function( id, player, pos )
-- player selected -- player selected
markers.menu_data_by_player[ pname ] = markers.menu_data_by_player[ pname ] =
{ typ = 'show_area', { typ = 'show_area',
mode = nil, mode = nil,
pos = pos, pos = pos,
mode_data = nil, mode_data = nil,
list = nil, list = nil,
selected = id, selected = id,
}; };
return formspec; return formspec;
end end
@ -399,10 +399,10 @@ markers.show_compass_marker = function( col_offset, row_offset, with_text, pos,
-- TODO: what if checked with a land claim register? -- TODO: what if checked with a land claim register?
-- if possible, show how far the area streches into each direction relative to pos -- if possible, show how far the area streches into each direction relative to pos
if( pos.x >= pos1.x and pos.x <= pos2.x if( pos.x >= pos1.x and pos.x <= pos2.x
and pos.y >= pos1.y and pos.y <= pos2.y and pos.y >= pos1.y and pos.y <= pos2.y
and pos.z >= pos1.z and pos.z <= pos2.z ) then and pos.z >= pos1.z and pos.z <= pos2.z ) then
if( with_text ) then if( with_text ) then
formspec = formspec.. formspec = formspec..
'label[0.5,5.5;Dimensions of the area in relation to..]'.. 'label[0.5,5.5;Dimensions of the area in relation to..]'..
@ -454,7 +454,7 @@ markers.show_compass_marker = function( col_offset, row_offset, with_text, pos,
'label['..(col_offset+0.1)..','..(row_offset-0.80)..';'..starts_north..']'.. 'label['..(col_offset+0.1)..','..(row_offset-0.80)..';'..starts_north..']'..
'label['..(col_offset+0.1)..','..(row_offset+0.80)..';'..starts_south..']'; 'label['..(col_offset+0.1)..','..(row_offset+0.80)..';'..starts_south..']';
end end
return formspec; return formspec;
end end
@ -469,32 +469,32 @@ markers.form_input_handler_areas = function( player, formname, fields)
if( formname ~= "markers:info" if( formname ~= "markers:info"
or not( player ) or not( player )
or not( markers.menu_data_by_player[ pname ] )) then or not( markers.menu_data_by_player[ pname ] )) then
return false; return false;
end end
local menu_data = markers.menu_data_by_player[ pname ]; local menu_data = markers.menu_data_by_player[ pname ];
local formspec = ''; local formspec = '';
-- rename an area -- rename an area
if( fields.rename if( fields.rename
and menu_data.selected and menu_data.selected
and areas.areas[ menu_data.selected ] and areas.areas[ menu_data.selected ]
and areas.areas[ menu_data.selected ].owner == pname ) then and areas.areas[ menu_data.selected ].owner == pname ) then
local area = areas.areas[ menu_data.selected ]; local area = areas.areas[ menu_data.selected ];
if( not( area.name )) then if( not( area.name )) then
area.name = '-enter area name-'; area.name = '-enter area name-';
end end
formspec = 'field[rename_new_name;Enter new name for area:;'..minetest.formspec_escape( area.name )..']'; formspec = 'field[rename_new_name;Enter new name for area:;'..minetest.formspec_escape( area.name )..']';
elseif( fields.rename_new_name elseif( fields.rename_new_name
and menu_data.selected and menu_data.selected
and areas.areas[ menu_data.selected ] and areas.areas[ menu_data.selected ]
and ((areas.areas[ menu_data.selected ].owner == pname ) and ((areas.areas[ menu_data.selected ].owner == pname )
or minetest.check_player_privs(pname, {areas=true}))) then or minetest.check_player_privs(pname, {areas=true}))) then
local area = areas.areas[ menu_data.selected ]; local area = areas.areas[ menu_data.selected ];
-- actually rename the area -- actually rename the area
@ -504,14 +504,14 @@ markers.form_input_handler_areas = function( player, formname, fields)
minetest.chat_send_player( pname, 'Area successfully renamed.'); minetest.chat_send_player( pname, 'Area successfully renamed.');
-- shwo the renamed area -- shwo the renamed area
formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos ); formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos );
-- change owner the area -- change owner the area
elseif( fields.change_owner elseif( fields.change_owner
and menu_data.selected and menu_data.selected
and areas.areas[ menu_data.selected ] ) then and areas.areas[ menu_data.selected ] ) then
-- there are no checks here - those happen when the area is transferred -- there are no checks here - those happen when the area is transferred
local area = areas.areas[ menu_data.selected ]; local area = areas.areas[ menu_data.selected ];
formspec = 'field[change_owner_name;Give area \"'..minetest.formspec_escape( area.name )..'\" to player:;-enter name of NEW OWNER-]'; formspec = 'field[change_owner_name;Give area \"'..minetest.formspec_escape( area.name )..'\" to player:;-enter name of NEW OWNER-]';
@ -523,9 +523,9 @@ markers.form_input_handler_areas = function( player, formname, fields)
local area = areas.areas[ menu_data.selected ]; local area = areas.areas[ menu_data.selected ];
-- only own areas can be transfered to another player (or if the areas priv is there) -- only own areas can be transfered to another player (or if the areas priv is there)
if( area.owner ~= pname if( area.owner ~= pname
and not( minetest.check_player_privs(pname, {areas=true}))) then and not( minetest.check_player_privs(pname, {areas=true}))) then
minetest.chat_send_player( pname, 'Permission denied. You do not own the area.'); minetest.chat_send_player( pname, 'Permission denied. You do not own the area.');
elseif( not( areas:player_exists( fields.change_owner_name ))) then elseif( not( areas:player_exists( fields.change_owner_name ))) then
@ -550,11 +550,11 @@ markers.form_input_handler_areas = function( player, formname, fields)
and menu_data.selected and menu_data.selected
and areas.areas[ menu_data.selected ] and areas.areas[ menu_data.selected ]
and areas.areas[ menu_data.selected ].owner == pname ) then and areas.areas[ menu_data.selected ].owner == pname ) then
local area = areas.areas[ menu_data.selected ]; local area = areas.areas[ menu_data.selected ];
formspec = 'field[add_owner_name;Grant access to area \"'..minetest.formspec_escape( area.name )..'\" to player:;-enter player name-]'; formspec = 'field[add_owner_name;Grant access to area \"'..minetest.formspec_escape( area.name )..'\" to player:;-enter player name-]';
elseif( fields.add_owner_name elseif( fields.add_owner_name
-- the player has to own the area already; we need a diffrent name here -- the player has to own the area already; we need a diffrent name here
and fields.add_owner_name ~= pname and fields.add_owner_name ~= pname
and menu_data.selected and menu_data.selected
@ -594,20 +594,20 @@ markers.form_input_handler_areas = function( player, formname, fields)
-- delete area -- delete area
elseif( fields.delete elseif( fields.delete
and menu_data.selected and menu_data.selected
and areas.areas[ menu_data.selected ] ) then and areas.areas[ menu_data.selected ] ) then
local area = areas.areas[ menu_data.selected ]; local area = areas.areas[ menu_data.selected ];
-- a player can only delete own areas or subareas of own areas -- a player can only delete own areas or subareas of own areas
if( area.owner ~= pname if( area.owner ~= pname
and not( area.parent and not( area.parent
and areas.areas[ area.parent ] and areas.areas[ area.parent ]
and areas.areas[ area.parent ].owner and areas.areas[ area.parent ].owner
and areas.areas[ area.parent ].owner == pname ) and areas.areas[ area.parent ].owner == pname )
and not( minetest.check_player_privs(pname, {areas=true}))) then and not( minetest.check_player_privs(pname, {areas=true}))) then
minetest.chat_send_player( pname, 'Permission denied. You own neither the area itshelf nor its parent area.'); minetest.chat_send_player( pname, 'Permission denied. You own neither the area itshelf nor its parent area.');
-- shwo the area where the renaming failed -- shwo the area where the renaming failed
formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos ); formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos );
@ -620,10 +620,10 @@ markers.form_input_handler_areas = function( player, formname, fields)
end end
elseif( fields.delete_confirm elseif( fields.delete_confirm
and menu_data.selected and menu_data.selected
and areas.areas[ menu_data.selected ] ) then and areas.areas[ menu_data.selected ] ) then
local area = areas.areas[ menu_data.selected ]; local area = areas.areas[ menu_data.selected ];
local old_owner = area.owner; local old_owner = area.owner;
@ -635,13 +635,13 @@ markers.form_input_handler_areas = function( player, formname, fields)
end end
-- a player can only delete own areas or subareas of own areas -- a player can only delete own areas or subareas of own areas
if( area.owner ~= pname if( area.owner ~= pname
and not( area.parent and not( area.parent
and areas.areas[ area.parent ] and areas.areas[ area.parent ]
and areas.areas[ area.parent ].owner and areas.areas[ area.parent ].owner
and areas.areas[ area.parent ].owner == pname ) and areas.areas[ area.parent ].owner == pname )
and not( minetest.check_player_privs(pname, {areas=true}))) then and not( minetest.check_player_privs(pname, {areas=true}))) then
minetest.chat_send_player( pname, 'Permission denied. You own neither the area itshelf nor its parent area.'); minetest.chat_send_player( pname, 'Permission denied. You own neither the area itshelf nor its parent area.');
-- shwo the renamed area -- shwo the renamed area
formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos ); formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos );
@ -652,7 +652,7 @@ markers.form_input_handler_areas = function( player, formname, fields)
formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos ); formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos );
-- only areas without subareas can be deleted -- only areas without subareas can be deleted
elseif( #subareas > 0 ) then elseif( #subareas > 0 ) then
minetest.chat_send_player( pname, 'The area has '..tostring( #subareas )..' subarea(s). Please delete those first!'); minetest.chat_send_player( pname, 'The area has '..tostring( #subareas )..' subarea(s). Please delete those first!');
formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos ); formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos );
@ -666,9 +666,9 @@ markers.form_input_handler_areas = function( player, formname, fields)
formspec = markers.get_area_list_formspec(ppos, player, 'player', menu_data.pos, old_owner, nil ); formspec = markers.get_area_list_formspec(ppos, player, 'player', menu_data.pos, old_owner, nil );
end end
elseif( fields.show_parent
elseif( fields.show_parent
and menu_data.selected and menu_data.selected
and areas.areas[ menu_data.selected ] and areas.areas[ menu_data.selected ]
and areas.areas[ menu_data.selected ].parent ) then and areas.areas[ menu_data.selected ].parent ) then
@ -693,7 +693,7 @@ markers.form_input_handler_areas = function( player, formname, fields)
elseif( fields.list_main_areas ) then elseif( fields.list_main_areas ) then
formspec = markers.get_area_list_formspec(ppos, player, 'main_areas', menu_data.pos, nil, nil ); formspec = markers.get_area_list_formspec(ppos, player, 'main_areas', menu_data.pos, nil, nil );
elseif( fields.list_areas_at elseif( fields.list_areas_at
and menu_data.pos ) then and menu_data.pos ) then
@ -740,7 +740,7 @@ markers.show_marker_stone_formspec = function( player, pos )
local pname = player:get_player_name(); local pname = player:get_player_name();
local ppos = pos local ppos = pos
-- this table stores the list the player may have selected from; at the beginning, there is no list -- this table stores the list the player may have selected from; at the beginning, there is no list
if( not( markers.menu_data_by_player[ pname ] )) then if( not( markers.menu_data_by_player[ pname ] )) then
markers.menu_data_by_player[ pname ] = { markers.menu_data_by_player[ pname ] = {
typ = 'area_list', typ = 'area_list',
@ -787,7 +787,7 @@ markers.show_marker_stone_formspec = function( player, pos )
'label[0.5,0.5;This position is not protected.]'.. 'label[0.5,0.5;This position is not protected.]'..
'button[1.0,1.5;2,0.5;list_main_areas;List all main areas]'.. 'button[1.0,1.5;2,0.5;list_main_areas;List all main areas]'..
'button_exit[3.0,1.5;1,0.5;abort;OK]'; 'button_exit[3.0,1.5;1,0.5;abort;OK]';
-- found exactly one areaa - display it -- found exactly one areaa - display it
elseif( #found_areas == 1 ) then elseif( #found_areas == 1 ) then

View File

@ -3,7 +3,7 @@
minetest.register_tool( "markers:land_title_register", minetest.register_tool( "markers:land_title_register",
{ {
description = "Land title register. Left-click with it to get information about who owns the land you clicked on.", description = "Land title register. Left-click with it to get information about who owns the land you clicked on.",
groups = {}, groups = {},
inventory_image = "default_book.png", -- TODO inventory_image = "default_book.png", -- TODO
wield_image = "", wield_image = "",
wield_scale = {x=1,y=1,z=1}, wield_scale = {x=1,y=1,z=1},
@ -30,7 +30,7 @@ minetest.register_tool( "markers:land_title_register",
-- the position is what we're actually looking for -- the position is what we're actually looking for
local pos = minetest.get_pointed_thing_position( pointed_thing, false ); -- not above local pos = minetest.get_pointed_thing_position( pointed_thing, false ); -- not above
if( not( pos ) or not( pos.x )) then if( not( pos ) or not( pos.x )) then
minetest.chat_send_player( name, "Position not found."); minetest.chat_send_player( name, "Position not found.");
return itemstack; return itemstack;
@ -41,7 +41,7 @@ minetest.register_tool( "markers:land_title_register",
return itemstack; -- nothing consumed, nothing changed return itemstack; -- nothing consumed, nothing changed
end, end,
on_use = function(itemstack, placer, pointed_thing) on_use = function(itemstack, placer, pointed_thing)
@ -51,7 +51,7 @@ minetest.register_tool( "markers:land_title_register",
local name = placer:get_player_name(); local name = placer:get_player_name();
local pos = minetest.get_pointed_thing_position( pointed_thing, false ); -- not above local pos = minetest.get_pointed_thing_position( pointed_thing, false ); -- not above
if( not( pos ) or not( pos.x )) then if( not( pos ) or not( pos.x )) then
minetest.chat_send_player( name, "Position not found."); minetest.chat_send_player( name, "Position not found.");
return itemstack; return itemstack;

View File

@ -21,7 +21,7 @@ mobs:register_mob("mobs:bee", {
makes_footstep_sound = false, makes_footstep_sound = false,
sounds = { sounds = {
random = "mobs_bee", random = "mobs_bee",
}, },
-- speed and jump -- speed and jump
walk_velocity = 1, walk_velocity = 1,
jump = true, jump = true,
@ -86,7 +86,7 @@ minetest.register_node("mobs:beehive", {
minetest.add_entity(pos, "mobs:bee") minetest.add_entity(pos, "mobs:bee")
end end
end, end,
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -7,7 +7,7 @@ mobs:register_mob("mobs:bunny", {
-- is it aggressive -- is it aggressive
passive = true, passive = true,
-- health & armor -- health & armor
hp_min = 3, hp_max = 6, armor = 200, hp_min = 3, hp_max = 6, armor = 200,
-- textures and model -- textures and model
collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268}, collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
visual = "mesh", visual = "mesh",

View File

@ -46,7 +46,7 @@ mobs:register_mob("mobs:creeper", {
-- model animation -- model animation
animation = { animation = {
stand_start = 0, stand_end = 24, stand_start = 0, stand_end = 24,
walk_start = 25, walk_end = 47, walk_start = 25, walk_end = 47,
run_start = 48, run_end = 62, run_start = 48, run_end = 62,
punch_start = 48, punch_end = 62, punch_start = 48, punch_end = 62,
speed_normal = 15, speed_run = 15, speed_normal = 15, speed_run = 15,

View File

@ -30,7 +30,7 @@ mobs:register_mob("mobs:greensmall", {
textures = { green_textures }, textures = { green_textures },
blood_texture = "mobs_green_slime_blood.png", blood_texture = "mobs_green_slime_blood.png",
visual_size = {x = 0.5, y = 0.5}, visual_size = {x = 0.5, y = 0.5},
-- sounds a bit here, but mainly define in the beginning -- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false, makes_footstep_sound = false,
sounds = green_sounds, sounds = green_sounds,
-- speed and jump, sinks in water -- speed and jump, sinks in water
@ -76,7 +76,7 @@ mobs:register_mob("mobs:greenmedium", {
textures = { green_textures }, textures = { green_textures },
blood_texture = "mobs_green_slime_blood.png", blood_texture = "mobs_green_slime_blood.png",
visual_size = {x = 1, y = 1}, visual_size = {x = 1, y = 1},
-- sounds a bit here, but mainly define in the beginning -- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false, makes_footstep_sound = false,
sounds = green_sounds, sounds = green_sounds,
-- speed and jump, sinks in water -- speed and jump, sinks in water
@ -125,7 +125,7 @@ mobs:register_mob("mobs:greenbig", {
textures = { green_textures }, textures = { green_textures },
blood_texture = "mobs_green_slime_blood.png", blood_texture = "mobs_green_slime_blood.png",
visual_size = {x = 2, y = 2}, visual_size = {x = 2, y = 2},
-- sounds a bit here, but mainly define in the beginning -- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false, makes_footstep_sound = false,
sounds = green_sounds, sounds = green_sounds,
-- speed and jump, sinks in water -- speed and jump, sinks in water

View File

@ -30,7 +30,7 @@ mobs:register_mob("mobs:lavasmall", {
textures = { lava_textures }, textures = { lava_textures },
blood_texture = "mobs_lava_slime_blood.png", blood_texture = "mobs_lava_slime_blood.png",
visual_size = {x = 0.5, y = 0.5}, visual_size = {x = 0.5, y = 0.5},
-- sounds a bit here, but mainly define in the beginning -- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false, makes_footstep_sound = false,
sounds = lava_sounds, sounds = lava_sounds,
-- speed and jump, sinks in water -- speed and jump, sinks in water
@ -78,7 +78,7 @@ mobs:register_mob("mobs:lavamedium", {
textures = { lava_textures }, textures = { lava_textures },
blood_texture = "mobs_lava_slime_blood.png", blood_texture = "mobs_lava_slime_blood.png",
visual_size = {x = 1, y = 1}, visual_size = {x = 1, y = 1},
-- sounds a bit here, but mainly define in the beginning -- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false, makes_footstep_sound = false,
sounds = lava_sounds, sounds = lava_sounds,
-- speed and jump, sinks in water -- speed and jump, sinks in water
@ -129,7 +129,7 @@ mobs:register_mob("mobs:lavabig", {
textures = { lava_textures }, textures = { lava_textures },
blood_texture = "mobs_lava_slime_blood.png", blood_texture = "mobs_lava_slime_blood.png",
visual_size = {x = 2, y = 2}, visual_size = {x = 2, y = 2},
-- sounds a bit here, but mainly define in the beginning -- sounds a bit here, but mainly define in the beginning
makes_footstep_sound = false, makes_footstep_sound = false,
sounds = lava_sounds, sounds = lava_sounds,
-- speed and jump, sinks in water -- speed and jump, sinks in water

View File

@ -48,7 +48,7 @@ mobs:register_mob("mobs:rat", {
mobs:register_spawn("mobs:rat", {"default:stone"}, 20, 0, 10000, 1, 31000) mobs:register_spawn("mobs:rat", {"default:stone"}, 20, 0, 10000, 1, 31000)
-- register spawn egg -- register spawn egg
mobs:register_egg("mobs:rat", "Rat", "mobs_rat_inventory.png", 0) mobs:register_egg("mobs:rat", "Rat", "mobs_rat_inventory.png", 0)
-- cooked rat, yummy! -- cooked rat, yummy!
minetest.register_craftitem("mobs:rat_cooked", { minetest.register_craftitem("mobs:rat_cooked", {
description = "Cooked Rat", description = "Cooked Rat",

View File

@ -71,7 +71,7 @@ local exist = money.exist
end end
end) --]] end) --]]
--End. --End.
--Registration privileges. --Registration privileges.
--[[minetest.register_privilege("money", "Can use /money [pay <account> <amount>] command") --[[minetest.register_privilege("money", "Can use /money [pay <account> <amount>] command")
minetest.register_privilege("money_admin", { minetest.register_privilege("money_admin", {
@ -134,7 +134,7 @@ minetest.register_privilege("money_admin", {
end end
if param1 and param2 and param3 then --/money pay/take/set/inc/dec <account> <amount> if param1 and param2 and param3 then --/money pay/take/set/inc/dec <account> <amount>
if param1 == "pay" or param1 == "take" or param1 == "set" or param1 == "inc" or param1 == "dec" then if param1 == "pay" or param1 == "take" or param1 == "set" or param1 == "inc" or param1 == "dec" then
if exist(param2) then if exist(param2) then
if tonumber(param3) then if tonumber(param3) then
if tonumber(param3) >= 0 then if tonumber(param3) >= 0 then
param3 = tonumber(param3) param3 = tonumber(param3)
@ -154,7 +154,7 @@ minetest.register_privilege("money_admin", {
end end
else else
minetest.chat_send_player(name, "Your account is frozen.") minetest.chat_send_player(name, "Your account is frozen.")
end end
return true return true
end end
if minetest.get_player_privs(name)["money_admin"] then if minetest.get_player_privs(name)["money_admin"] then
@ -376,7 +376,7 @@ minetest.register_node("money:shop", {
minetest.chat_send_player(sender_name, "In the shop is not enough space.") minetest.chat_send_player(sender_name, "In the shop is not enough space.")
return true return true
elseif get_money(meta:get_string("owner")) - meta:get_string("costsell") < 0 then elseif get_money(meta:get_string("owner")) - meta:get_string("costsell") < 0 then
minetest.chat_send_player(sender_name, "The buyer is not enough money.") minetest.chat_send_player(sender_name, "The buyer is not enough money.")
return true return true
end end
set_money(sender_name, get_money(sender_name) + meta:get_string("costsell")) set_money(sender_name, get_money(sender_name) + meta:get_string("costsell"))
@ -520,7 +520,7 @@ minetest.register_node("money:barter_shop", {
end, end,
}) })
--End. --End.
minetest.register_craft({--Barter shop recipe. minetest.register_craft({--Barter shop recipe.
output = "money:barter_shop", output = "money:barter_shop",
recipe = { recipe = {

View File

@ -93,7 +93,7 @@ minetest.register_node("more_chests:shared", {
end, end,
on_receive_fields = function(pos, formspec, fields, sender) on_receive_fields = function(pos, formspec, fields, sender)
local meta = minetest.get_meta(pos); local meta = minetest.get_meta(pos);
if fields.shared then if fields.shared then
if meta:get_string("owner") == sender:get_player_name() then if meta:get_string("owner") == sender:get_player_name() then
meta:set_string("shared", fields.shared); meta:set_string("shared", fields.shared);
meta:set_string("formspec", get_formspec(fields.shared)) meta:set_string("formspec", get_formspec(fields.shared))

View File

@ -135,7 +135,7 @@ function circular_saw:update_inventory(pos, amount)
self:reset(pos) self:reset(pos)
return return
end end
local stack = inv:get_stack("input", 1) local stack = inv:get_stack("input", 1)
-- At least one "normal" block is necessary to see what kind of stairs are requested. -- At least one "normal" block is necessary to see what kind of stairs are requested.
if stack:is_empty() then if stack:is_empty() then
@ -333,14 +333,14 @@ function circular_saw.can_dig(pos,player)
end end
minetest.register_node("moreblocks:circular_saw", { minetest.register_node("moreblocks:circular_saw", {
description = S("Circular Saw"), description = S("Circular Saw"),
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.4, -0.5, -0.4, -0.25, 0.25, -0.25}, -- Leg {-0.4, -0.5, -0.4, -0.25, 0.25, -0.25}, -- Leg
{0.25, -0.5, 0.25, 0.4, 0.25, 0.4}, -- Leg {0.25, -0.5, 0.25, 0.4, 0.25, 0.4}, -- Leg
{-0.4, -0.5, 0.25, -0.25, 0.25, 0.4}, -- Leg {-0.4, -0.5, 0.25, -0.25, 0.25, 0.4}, -- Leg
{0.25, -0.5, -0.4, 0.4, 0.25, -0.25}, -- Leg {0.25, -0.5, -0.4, 0.4, 0.25, -0.25}, -- Leg
{-0.5, 0.25, -0.5, 0.5, 0.375, 0.5}, -- Tabletop {-0.5, 0.25, -0.5, 0.5, 0.375, 0.5}, -- Tabletop
{-0.01, 0.4375, -0.125, 0.01, 0.5, 0.125}, -- Saw blade (top) {-0.01, 0.4375, -0.125, 0.01, 0.5, 0.125}, -- Saw blade (top)
@ -351,9 +351,9 @@ minetest.register_node("moreblocks:circular_saw", {
tiles = {"moreblocks_circular_saw_top.png", tiles = {"moreblocks_circular_saw_top.png",
"moreblocks_circular_saw_bottom.png", "moreblocks_circular_saw_bottom.png",
"moreblocks_circular_saw_side.png"}, "moreblocks_circular_saw_side.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {choppy = 2,oddly_breakable_by_hand = 2}, groups = {choppy = 2,oddly_breakable_by_hand = 2},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_construct = circular_saw.on_construct, on_construct = circular_saw.on_construct,

View File

@ -461,7 +461,7 @@ minetest.register_craft({
if minetest.setting_getbool("moreblocks.circular_saw_crafting") ~= false then -- “If nil or true then” if minetest.setting_getbool("moreblocks.circular_saw_crafting") ~= false then -- “If nil or true then”
minetest.register_craft({ minetest.register_craft({
output = "moreblocks:circular_saw", output = "moreblocks:circular_saw",
recipe = { recipe = {
{ "", "default:steel_ingot", "" }, { "", "default:steel_ingot", "" },
{ "group:wood", "group:wood", "group:wood"}, { "group:wood", "group:wood", "group:wood"},

View File

@ -38,21 +38,21 @@ local function hoe_on_use(itemstack, user, pointed_thing, uses)
if pt.type ~= "node" then if pt.type ~= "node" then
return return
end end
local under = minetest.get_node(pt.under) local under = minetest.get_node(pt.under)
local pos = {x = pt.under.x, y = pt.under.y + 1, z = pt.under.z} local pos = {x = pt.under.x, y = pt.under.y + 1, z = pt.under.z}
local above = minetest.get_node(pos) local above = minetest.get_node(pos)
-- Return if any of the nodes is not registered: -- Return if any of the nodes is not registered:
if not minetest.registered_nodes[under.name] then return end if not minetest.registered_nodes[under.name] then return end
if not minetest.registered_nodes[above.name] then return end if not minetest.registered_nodes[above.name] then return end
-- Check if the node above the pointed thing is air: -- Check if the node above the pointed thing is air:
if above.name ~= "air" then return end if above.name ~= "air" then return end
-- Check if pointing at dirt: -- Check if pointing at dirt:
if minetest.get_item_group(under.name, "soil") ~= 1 then return end if minetest.get_item_group(under.name, "soil") ~= 1 then return end
-- Turn the node into soil, wear out item and play sound: -- Turn the node into soil, wear out item and play sound:
minetest.set_node(pt.under, {name ="farming:soil"}) minetest.set_node(pt.under, {name ="farming:soil"})
minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5}) minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5})
@ -149,7 +149,7 @@ local function add_ore(modname, description, mineral_name, oredef)
}) })
minetest.register_alias(mineral_name .. "_ingot", ingot) minetest.register_alias(mineral_name .. "_ingot", ingot)
end end
if oredef.makes.chest then if oredef.makes.chest then
minetest.register_craft( { minetest.register_craft( {
output = "default:chest_locked", output = "default:chest_locked",
@ -163,11 +163,11 @@ local function add_ore(modname, description, mineral_name, oredef)
recipe = get_recipe(ingot, "lockedchest") recipe = get_recipe(ingot, "lockedchest")
}) })
end end
oredef.oredef.ore_type = "scatter" oredef.oredef.ore_type = "scatter"
oredef.oredef.ore = modname .. ":mineral_" .. mineral_name oredef.oredef.ore = modname .. ":mineral_" .. mineral_name
oredef.oredef.wherein = "default:stone" oredef.oredef.wherein = "default:stone"
minetest.register_ore(oredef.oredef) minetest.register_ore(oredef.oredef)
for tool_name, tooldef in pairs(oredef.tools) do for tool_name, tooldef in pairs(oredef.tools) do
@ -179,19 +179,19 @@ local function add_ore(modname, description, mineral_name, oredef)
groupcaps = tooldef.groupcaps groupcaps = tooldef.groupcaps
} }
} }
if tool_name == "sword" then if tool_name == "sword" then
tdef.tool_capabilities.full_punch_interval = tooldef.full_punch_interval tdef.tool_capabilities.full_punch_interval = tooldef.full_punch_interval
tdef.tool_capabilities.damage_groups = tooldef.damage_groups tdef.tool_capabilities.damage_groups = tooldef.damage_groups
tdef.description = S("%s Sword"):format(S(description)) tdef.description = S("%s Sword"):format(S(description))
end end
if tool_name == "pick" then if tool_name == "pick" then
tdef.tool_capabilities.full_punch_interval = tooldef.full_punch_interval tdef.tool_capabilities.full_punch_interval = tooldef.full_punch_interval
tdef.tool_capabilities.damage_groups = tooldef.damage_groups tdef.tool_capabilities.damage_groups = tooldef.damage_groups
tdef.description = S("%s Pickaxe"):format(S(description)) tdef.description = S("%s Pickaxe"):format(S(description))
end end
if tool_name == "axe" then if tool_name == "axe" then
tdef.tool_capabilities.full_punch_interval = tooldef.full_punch_interval tdef.tool_capabilities.full_punch_interval = tooldef.full_punch_interval
tdef.tool_capabilities.damage_groups = tooldef.damage_groups tdef.tool_capabilities.damage_groups = tooldef.damage_groups
@ -203,7 +203,7 @@ local function add_ore(modname, description, mineral_name, oredef)
tdef.tool_capabilities.damage_groups = tooldef.damage_groups tdef.tool_capabilities.damage_groups = tooldef.damage_groups
tdef.description = S("%s Shovel"):format(S(description)) tdef.description = S("%s Shovel"):format(S(description))
end end
if tool_name == "hoe" then if tool_name == "hoe" then
tdef.description = S("%s Hoe"):format(S(description)) tdef.description = S("%s Hoe"):format(S(description))
local uses = tooldef.uses local uses = tooldef.uses

View File

@ -2,13 +2,13 @@
-- --
-- This mod adds more types of trees to the game -- This mod adds more types of trees to the game
-- --
-- Some of the node definitions and textures came from cisoun's conifers mod -- Some of the node definitions and textures came from cisoun's conifers mod
-- and bas080's jungle trees mod. -- and bas080's jungle trees mod.
-- --
-- Brought together into one mod and made L-systems compatible by Vanessa -- Brought together into one mod and made L-systems compatible by Vanessa
-- Ezekowitz. -- Ezekowitz.
-- --
-- Firs and Jungle tree axioms/rules by Vanessa Ezekowitz, with the -- Firs and Jungle tree axioms/rules by Vanessa Ezekowitz, with the
-- latter having been tweaked by RealBadAngel, most other axioms/rules written -- latter having been tweaked by RealBadAngel, most other axioms/rules written
-- by RealBadAngel. -- by RealBadAngel.
-- --
@ -214,7 +214,7 @@ function moretrees:grow_jungletree(pos)
local r2 = math.random(3) local r2 = math.random(3)
if r1 == 1 then if r1 == 1 then
moretrees.jungletree_model.leaves2 = "moretrees:jungletree_leaves_red" moretrees.jungletree_model.leaves2 = "moretrees:jungletree_leaves_red"
else else
moretrees.jungletree_model.leaves2 = "moretrees:jungletree_leaves_yellow" moretrees.jungletree_model.leaves2 = "moretrees:jungletree_leaves_yellow"
end end
moretrees.jungletree_model.leaves2_chance = math.random(25, 75) moretrees.jungletree_model.leaves2_chance = math.random(25, 75)

View File

@ -83,10 +83,10 @@ if moretrees.enable_default_leafdecay then
minetest.remove_node(pos) minetest.remove_node(pos)
nodeupdate(pos) nodeupdate(pos)
end end
}) })
end end
-- Decay apple tree blossoms from nature_classic mod -- Decay apple tree blossoms from nature_classic mod
if minetest.get_modpath("nature_classic") then if minetest.get_modpath("nature_classic") then
minetest.register_abm({ minetest.register_abm({
nodenames = "moretrees:apple_blossoms", nodenames = "moretrees:apple_blossoms",
@ -112,6 +112,6 @@ if moretrees.enable_default_jungle_leafdecay then
minetest.remove_node(pos) minetest.remove_node(pos)
nodeupdate(pos) nodeupdate(pos)
end end
}) })
end end

View File

@ -1,7 +1,7 @@
local S = moretrees.intllib local S = moretrees.intllib
moretrees.avoidnodes = {} moretrees.avoidnodes = {}
moretrees.treelist = { moretrees.treelist = {
{"beech", "Beech Tree"}, {"beech", "Beech Tree"},
{"apple_tree", "Apple Tree"}, {"apple_tree", "Apple Tree"},
@ -25,7 +25,7 @@ local dirs3 = { 14, 11, 16, 5, 14 }
local moretrees_new_leaves_drawtype = "allfaces_optional" local moretrees_new_leaves_drawtype = "allfaces_optional"
local moretrees_plantlike_leaves_visual_scale = 1 local moretrees_plantlike_leaves_visual_scale = 1
if moretrees.plantlike_leaves then if moretrees.plantlike_leaves then
moretrees_new_leaves_drawtype = "plantlike" moretrees_new_leaves_drawtype = "plantlike"
moretrees_plantlike_leaves_visual_scale = 1.189 moretrees_plantlike_leaves_visual_scale = 1.189
end end
@ -115,7 +115,7 @@ for i in ipairs(moretrees.treelist) do
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1}, groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
}) })
minetest.register_node("moretrees:"..treename.."_sapling_ongen", { minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
description = S(treedesc.." Sapling"), description = S(treedesc.." Sapling"),
drawtype = "plantlike", drawtype = "plantlike",
@ -180,7 +180,7 @@ for i in ipairs(moretrees.treelist) do
stairsplus:register_all( stairsplus:register_all(
"moretrees", "moretrees",
treename.."_trunk", treename.."_trunk",
"moretrees:"..treename.."_trunk", "moretrees:"..treename.."_trunk",
{ {
groups = { snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1 }, groups = { snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1 },
tiles = { tiles = {

View File

@ -166,7 +166,7 @@ minetest.register_on_prejoinplayer(function(name, ip)
.. " (" .. #name .. " characters, must be " .. min_name_len .. " characters at least)." .. " (" .. #name .. " characters, must be " .. min_name_len .. " characters at least)."
.. " Please try a longer name." .. " Please try a longer name."
end end
if #name > max_name_len then if #name > max_name_len then
return "Your player name is too long" return "Your player name is too long"
.. " (" .. #name .. " characters, must be " .. max_name_len .. " characters at most)." .. " (" .. #name .. " characters, must be " .. max_name_len .. " characters at most)."

View File

@ -23,7 +23,7 @@ minetest.register_chatcommand("whois", {
minetest.chat_send_player(name, "The player \"" .. param .. "\" did not join yet.") minetest.chat_send_player(name, "The player \"" .. param .. "\" did not join yet.")
return return
end end
local ip = ipnames.data[param] local ip = ipnames.data[param]
local names = ""; local names = "";
for k, v in pairs(ipnames.data) do for k, v in pairs(ipnames.data) do
@ -52,11 +52,11 @@ minetest.register_on_prejoinplayer(function(name, ip)
names = names .. k .. ", " names = names .. k .. ", "
end end
end end
if count <= ipnames.name_per_ip_limit and count > 1 then if count <= ipnames.name_per_ip_limit and count > 1 then
minetest.log("action", name .. " now has " .. count .. " accounts. Other accounts: " .. names) minetest.log("action", name .. " now has " .. count .. " accounts. Other accounts: " .. names)
end end
if count > ipnames.name_per_ip_limit then if count > ipnames.name_per_ip_limit then
ipnames.tmp_data[name] = nil ipnames.tmp_data[name] = nil
if tostring(ip) ~= "127.0.0.1" then if tostring(ip) ~= "127.0.0.1" then

View File

@ -3,24 +3,24 @@ local news = {}
local path = minetest.get_worldpath() local path = minetest.get_worldpath()
local function formspec(player,article) local function formspec(player,article)
--if ( article == "" or article == nil ) then --if ( article == "" or article == nil ) then
article = "news.txt" -- vu qu'il s'en sert pas article = "news.txt" -- vu qu'il s'en sert pas
--else --else
-- article = "news_"..article..".txt" -- article = "news_"..article..".txt"
--end --end
local newsfile = io.open(path.."/"..article,"r") local newsfile = io.open(path.."/"..article,"r")
local formspec = "size[12,10;]" local formspec = "size[12,10;]"
formspec = formspec.."background[-0.22,-0.25;13,11;background.jpg]" formspec = formspec.."background[-0.22,-0.25;13,11;background.jpg]"
if newsfile ~= nil then if newsfile ~= nil then
local newscontent = newsfile:read("*a") local newscontent = newsfile:read("*a")
formspec = formspec.."textarea[.50,.50;12,10;news;;"..minetest.formspec_escape(newscontent).."]" formspec = formspec.."textarea[.50,.50;12,10;news;;"..minetest.formspec_escape(newscontent).."]"
else else
formspec = formspec.."label[.50,.50;Pas d'article pour le moment]" formspec = formspec.."label[.50,.50;Pas d'article pour le moment]"
end end
formspec = formspec.."button_exit[5,9.25;2,1;exit;Fermer" formspec = formspec.."button_exit[5,9.25;2,1;exit;Fermer"
if ( newsfile ~= nil ) then if ( newsfile ~= nil ) then
newsfile:close() newsfile:close()
@ -40,7 +40,7 @@ minetest.register_chatcommand("news",{
description="Montre les news du serveur", description="Montre les news du serveur",
func = function (name,params) func = function (name,params)
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
minetest.show_formspec(name,"news",formspec(player,params)) minetest.show_formspec(name,"news",formspec(player,params))
end, end,
}) })

View File

@ -238,24 +238,24 @@ local function upgrade_autocrafter(pos, meta)
end end
minetest.register_node("pipeworks:autocrafter", { minetest.register_node("pipeworks:autocrafter", {
description = "Autocrafter", description = "Autocrafter",
drawtype = "normal", drawtype = "normal",
tiles = {"pipeworks_autocrafter.png"}, tiles = {"pipeworks_autocrafter.png"},
groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1},
tube = {insert_object = function(pos, node, stack, direction) tube = {insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
local added = inv:add_item("src", stack) local added = inv:add_item("src", stack)
after_inventory_change(pos) after_inventory_change(pos)
return added return added
end, end,
can_insert = function(pos, node, stack, direction) can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
return inv:room_for_item("src", stack) return inv:room_for_item("src", stack)
end, end,
input_inventory = "dst", input_inventory = "dst",
connect_sides = {left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1}}, connect_sides = {left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1}},
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -282,7 +282,7 @@ minetest.register_node("pipeworks:autocrafter", {
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
return (inv:is_empty("src") and inv:is_empty("dst")) return (inv:is_empty("src") and inv:is_empty("dst"))
end, end,
after_place_node = pipeworks.scan_for_tube_objects, after_place_node = pipeworks.scan_for_tube_objects,
after_dig_node = function(pos) after_dig_node = function(pos)
pipeworks.scan_for_tube_objects(pos) pipeworks.scan_for_tube_objects(pos)

View File

@ -67,10 +67,10 @@ for s in ipairs(states) do
drop = "pipeworks:pump_off", drop = "pipeworks:pump_off",
mesecons = {effector = { mesecons = {effector = {
action_on = function (pos, node) action_on = function (pos, node)
minetest.add_node(pos,{name="pipeworks:pump_on", param2 = node.param2}) minetest.add_node(pos,{name="pipeworks:pump_on", param2 = node.param2})
end, end,
action_off = function (pos, node) action_off = function (pos, node)
minetest.add_node(pos,{name="pipeworks:pump_off", param2 = node.param2}) minetest.add_node(pos,{name="pipeworks:pump_off", param2 = node.param2})
end end
}}, }},
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
@ -78,7 +78,7 @@ for s in ipairs(states) do
minetest.add_node(pos, { name = "pipeworks:pump_"..states[3-s], param2 = fdir }) minetest.add_node(pos, { name = "pipeworks:pump_"..states[3-s], param2 = fdir })
end end
}) })
minetest.register_node("pipeworks:valve_"..states[s].."_empty", { minetest.register_node("pipeworks:valve_"..states[s].."_empty", {
description = "Valve", description = "Valve",
drawtype = "mesh", drawtype = "mesh",
@ -107,10 +107,10 @@ for s in ipairs(states) do
drop = "pipeworks:valve_off_empty", drop = "pipeworks:valve_off_empty",
mesecons = {effector = { mesecons = {effector = {
action_on = function (pos, node) action_on = function (pos, node)
minetest.add_node(pos,{name="pipeworks:valve_on_empty", param2 = node.param2}) minetest.add_node(pos,{name="pipeworks:valve_on_empty", param2 = node.param2})
end, end,
action_off = function (pos, node) action_off = function (pos, node)
minetest.add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2}) minetest.add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2})
end end
}}, }},
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
@ -148,10 +148,10 @@ minetest.register_node("pipeworks:valve_on_loaded", {
drop = "pipeworks:valve_off_empty", drop = "pipeworks:valve_off_empty",
mesecons = {effector = { mesecons = {effector = {
action_on = function (pos, node) action_on = function (pos, node)
minetest.add_node(pos,{name="pipeworks:valve_on_empty", param2 = node.param2}) minetest.add_node(pos,{name="pipeworks:valve_on_empty", param2 = node.param2})
end, end,
action_off = function (pos, node) action_off = function (pos, node)
minetest.add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2}) minetest.add_node(pos,{name="pipeworks:valve_off_empty", param2 = node.param2})
end end
}}, }},
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
@ -284,7 +284,7 @@ minetest.register_node("pipeworks:entry_panel_empty", {
collision_box = panel_cbox, collision_box = panel_cbox,
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local playername = placer:get_player_name() local playername = placer:get_player_name()
if not minetest.is_protected(pointed_thing.under, playername) if not minetest.is_protected(pointed_thing.under, playername)
and not minetest.is_protected(pointed_thing.above, playername) then and not minetest.is_protected(pointed_thing.above, playername) then
local node = minetest.get_node(pointed_thing.under) local node = minetest.get_node(pointed_thing.under)
@ -376,7 +376,7 @@ minetest.register_node("pipeworks:flow_sensor_empty", {
end, end,
on_construct = function(pos) on_construct = function(pos)
if mesecon then if mesecon then
mesecon.receptor_off(pos, rules) mesecon.receptor_off(pos, rules)
end end
end, end,
selection_box = { selection_box = {
@ -415,7 +415,7 @@ minetest.register_node("pipeworks:flow_sensor_loaded", {
end, end,
on_construct = function(pos) on_construct = function(pos)
if mesecon then if mesecon then
mesecon.receptor_on(pos, rules) mesecon.receptor_on(pos, rules)
end end
end, end,
selection_box = { selection_box = {
@ -522,7 +522,7 @@ minetest.register_node("pipeworks:fountainhead", {
end, end,
on_construct = function(pos) on_construct = function(pos)
if mesecon then if mesecon then
mesecon.receptor_on(pos, rules) mesecon.receptor_on(pos, rules)
end end
end, end,
selection_box = { selection_box = {
@ -553,7 +553,7 @@ minetest.register_node("pipeworks:fountainhead_pouring", {
end, end,
on_construct = function(pos) on_construct = function(pos)
if mesecon then if mesecon then
mesecon.receptor_on(pos, rules) mesecon.receptor_on(pos, rules)
end end
end, end,
selection_box = { selection_box = {

View File

@ -46,8 +46,8 @@ pipeworks.check_for_inflows = function(pos,node)
source = {x=coords[i].x,y=coords[i].y,z=coords[i].z} source = {x=coords[i].x,y=coords[i].y,z=coords[i].z}
end end
end end
if newnode then if newnode then
minetest.add_node(pos,{name=newnode, param2 = node.param2}) minetest.add_node(pos,{name=newnode, param2 = node.param2})
minetest.get_meta(pos):set_string("source",minetest.pos_to_string(source)) minetest.get_meta(pos):set_string("source",minetest.pos_to_string(source))
end end
end end
@ -61,15 +61,15 @@ pipeworks.check_sources = function(pos,node)
newnode = string.gsub(node.name,"loaded","empty") newnode = string.gsub(node.name,"loaded","empty")
end end
if newnode then if newnode then
minetest.add_node(pos,{name=newnode, param2 = node.param2}) minetest.add_node(pos,{name=newnode, param2 = node.param2})
minetest.get_meta(pos):set_string("source","") minetest.get_meta(pos):set_string("source","")
end end
end end
pipeworks.spigot_check = function(pos, node) pipeworks.spigot_check = function(pos, node)
local belowname = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name local belowname = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name
if belowname and (belowname == "air" or belowname == "default:water_flowing" or belowname == "default:water_source") then if belowname and (belowname == "air" or belowname == "default:water_flowing" or belowname == "default:water_source") then
local spigotname = minetest.get_node(pos).name local spigotname = minetest.get_node(pos).name
local fdir=node.param2 local fdir=node.param2
local check = { local check = {
@ -99,7 +99,7 @@ end
pipeworks.fountainhead_check = function(pos, node) pipeworks.fountainhead_check = function(pos, node)
local abovename = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name local abovename = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name
if abovename and (abovename == "air" or abovename == "default:water_flowing" or abovename == "default:water_source") then if abovename and (abovename == "air" or abovename == "default:water_flowing" or abovename == "default:water_source") then
local fountainhead_name = minetest.get_node(pos).name local fountainhead_name = minetest.get_node(pos).name
local near_node = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) local near_node = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z})
if near_node and string.find(near_node.name, "_loaded") then if near_node and string.find(near_node.name, "_loaded") then

View File

@ -77,7 +77,7 @@ local function go_next(pos, velocity, stack)
if not next_positions[1] then if not next_positions[1] then
return false, nil return false, nil
end end
local n = (cmeta:get_int("tubedir") % (#next_positions)) + 1 local n = (cmeta:get_int("tubedir") % (#next_positions)) + 1
if pipeworks.enable_cyclic_mode then if pipeworks.enable_cyclic_mode then
cmeta:set_int("tubedir", n) cmeta:set_int("tubedir", n)
@ -182,7 +182,7 @@ luaentity.register_entity("pipeworks:tubed_item", {
self.itemstring = itemstring self.itemstring = itemstring
self.item_entity = self:add_attached_entity("pipeworks:tubed_item", itemstring) self.item_entity = self:add_attached_entity("pipeworks:tubed_item", itemstring)
end, end,
set_color = function(self, color) set_color = function(self, color)
if self.color == color then if self.color == color then
return return
@ -204,13 +204,13 @@ luaentity.register_entity("pipeworks:tubed_item", {
self.start_pos = vector.round(pos) self.start_pos = vector.round(pos)
self:setpos(pos) self:setpos(pos)
end end
local pos = self:getpos() local pos = self:getpos()
local stack = ItemStack(self.itemstring) local stack = ItemStack(self.itemstring)
local drop_pos local drop_pos
local velocity = self:getvelocity() local velocity = self:getvelocity()
local moved = false local moved = false
local speed = math.abs(velocity.x + velocity.y + velocity.z) local speed = math.abs(velocity.x + velocity.y + velocity.z)
if speed == 0 then if speed == 0 then
@ -218,12 +218,12 @@ luaentity.register_entity("pipeworks:tubed_item", {
moved = true moved = true
end end
local vel = {x = velocity.x / speed, y = velocity.y / speed, z = velocity.z / speed, speed = speed} local vel = {x = velocity.x / speed, y = velocity.y / speed, z = velocity.z / speed, speed = speed}
if vector.distance(pos, self.start_pos) >= 1 then if vector.distance(pos, self.start_pos) >= 1 then
self.start_pos = vector.add(self.start_pos, vel) self.start_pos = vector.add(self.start_pos, vel)
moved = true moved = true
end end
minetest.load_position(self.start_pos) minetest.load_position(self.start_pos)
local node = minetest.get_node(self.start_pos) local node = minetest.get_node(self.start_pos)
if moved and minetest.get_item_group(node.name, "tubedevice_receiver") == 1 then if moved and minetest.get_item_group(node.name, "tubedevice_receiver") == 1 then
@ -242,18 +242,18 @@ luaentity.register_entity("pipeworks:tubed_item", {
self:set_item(leftover:to_string()) self:set_item(leftover:to_string())
return return
end end
if moved then if moved then
local found_next, new_velocity = go_next(self.start_pos, velocity, stack) -- todo: color local found_next, new_velocity = go_next(self.start_pos, velocity, stack) -- todo: color
if not found_next then if not found_next then
drop_pos = minetest.find_node_near(vector.add(self.start_pos, velocity), 1, "air") drop_pos = minetest.find_node_near(vector.add(self.start_pos, velocity), 1, "air")
if drop_pos then if drop_pos then
minetest.item_drop(stack, "", drop_pos) minetest.item_drop(stack, "", drop_pos)
self:remove() self:remove()
return return
end end
end end
if new_velocity and not vector.equals(velocity, new_velocity) then if new_velocity and not vector.equals(velocity, new_velocity) then
self:setpos(self.start_pos) self:setpos(self.start_pos)
self:setvelocity(new_velocity) self:setvelocity(new_velocity)

View File

@ -1,5 +1,5 @@
if not minetest.get_modpath("auto_tree_tap") and if not minetest.get_modpath("auto_tree_tap") and
minetest.get_modpath("technic") then minetest.get_modpath("technic") then
minetest.register_abm({ minetest.register_abm({
@ -37,10 +37,10 @@ if not minetest.get_modpath("auto_tree_tap") and
after_place_node = function (pos, placer) after_place_node = function (pos, placer)
pipeworks.scan_for_tube_objects(pos, placer) pipeworks.scan_for_tube_objects(pos, placer)
local placer_pos = placer:getpos() local placer_pos = placer:getpos()
--correct for the player's height --correct for the player's height
if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end
--correct for 6d facedir --correct for 6d facedir
if placer_pos then if placer_pos then
local dir = { local dir = {

View File

@ -194,7 +194,7 @@ local entitydef_default = {
end end
end, end,
getvelocity = function(self) getvelocity = function(self)
return vector.new(self._velocity) return vector.new(self._velocity)
end, end,
setvelocity = function(self, velocity) setvelocity = function(self, velocity)
self._velocity = vector.new(velocity) self._velocity = vector.new(velocity)
@ -268,7 +268,7 @@ function luaentity.add_entity(pos, name)
_acceleration = {x = 0, y = 0, z = 0}, _acceleration = {x = 0, y = 0, z = 0},
_attached_entities = {}, _attached_entities = {},
} }
local prototype = luaentity.registered_entities[name] local prototype = luaentity.registered_entities[name]
setmetatable(entity, prototype) -- Default to prototype for other methods setmetatable(entity, prototype) -- Default to prototype for other methods
luaentity.entities[index] = entity luaentity.entities[index] = entity

View File

@ -34,7 +34,7 @@ pipeworks.tube_frontstub = {
pipeworks.tube_backstub = { pipeworks.tube_backstub = {
{ -9/64, -9/64, -9/64, 9/64, 9/64, 32/64 }, -- tube segment against -Z face { -9/64, -9/64, -9/64, 9/64, 9/64, 32/64 }, -- tube segment against -Z face
} }
pipeworks.tube_boxes = {pipeworks.tube_leftstub, pipeworks.tube_rightstub, pipeworks.tube_bottomstub, pipeworks.tube_topstub, pipeworks.tube_frontstub, pipeworks.tube_backstub} pipeworks.tube_boxes = {pipeworks.tube_leftstub, pipeworks.tube_rightstub, pipeworks.tube_bottomstub, pipeworks.tube_topstub, pipeworks.tube_frontstub, pipeworks.tube_backstub}

View File

@ -9,7 +9,7 @@ local vti = {4, 3, 2, 1, 6, 5}
local cconnects = {{}, {1}, {1, 2}, {1, 3}, {1, 3, 5}, {1, 2, 3}, {1, 2, 3, 5}, {1, 2, 3, 4}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, 6}} local cconnects = {{}, {1}, {1, 2}, {1, 3}, {1, 3, 5}, {1, 2, 3}, {1, 2, 3, 5}, {1, 2, 3, 4}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, 6}}
for index, connects in ipairs(cconnects) do for index, connects in ipairs(cconnects) do
local outsel = {} local outsel = {}
local jx = 0 local jx = 0
local jy = 0 local jy = 0
local jz = 0 local jz = 0
@ -28,7 +28,7 @@ for index, connects in ipairs(cconnects) do
local v = connects[1] local v = connects[1]
v = v-1 + 2*(v%2) -- Opposite side v = v-1 + 2*(v%2) -- Opposite side
end end
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1} local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1}
local pipedesc = "Pipe segement".." "..dump(connects).."... You hacker, you." local pipedesc = "Pipe segement".." "..dump(connects).."... You hacker, you."
local image = nil local image = nil
@ -38,11 +38,11 @@ for index, connects in ipairs(cconnects) do
pipedesc = "Pipe segment" pipedesc = "Pipe segment"
image = "pipeworks_pipe_inv.png" image = "pipeworks_pipe_inv.png"
end end
local outimg_e = { "pipeworks_pipe_plain.png" } local outimg_e = { "pipeworks_pipe_plain.png" }
local outimg_l = { "pipeworks_pipe_plain.png" } local outimg_l = { "pipeworks_pipe_plain.png" }
if index == 3 then if index == 3 then
outimg_e = { "pipeworks_pipe_3_empty.png" } outimg_e = { "pipeworks_pipe_3_empty.png" }
outimg_l = { "pipeworks_pipe_3_loaded.png" } outimg_l = { "pipeworks_pipe_3_loaded.png" }
end end
@ -82,7 +82,7 @@ for index, connects in ipairs(cconnects) do
pipeworks.scan_for_pipe_objects(pos) pipeworks.scan_for_pipe_objects(pos)
end end
}) })
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1} local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1}
minetest.register_node("pipeworks:pipe_"..index.."_loaded", { minetest.register_node("pipeworks:pipe_"..index.."_loaded", {
@ -112,7 +112,7 @@ for index, connects in ipairs(cconnects) do
pipeworks.scan_for_pipe_objects(pos) pipeworks.scan_for_pipe_objects(pos)
end end
}) })
table.insert(pipes_empty_nodenames, "pipeworks:pipe_"..index.."_empty") table.insert(pipes_empty_nodenames, "pipeworks:pipe_"..index.."_empty")
table.insert(pipes_full_nodenames, "pipeworks:pipe_"..index.."_loaded") table.insert(pipes_full_nodenames, "pipeworks:pipe_"..index.."_loaded")
end end
@ -206,7 +206,7 @@ minetest.register_abm({
nodenames = {"pipeworks:spigot","pipeworks:spigot_pouring"}, nodenames = {"pipeworks:spigot","pipeworks:spigot_pouring"},
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
pipeworks.spigot_check(pos,node) pipeworks.spigot_check(pos,node)
end end
}) })
@ -215,7 +215,7 @@ minetest.register_abm({
nodenames = {"pipeworks:fountainhead","pipeworks:fountainhead_pouring"}, nodenames = {"pipeworks:fountainhead","pipeworks:fountainhead_pouring"},
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
pipeworks.fountainhead_check(pos,node) pipeworks.fountainhead_check(pos,node)
end end
}) })

View File

@ -173,7 +173,7 @@ pipeworks.register_tube("pipeworks:teleport_tube", {
if mode == ":" then if mode == ":" then
minetest.chat_send_player(sender_name, "Sorry, channel '"..new_channel.."' is reserved for exclusive use by "..name) minetest.chat_send_player(sender_name, "Sorry, channel '"..new_channel.."' is reserved for exclusive use by "..name)
return return
--channels starting with '[name];' can be used by other players, but cannot be received from --channels starting with '[name];' can be used by other players, but cannot be received from
elseif mode == ";" and (fields.cr1 or (can_receive ~= 0 and not fields.cr0)) then elseif mode == ";" and (fields.cr1 or (can_receive ~= 0 and not fields.cr0)) then
minetest.chat_send_player(sender_name, "Sorry, receiving from channel '"..new_channel.."' is reserved for "..name) minetest.chat_send_player(sender_name, "Sorry, receiving from channel '"..new_channel.."' is reserved for "..name)

View File

@ -1,6 +1,6 @@
minetest.register_node("pipeworks:trashcan", { minetest.register_node("pipeworks:trashcan", {
description = "Trash Can", description = "Trash Can",
drawtype = "normal", drawtype = "normal",
tiles = { tiles = {
"pipeworks_trashcan_bottom.png", "pipeworks_trashcan_bottom.png",
"pipeworks_trashcan_bottom.png", "pipeworks_trashcan_bottom.png",
@ -8,15 +8,15 @@ minetest.register_node("pipeworks:trashcan", {
"pipeworks_trashcan_side.png", "pipeworks_trashcan_side.png",
"pipeworks_trashcan_side.png", "pipeworks_trashcan_side.png",
"pipeworks_trashcan_side.png", "pipeworks_trashcan_side.png",
}, },
groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1},
tube = { tube = {
insert_object = function(pos, node, stack, direction) insert_object = function(pos, node, stack, direction)
return ItemStack("") return ItemStack("")
end, end,
connect_sides = {left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1}, connect_sides = {left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1},
priority = 1, -- Lower than anything else priority = 1, -- Lower than anything else
}, },
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", meta:set_string("formspec",
@ -31,7 +31,7 @@ minetest.register_node("pipeworks:trashcan", {
"list[current_player;main;0,3;8,4;]") "list[current_player;main;0,3;8,4;]")
meta:set_string("infotext", "Trash Can") meta:set_string("infotext", "Trash Can")
meta:get_inventory():set_size("trash", 1) meta:get_inventory():set_size("trash", 1)
end, end,
after_place_node = pipeworks.after_place, after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig, after_dig_node = pipeworks.after_dig,
on_metadata_inventory_put = function(pos, listname, index, stack, player) on_metadata_inventory_put = function(pos, listname, index, stack, player)

View File

@ -38,11 +38,11 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
local outboxes = {} local outboxes = {}
local outsel = {} local outsel = {}
local outimgs = {} local outimgs = {}
for i = 1, 6 do for i = 1, 6 do
outimgs[vti[i]] = plain[i] outimgs[vti[i]] = plain[i]
end end
for _, v in ipairs(connects) do for _, v in ipairs(connects) do
table.extend(outboxes, pipeworks.tube_boxes[v]) table.extend(outboxes, pipeworks.tube_boxes[v])
table.insert(outsel, pipeworks.tube_selectboxes[v]) table.insert(outsel, pipeworks.tube_selectboxes[v])
@ -73,10 +73,10 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
outsel = { -24/64, -10/64, -10/64, 24/64, 10/64, 10/64 } outsel = { -24/64, -10/64, -10/64, 24/64, 10/64, 10/64 }
wscale = {x = 1, y = 1, z = 0.01} wscale = {x = 1, y = 1, z = 0.01}
end end
local rname = string.format("%s_%s", name, tname) local rname = string.format("%s_%s", name, tname)
table.insert(tubenodes, rname) table.insert(tubenodes, rname)
local nodedef = { local nodedef = {
description = tubedesc, description = tubedesc,
drawtype = "nodebox", drawtype = "nodebox",
@ -112,7 +112,7 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
if style == "6d" then if style == "6d" then
nodedef.paramtype2 = "facedir" nodedef.paramtype2 = "facedir"
end end
if special == nil then special = {} end if special == nil then special = {} end
for key, value in pairs(special) do for key, value in pairs(special) do

View File

@ -20,7 +20,7 @@ minetest.register_node("quartz:quartz_ore", {
drop = 'quartz:quartz_crystal', drop = 'quartz:quartz_crystal',
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "quartz:quartz_ore", ore = "quartz:quartz_ore",
@ -72,14 +72,14 @@ stairs.register_slab("quartzstair", "quartz:pillar",
{"quartz_pillar_top.png", "quartz_pillar_top.png", "quartz_pillar_side.png"}, {"quartz_pillar_top.png", "quartz_pillar_top.png", "quartz_pillar_side.png"},
"Quartz Pillar stair", "Quartz Pillar stair",
"Quartz Pillar slab", "Quartz Pillar slab",
default.node_sound_glass_defaults()) default.node_sound_glass_defaults())
--Crafting --Crafting
--Quartz Crystal Piece --Quartz Crystal Piece
@ -99,7 +99,7 @@ minetest.register_craft({
{'', '', ''} {'', '', ''}
} }
}) })
--Chiseled Quartz --Chiseled Quartz
minetest.register_craft({ minetest.register_craft({
output = "quartz:chiseled 2", output = "quartz:chiseled 2",
@ -169,22 +169,22 @@ if minetest.get_modpath("moreblocks") and enable_stairsplus then
"Quartz Block", "Quartz Block",
"block", "block",
0) 0)
register_stair_slab_panel_micro("quartz", "chiseled", "quartz:chiseled", register_stair_slab_panel_micro("quartz", "chiseled", "quartz:chiseled",
{cracky=3}, {cracky=3},
{"quartz_chiseled.png"}, {"quartz_chiseled.png"},
"Chiseled Quartz", "Chiseled Quartz",
"chiseled", "chiseled",
0) 0)
register_stair_slab_panel_micro("quartz", "pillar", "quartz:pillar", register_stair_slab_panel_micro("quartz", "pillar", "quartz:pillar",
{cracky=3}, {cracky=3},
{"quartz_pillar_top.png", "quartz_pillar_top.png", "quartz_pillar_side.png"}, {"quartz_pillar_top.png", "quartz_pillar_top.png", "quartz_pillar_side.png"},
"Quartz Pillar", "Quartz Pillar",
"pillar", "pillar",
0) 0)
table.insert(circular_saw.known_stairs, "quartz:block") table.insert(circular_saw.known_stairs, "quartz:block")
table.insert(circular_saw.known_stairs, "quartz:chiseled") table.insert(circular_saw.known_stairs, "quartz:chiseled")
table.insert(circular_saw.known_stairs, "quartz:pillar") table.insert(circular_saw.known_stairs, "quartz:pillar")
end end

View File

@ -4,7 +4,7 @@ arsdragonfly@gmail.com
6/19/2013 6/19/2013
--]] --]]
--Time between two subsequent messages. --Time between two subsequent messages.
local MESSAGE_INTERVAL = 0 local MESSAGE_INTERVAL = 0
math.randomseed(os.time()) math.randomseed(os.time())
@ -14,7 +14,7 @@ random_messages.messages = {} --This table contains all messages.
function random_messages.initialize() --Set the interval in minetest.conf. function random_messages.initialize() --Set the interval in minetest.conf.
minetest.setting_set("random_messages_interval",120) minetest.setting_set("random_messages_interval",120)
minetest.setting_save(); minetest.setting_save();
return 120 return 120
end end
function random_messages.set_interval() --Read the interval from minetest.conf(set it if it doesn'st exist) function random_messages.set_interval() --Read the interval from minetest.conf(set it if it doesn'st exist)

View File

@ -99,7 +99,7 @@ function riesenpilz_minecraft_fliegenpilz(pos)
local manip = minetest.get_voxel_manip() local manip = minetest.get_voxel_manip()
local area = r_area(manip, 2, 4, pos) local area = r_area(manip, 2, 4, pos)
local nodes = manip:get_data() local nodes = manip:get_data()
local param2s = manip:get_param2_data() local param2s = manip:get_param2_data()
local height = 3 local height = 3

View File

@ -13,7 +13,7 @@ local timer = 0
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
timer = timer+dtime timer = timer+dtime
-- if timer < X then = X seconde temps que s'affiche les message -- if timer < X then = X seconde temps que s'affiche les message
-- Default 300 seconde = 5 minute -- Default 300 seconde = 5 minute
if timer < 60 then if timer < 60 then
return return
@ -24,7 +24,7 @@ minetest.register_globalstep(function(dtime)
local jour = os.date("%u") local jour = os.date("%u")
-- Warn only on monday, thursday, and saturday -- Warn only on monday, thursday, and saturday
if jour ~= 1 and jour~= 4 and jour ~= 6 then return end if jour ~= 1 and jour~= 4 and jour ~= 6 then return end
if heure == "2" and minute == "25" then --modifier ici à vos besoin if heure == "2" and minute == "25" then --modifier ici à vos besoin
minetest.chat_send_all("Rappel, arret du serveur pour sauvegarde dans 30min.") minetest.chat_send_all("Rappel, arret du serveur pour sauvegarde dans 30min.")
minetest.chat_send_all("Attention, server will shutdown in 30 minutes for backup.") minetest.chat_send_all("Attention, server will shutdown in 30 minutes for backup.")

View File

@ -21,7 +21,7 @@ local SETTLE = false -- Snow collects on ground within 32 nodes of player
local RAIN = false -- Rain above humidity threshold local RAIN = false -- Rain above humidity threshold
local THOVER = false -- Instead use a temperature and humidity system with local THOVER = false -- Instead use a temperature and humidity system with
-- snow in overlap of cold and humid areas, else rain in humid areas -- snow in overlap of cold and humid areas, else rain in humid areas
-- Temperature noise parameters -- Temperature noise parameters
local SEEDT = 112 -- 112 These are default noise parameters from snow mod by Splizard local SEEDT = 112 -- 112 These are default noise parameters from snow mod by Splizard
local OCTAT = 3 -- 3 use these for snowfall in those snow biomes local OCTAT = 3 -- 3 use these for snowfall in those snow biomes
@ -46,7 +46,7 @@ minetest.register_globalstep(function(dtime)
local perlinp = minetest.get_perlin(813, 1, 0.5, SCALP) local perlinp = minetest.get_perlin(813, 1, 0.5, SCALP)
if perlinp:get2d({x = os.clock()/60, y = 0}) < PRET then if perlinp:get2d({x = os.clock()/60, y = 0}) < PRET then
return return
end end
for _, player in ipairs(minetest.get_connected_players()) do for _, player in ipairs(minetest.get_connected_players()) do
if math.random() > PPPCHA or player:getpos().y < -19600 then if math.random() > PPPCHA or player:getpos().y < -19600 then
return return
@ -66,7 +66,7 @@ minetest.register_globalstep(function(dtime)
local perlint = minetest.get_perlin(SEEDT, OCTAT, PERST, SCALT) local perlint = minetest.get_perlin(SEEDT, OCTAT, PERST, SCALT)
noiset = perlint:get2d({x = pposx, y = pposz}) noiset = perlint:get2d({x = pposx, y = pposz})
end end
if RAIN or THOVER then if RAIN or THOVER then
local perlinh = minetest.get_perlin(SEEDH, OCTAH, PERSH, SCALH) local perlinh = minetest.get_perlin(SEEDH, OCTAH, PERSH, SCALH)
noiseh = perlinh:get2d({x = pposx, y = pposz}) noiseh = perlinh:get2d({x = pposx, y = pposz})
end end
@ -188,6 +188,6 @@ minetest.register_globalstep(function(dtime)
playername = player:get_player_name(), playername = player:get_player_name(),
}) })
end end
end end
end end
end) end)

View File

@ -40,7 +40,7 @@ soundset.set_sound = function(name, param)
minetest.chat_send_player(name, "invalid param, /setsound <music|ambience|mobs|other> <number>") minetest.chat_send_player(name, "invalid param, /setsound <music|ambience|mobs|other> <number>")
return return
end end
if param_name ~= "music" and param_name ~= "ambience" and param_name ~= "mobs" and param_name ~= "other" then if param_name ~= "music" and param_name ~= "ambience" and param_name ~= "mobs" and param_name ~= "other" then
minetest.chat_send_player(name, "invalid param " .. param_name) minetest.chat_send_player(name, "invalid param " .. param_name)
return return
@ -50,18 +50,18 @@ soundset.set_sound = function(name, param)
minetest.chat_send_player(name, "invalid value, " ..param_value .. " must be number") minetest.chat_send_player(name, "invalid value, " ..param_value .. " must be number")
return return
end end
if value < 0 then if value < 0 then
value = 0 value = 0
elseif value > 100 then elseif value > 100 then
value = 100 value = 100
end end
if soundset.gainplayers[name][param_name] == value then if soundset.gainplayers[name][param_name] == value then
minetest.chat_send_player(name, "volume " .. param_name .. " already set to " .. value) minetest.chat_send_player(name, "volume " .. param_name .. " already set to " .. value)
return return
end end
soundset.gainplayers[name][param_name] = value soundset.gainplayers[name][param_name] = value
minetest.chat_send_player(name, "sound " .. param_name .. " set to " .. value) minetest.chat_send_player(name, "sound " .. param_name .. " set to " .. value)
save_sounds_config() save_sounds_config()
@ -203,7 +203,7 @@ minetest.register_chatcommand("soundset", {
if not name then return end if not name then return end
on_show_settings(name, soundset.gainplayers[name]["music"], soundset.gainplayers[name]["ambience"], soundset.gainplayers[name]["other"]) on_show_settings(name, soundset.gainplayers[name]["music"], soundset.gainplayers[name]["ambience"], soundset.gainplayers[name]["other"])
end end
}) })

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