diff --git a/mods/_misc/irc.lua b/mods/_misc/irc.lua index f0f4beb6..21659c7a 100755 --- a/mods/_misc/irc.lua +++ b/mods/_misc/irc.lua @@ -16,17 +16,17 @@ local IRC = [[ Voici les sanctions prevues pour les infractions aux regles ci-dessus. -- Infraction niveau DIRT : +- Infraction niveau DIRT : Manque de respect envers autrui : Devoice une journee Provocation envers autrui : Devoice une journee Insultes envers autrui : Kick + Devoice une journee - + - Infraction niveau STONE : - Recidivide d'infraction niveau dirt : Kick + Ban 1/2 journee - Flood, Discrimination : Kick + Devoice deux heures - Spam : Kick + Devoice 1 jour + Ban 1/2 journee - -- Infraction niveau MESE : + +- Infraction niveau MESE : - Recidive d'infraction niveau stone : Kick + Ban 4 jours + devoice 5 jours - Diffusion de contenu a caractere sexuel : Kick + Ban 1 semaine + devoice 5 jours - Irrespect envers l'equipe du canal : Kick + Ban 10 jours + devoice 8 jours @@ -35,7 +35,7 @@ Voici les sanctions prevues pour les infractions aux regles ci-dessus. - Recidive d'infraction niveau mese : Kick + Ban 1 mois + devoice 2 semaines - Violation des lois en vigueur : Kick + Ban definitif + Gline si accord des IrcOP d'InchraNet - Violation des regles d'InchraNet : Kick + Ban definitif + Gline ou sanction defnie par l'equipe d'InchraNet - + Autres regles de bienseances : - Ne demandez pas a faire partie des operateurs/semi-operateurs du canal. diff --git a/mods/_misc/irc_accents.lua b/mods/_misc/irc_accents.lua index cec3bd99..e3b7c6c0 100755 --- a/mods/_misc/irc_accents.lua +++ b/mods/_misc/irc_accents.lua @@ -16,17 +16,17 @@ local IRC = [[ Voici les sanctions prévues pour les infractions aux règles ci-dessus. -- Infraction niveau DIRT : +- Infraction niveau DIRT : Manque de respect envers autrui : Devoice une journée Provocation envers autrui : Devoice une journée Insultes envers autrui : Kick + Devoice une journée - + - Infraction niveau STONE : - Récidivide d'infraction niveau dirt : Kick + Ban 1/2 journée - Flood, Discrimination : Kick + Devoice deux heures - Spam : Kick + Devoice 1 jour + Ban 1/2 journée - -- Infraction niveau MESE : + +- Infraction niveau MESE : - Récidive d'infraction niveau stone : Kick + Ban 4 jours + devoice 5 jours - Diffusion de contenu à caractère sexuel : Kick + Ban 1 semaine + devoice 5 jours - Irrespect envers l'équipe du canal : Kick + Ban 10 jours + devoice 8 jours @@ -35,7 +35,7 @@ Voici les sanctions prévues pour les infractions aux règles ci-dessus. - Récidive d'infraction niveau mese : Kick + Ban 1 mois + devoice 2 semaines - Violation des lois en vigueur : Kick + Ban définitif + Gline si accord des IrcOP d'InchraNet - Violation des règles d'InchraNet : Kick + Ban définitif + Gline ou sanction défnie par l'équipe d'InchraNet - + Autres règles de bienséances : - Ne demandez pas à faire partie des opérateurs/semi-opérateurs du canal. diff --git a/mods/areas/api.lua b/mods/areas/api.lua index a8741739..83a8c9ac 100755 --- a/mods/areas/api.lua +++ b/mods/areas/api.lua @@ -2,7 +2,7 @@ --plants to place in openfarming local plants = { ["farming:blueberries"]=1, ["farming:carrot"]=1, ["farming:coffee_beans"]=1, ["farming:corn"]=1, ["farming:cucumber"]=1, ["farming:melon_slice"]=1, ["farming:potato"]=1, ["farming:pumpkin_slice"]=1, ["farming:raspberries"]=1, ["farming:rhubarb"]=1, - ["farming:tomato"]=1, ["farming:seed_cotton"]=1, ["farming:seed_wheat"]=1,["default:papyrus"]=1 + ["farming:tomato"]=1, ["farming:seed_cotton"]=1, ["farming:seed_wheat"]=1,["default:papyrus"]=1 } --tools to dig in openfarming @@ -49,17 +49,17 @@ function areas:canInteract(pos, name) if not player then return false end local wstack = player:get_wielded_item():get_name() if wstack == "" then wstack = "hand" end - + --on_place if node == "air" and plants[wstack] ~= nil then return true end - + --on_dig if minetest.get_item_group(node, "plant") == 1 and in_hand[wstack] ~= nil then return true end - + owned = true else owned = true diff --git a/mods/areas/chatcommands.lua b/mods/areas/chatcommands.lua index 85932da7..7c1c4730 100755 --- a/mods/areas/chatcommands.lua +++ b/mods/areas/chatcommands.lua @@ -60,7 +60,7 @@ minetest.register_chatcommand("set_owner", { local id = areas:add(ownerName, areaName, pos1, pos2, nil) areas:save() - + minetest.chat_send_player(ownerName, "You have been granted control over area #".. id..". Type /list_areas to show your areas.") diff --git a/mods/arrow_signs/init.lua b/mods/arrow_signs/init.lua index 99049934..21154160 100755 --- a/mods/arrow_signs/init.lua +++ b/mods/arrow_signs/init.lua @@ -1,27 +1,27 @@ --more_signs by addi ---Code and Textures are under the CC by-sa 3.0 licence ---see: http://creativecommons.org/licenses/by-sa/3.0/ - - - +--Code and Textures are under the CC by-sa 3.0 licence +--see: http://creativecommons.org/licenses/by-sa/3.0/ + + + arrow_signs={} arrow_signs.formspec = "field[text;Sign text:;${text}]"; arrow_signs_on_place = function(itemstack, placer, pointed_thing) - + local posabove = pointed_thing.above local posunder = pointed_thing.under local vector = placer:get_look_dir() local place = true - + if posabove.y>posunder.y then if(vector.z>0.5 and vector.z<=1) then minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 10}) elseif (vector.x>0.5 and vector.x<=1) then minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 19}) elseif(-0.5>vector.z and -1<=vector.z) then - minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 4}) + minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 4}) elseif (-0.5>vector.x and -1<=vector.x) then minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 13}) else @@ -33,7 +33,7 @@ arrow_signs_on_place = function(itemstack, placer, pointed_thing) elseif (vector.x>0.5 and vector.x<=1) then minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 17}) elseif(-0.5>vector.z and -1<=vector.z) then - minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 6}) + minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 6}) elseif (-0.5>vector.x and -1<=vector.x) then minetest.add_node(posabove,{name = itemstack:get_name(), param2 = 15}) else @@ -96,15 +96,15 @@ arrow_signs_on_place = function(itemstack, placer, pointed_thing) else itemstack:take_item() end - + if not minetest.setting_getbool("creative_mode") then return itemstack end - + end function arrow_signs:savetext(pos, formname, fields, sender) - + if not minetest.get_player_privs(sender:get_player_name())["interact"] then minetest.chat_send_player(sender:get_player_name(), "error: you don't have permission to edit the sign. you need the interact priv") return @@ -140,8 +140,8 @@ minetest.override_item("default:sign_wall", { minetest.register_node("arrow_signs:wall", { description = "Arrow signs", drawtype = "nodebox", - node_box = { - type = "fixed", + node_box = { + type = "fixed", fixed = { { 0.25, -0.25, 0.5, -0.25, 0.5, 0.47}, { 0.1875, -0.3125, 0.5, -0.1875, -0.25, 0.47}, @@ -150,7 +150,7 @@ minetest.register_node("arrow_signs:wall", { } }, selection_box = { - type = "fixed", + type = "fixed", fixed = { { 0.25, -0.25, 0.5, -0.25, 0.5, 0.47}, { 0.1875, -0.3125, 0.5, -0.1875, -0.25, 0.47}, @@ -166,7 +166,7 @@ minetest.register_node("arrow_signs:wall", { walkable = false, groups = {choppy=2,dig_immediate=2,sign=1}, sounds = default.node_sound_defaults(), - on_place = arrow_signs_on_place, + on_place = arrow_signs_on_place, on_construct = function(pos) --local n = minetest.get_node(pos) local meta = minetest.get_meta(pos) diff --git a/mods/awards/api.lua b/mods/awards/api.lua index 8ef53d3c..a77860c3 100755 --- a/mods/awards/api.lua +++ b/mods/awards/api.lua @@ -150,7 +150,7 @@ function awards.register_achievement(name,data_table) if data_table.custom_announce == nil or data_table.custom_announce == "" then data_table.custom_announce = "Achievement Unlocked:" end - + -- add the achievement to the definition table data_table.name = name awards.def[name] = data_table @@ -191,7 +191,7 @@ end function awards.give_achievement(name, award) -- Access Player Data local data = awards.players[name] - + -- Perform checks if not data then return @@ -277,7 +277,7 @@ function awards.give_achievement(name, award) position = {x = 0.5, y = 0}, offset = {x = 0, y = 40}, alignment = {x = 0, y = -1} - }) + }) local three = player:hud_add({ hud_elem_type = "text", name = "award_title", @@ -287,7 +287,7 @@ function awards.give_achievement(name, award) position = {x = 0.5, y = 0}, offset = {x = 30, y = 100}, alignment = {x = 0, y = -1} - }) + }) local four = player:hud_add({ hud_elem_type = "image", name = "award_icon", @@ -304,10 +304,10 @@ function awards.give_achievement(name, award) player:hud_remove(four) end) end - - -- record this in the log + + -- record this in the log minetest.log("action", name.." has unlocked award "..title) - + -- save playertable awards.save() minetest.sound_play("award_award_won", {to_player = name, gain = 0.5*soundset.get_gain(name,"other")}) @@ -392,7 +392,7 @@ function awards.showto(name, to, sid, text) local def = awards.def[str] if def then if def.title then - if def.description then + if def.description then minetest.chat_send_player(to, def.title..": "..def.description) else minetest.chat_send_player(to, def.title) @@ -406,9 +406,9 @@ function awards.showto(name, to, sid, text) if sid == nil or sid < 1 then sid = 1 end - local formspec = "size[11,5]" + local formspec = "size[11,5]" local listofawards = awards._order_awards(name) - + -- Sidebar if sid then local item = listofawards[sid+0] @@ -417,7 +417,7 @@ function awards.showto(name, to, sid, text) formspec = formspec .. "label[1,2.75;Secret Award]".. "image[1,0;3,3;unknown.png]" if def and def.description then - formspec = formspec .. "label[0,3.25;Unlock this award to find out what it is]" + formspec = formspec .. "label[0,3.25;Unlock this award to find out what it is]" end else local title = item.name @@ -435,13 +435,13 @@ function awards.showto(name, to, sid, text) formspec = formspec .. "label[1,2.75;"..title..status.."]".. "image[1,0;3,3;"..icon.."]" if def and def.description then - formspec = formspec .. "label[0,3.25;"..def.description.."]" + formspec = formspec .. "label[0,3.25;"..def.description.."]" end end end - + -- Create list box - formspec = formspec .. "textlist[4.75,0;6,5;awards;" + formspec = formspec .. "textlist[4.75,0;6,5;awards;" local first = true for _,award in pairs(listofawards) do local def = awards.def[award.name] @@ -450,14 +450,14 @@ function awards.showto(name, to, sid, text) formspec = formspec .. "," end first = false - + if def.secret and not award.got then formspec = formspec .. "#ACACACSecret Award" else - local title = award.name + local title = award.name if def and def.title then title = def.title - end + end if award.got then formspec = formspec .. minetest.formspec_escape(title) else @@ -465,7 +465,7 @@ function awards.showto(name, to, sid, text) end end end - end + end formspec = formspec .. ";"..sid.."]" -- Show formspec to user @@ -483,11 +483,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local name = player:get_player_name() if fields.awards then local event = minetest.explode_textlist_event(fields.awards) - if event.type == "CHG" then - awards.showto(name,name,event.index,false) - end + if event.type == "CHG" then + awards.showto(name,name,event.index,false) + end end - + return true end) diff --git a/mods/awards/init.lua b/mods/awards/init.lua index 237091a6..8c87039e 100755 --- a/mods/awards/init.lua +++ b/mods/awards/init.lua @@ -351,7 +351,7 @@ awards.register_onDeath(function(player,data) local pos = player:getpos() if pos and minetest.find_node_near(pos, 2, "fire:basic_flame") ~= nil then return "award_burn" - end + end return nil end) @@ -365,7 +365,7 @@ awards.register_onDeath(function(player,data) local pos = player:getpos() if pos and minetest.find_node_near(pos, 2, "default:lava_flowing") ~= nil then return "award_in_the_flow" - end + end return nil end) @@ -379,7 +379,7 @@ awards.register_onDeath(function(player,data) local pos = player:getpos() if pos and minetest.find_node_near(pos, 5, "default:stone_with_diamond") ~= nil then return "award_this_is_sad" - end + end return nil end) @@ -392,7 +392,7 @@ awards.register_onDeath(function(player,data) local pos = player:getpos() if pos and minetest.find_node_near(pos, 5, "bones:bones") ~= nil then return "award_the_stack" - end + end return nil end) diff --git a/mods/awards/triggers.lua b/mods/awards/triggers.lua index 213d5c1d..ab6a9732 100755 --- a/mods/awards/triggers.lua +++ b/mods/awards/triggers.lua @@ -128,14 +128,14 @@ minetest.register_on_dieplayer(function(player) if not player or not name or name=="" then return end - - -- Get player + + -- Get player awards.assertPlayer(name) local data = awards.players[name] -- Increment counter data.deaths = data.deaths + 1 - + -- Run callbacks and triggers for _,trigger in pairs(awards.onDeath) do local res = nil @@ -160,14 +160,14 @@ minetest.register_on_joinplayer(function(player) if not player or not name or name=="" then return end - - -- Get player + + -- Get player awards.assertPlayer(name) local data = awards.players[name] -- Increment counter data.joins = data.joins + 1 - + -- Run callbacks and triggers for _,trigger in pairs(awards.onJoin) do local res = nil @@ -197,11 +197,11 @@ minetest.register_on_chat_message(function(name, message) awards.assertPlayer(name) local data = awards.players[name] local player = minetest.get_player_by_name(name) - + -- Increment counter data.chats = data.chats + 1 - - -- Run callbacks and triggers + + -- Run callbacks and triggers for _,trigger in pairs(awards.onChat) do local res = nil if type(trigger) == "function" then diff --git a/mods/beginners_chest/init.lua b/mods/beginners_chest/init.lua index a0a8ecf3..117b70cc 100755 --- a/mods/beginners_chest/init.lua +++ b/mods/beginners_chest/init.lua @@ -1,10 +1,10 @@ --[[ Beginners_chest mod Put some useful stuff in chests for the new players - + Version : 1.1 - 11/8/2014_14h48UTC Last modification by Mg on the : 14/3/2015 @ 14h48 UTC - + Mod ßý Mg, based on an idea of MinetestForFun/Darcidride ]]-- @@ -118,7 +118,7 @@ local chests = { minetest.register_globalstep(function(dtime) local i = 1 while i < table.getn(chests)+1 do - + if not chests[i].stuff then chests[i].stuff = { [1] = "default:wood", @@ -128,12 +128,12 @@ minetest.register_globalstep(function(dtime) if not chests[i].interval_timer then chests[i].interval_timer = 0 end - if not chests[i].interval_max then + if not chests[i].interval_max then chests[i].interval_max = 7200 -- Using default value : 2h end - + chests[i].interval_timer = chests[i].interval_timer + dtime - + if chests[i].position.x and chests[i].position.y and chests[i].position.z and chests[i].interval_timer >= chests[i].interval_max then chests[i].interval_timer = 0 local node = minetest.get_node(chests[i].position) @@ -160,7 +160,7 @@ minetest.register_globalstep(function(dtime) inv:set_list("main", chests[i].stuff) minetest.log("action","[b_chest]["..i.."] Chest reloaded at "..chests[i].position.x..", "..chests[i].position.y..", "..chests[i].position.z) - + else minetest.log("action","[b_chest]["..i.."] Cannot reload chest at "..chests[i].position.x..", "..chests[i].position.y..", "..chests[i].position.z.." : area not loaded.") end diff --git a/mods/bobblocks/trap.lua b/mods/bobblocks/trap.lua index 063db9e3..1fb26dda 100755 --- a/mods/bobblocks/trap.lua +++ b/mods/bobblocks/trap.lua @@ -187,8 +187,8 @@ minetest.register_abm( for k, obj in pairs(objs) do obj:set_hp(obj:get_hp()-100) minetest.sound_play("bobblocks_trap_fall", - {pos = pos, gain = 1.0, max_hear_distance = 3,}) + {pos = pos, gain = 1.0, max_hear_distance = 3,}) end end, - + }) diff --git a/mods/bone/init.lua b/mods/bone/init.lua index 399aa803..f0ae0d2e 100755 --- a/mods/bone/init.lua +++ b/mods/bone/init.lua @@ -76,7 +76,7 @@ end function generate_tree(pos, trunk, leaves) pos.y = pos.y-1 local nodename = minetest.get_node(pos).name - + pos.y = pos.y+1 if not minetest.get_node_light(pos) then return @@ -210,7 +210,7 @@ elseif string.find(n.name, "farming:pumpkin_") ~= nil then else minetest.set_node(pos, {name="farming:pumpkin"}) end - + elseif n.name == "default:dirt_with_grass" then for i = -2, 3, 1 do for j = -3, 2, 1 do @@ -225,8 +225,8 @@ elseif n.name == "default:dirt_with_grass" then else minetest.set_node(pos, {name=plant_tab[math.random(0, 5)]}) end - - + + end end end diff --git a/mods/builtin_falling/func.lua b/mods/builtin_falling/func.lua index cb7250b3..92988a54 100755 --- a/mods/builtin_falling/func.lua +++ b/mods/builtin_falling/func.lua @@ -145,7 +145,7 @@ function add_protected_bukket_liquid(nameofbukket,liquidsourcename) end -- Check if pointing to a buildable node local n = minetest.get_node(pointed_thing.under) - + if is_protected_area(pointed_thing.under, 4 ,user:get_player_name()) then minetest.chat_send_player(user:get_player_name(),"You can't place here - Too short of a protected area. (less than or equal to 4 blocks)") if minetest.is_protected(pointed_thing.under,user:get_player_name()) then @@ -153,7 +153,7 @@ function add_protected_bukket_liquid(nameofbukket,liquidsourcename) end return itemstack end - + if minetest.registered_nodes[n.name].buildable_to then -- buildable; replace the node minetest.log("action", user:get_player_name().. " use "..nameofbukket.." at ".. minetest.pos_to_string(pointed_thing.under)) diff --git a/mods/builtin_falling/rewirting.lua b/mods/builtin_falling/rewirting.lua index af78035d..f5729efa 100755 --- a/mods/builtin_falling/rewirting.lua +++ b/mods/builtin_falling/rewirting.lua @@ -35,7 +35,7 @@ minetest.register_entity(":__builtin:falling_node", { } self.object:set_properties(prop) end, - + set_owner = function(self, owner) if owner ~= nil then self.owner = "falling" @@ -181,7 +181,7 @@ if PROTECT_LAVA_REALTIME == 1 then interval = 1, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) - local meta = minetest.get_meta(pos) + local meta = minetest.get_meta(pos) if meta:get_string("owner") ~= nil and minetest.is_protected(pos, meta:get_string("owner")) then minetest.add_node(pos,{name="air"}) end @@ -196,7 +196,7 @@ if PROTECT_WATER_REALTIME == 1 then interval = 1, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) - local meta = minetest.get_meta(pos) + local meta = minetest.get_meta(pos) if meta:get_string("owner") ~= nil and minetest.is_protected(pos, meta:get_string("owner")) then minetest.add_node(pos,{name="air"}) end @@ -224,7 +224,7 @@ end -- local meta = minetest.get_meta(area:position(p_pos)) -- if minetest.get_name_from_content_id(data[p_pos])== "default:lava_source" and meta:get_string("owner") ~= nil and minetest.is_protected(area:position(p_pos), meta:get_string("owner")) then -- data[p_pos] = c_air --- end +-- end -- vm:set_data(data) -- vm:write_to_map() -- vm:update_map() diff --git a/mods/builtin_item/init.lua b/mods/builtin_item/init.lua index 902ea5a8..79d742dc 100755 --- a/mods/builtin_item/init.lua +++ b/mods/builtin_item/init.lua @@ -18,7 +18,7 @@ minetest.register_entity(":__builtin:item", { is_visible = false, timer = 0, }, - + itemstring = "", physical_state = true, @@ -83,7 +83,7 @@ minetest.register_entity(":__builtin:item", { self.object:setacceleration({x=0, y=-10, z=0}) self:set_item(self.itemstring) end, - + on_step = function(self, dtime) if not self.timer then self.timer = 0 @@ -92,16 +92,16 @@ minetest.register_entity(":__builtin:item", { if time ~= 0 and (self.timer > time) then self.object:remove() end - + local p = self.object:getpos() - + local name = minetest.get_node(p).name if (minetest.registered_nodes[name] and minetest.registered_nodes[name].damage_per_second > 0) or name == "maptools:igniter" then minetest.sound_play("builtin_item_lava", {pos = self.object:getpos(), gain = 0.5}) self.object:remove() return end - + --[[ if name == "default:water_source" then self.object:setacceleration({x = 0, y = 4, z = 0}) else @@ -119,13 +119,13 @@ minetest.register_entity(":__builtin:item", { else pos.z = pos.z+d end - + local name = minetest.get_node(pos).name local par2 = minetest.get_node(pos).param2 if name == "default:water_flowing" and par2 < param2 then return pos end - + if i<3 then pos.x = pos.x-d else @@ -133,7 +133,7 @@ minetest.register_entity(":__builtin:item", { end end end - + local vec = get_flowing_dir(self) if vec then local v = self.object:getvelocity() @@ -159,7 +159,7 @@ minetest.register_entity(":__builtin:item", { return end end - + p.y = p.y - 0.3 local nn = minetest.get_node(p).name -- If node is not registered or node is walkably solid. diff --git a/mods/chesttools/init.lua b/mods/chesttools/init.lua index fa219361..5eae3c3b 100755 --- a/mods/chesttools/init.lua +++ b/mods/chesttools/init.lua @@ -106,7 +106,7 @@ chesttools.on_receive_fields = function(pos, formname, fields, player) selected = 'main'; end local inv_list = 'main'; - if( selected == 'main' ) then + if( selected == 'main' ) then inv_list = 'main'; elseif( selected == 'craft' ) then inv_list = 'craft'; @@ -254,8 +254,8 @@ chesttools.update_chest = function(pos, formname, fields, player) elseif( fields.shared ) then price = 1; end - - elseif( node.name=='chesttools:shared_chest') then + + elseif( node.name=='chesttools:shared_chest') then if( fields.shared) then return; end @@ -321,7 +321,7 @@ chesttools.update_chest = function(pos, formname, fields, player) minetest.swap_node( pos, { name = target, param2 = node.param2 }); minetest.chat_send_player( pname, 'Chest changed to '..tostring( minetest.registered_nodes[ target].description ).. - ' for '..tostring( price )..' steel ingots.'); + ' for '..tostring( price )..' steel ingots.'); end @@ -334,7 +334,7 @@ chesttools.form_input_handler = function( player, formname, fields) elseif( formname == "chesttools:update") then chesttools.update_chest( pos, formname, fields, player); end - + return; end end @@ -435,9 +435,9 @@ minetest.register_node( 'chesttools:shared_chest', { return nil; end - if( node.name=='default:chest' - or node.name=='default:chest_locked' - or node.name=='chesttools:shared_chest') then + if( node.name=='default:chest' + or node.name=='default:chest_locked' + or node.name=='chesttools:shared_chest') then local formspec = "size[8,4]".. "label[2,0.4;Change chest type:]".. @@ -464,7 +464,7 @@ minetest.register_node( 'chesttools:shared_chest', { formspec = formspec..'item_image[5,1;1.5,1.5;chesttools:shared_chest]'.. 'label[5,2.5;shared]'; end - minetest.show_formspec( name, "chesttools:update", formspec ); + minetest.show_formspec( name, "chesttools:update", formspec ); end return nil; end, diff --git a/mods/christmas_craft/crafts.lua b/mods/christmas_craft/crafts.lua index 70c5ece6..fa556616 100755 --- a/mods/christmas_craft/crafts.lua +++ b/mods/christmas_craft/crafts.lua @@ -136,7 +136,7 @@ minetest.register_craft({ }) -------------------------- --- presents - +-- presents - -------------------------- -- paper colour craft -- diff --git a/mods/christmas_craft/init.lua b/mods/christmas_craft/init.lua index aba5ac31..31d03bad 100755 --- a/mods/christmas_craft/init.lua +++ b/mods/christmas_craft/init.lua @@ -11,7 +11,7 @@ minetest.register_node("christmas_craft:snowman", { paramtype2 = "facedir", groups = {crumbly=3}, sounds = default.node_sound_sand_defaults(), -}) +}) @@ -30,7 +30,7 @@ minetest.register_node("christmas_craft:christmas_lights", { selection_box = { type = "wallmounted", }, - groups = {oddly_breakable_by_hand = 3}, + groups = {oddly_breakable_by_hand = 3}, }) minetest.register_node("christmas_craft:christmas_wreath", { @@ -46,7 +46,7 @@ minetest.register_node("christmas_craft:christmas_wreath", { selection_box = { type = "wallmounted", }, - groups = {oddly_breakable_by_hand = 3}, + groups = {oddly_breakable_by_hand = 3}, }) minetest.register_node("christmas_craft:christmas_star", { @@ -92,9 +92,9 @@ minetest.register_node("christmas_craft:red_baubles", { fixed = { {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, - + -- side , top , side , side , bottom, side, - + }, }, selection_box = { @@ -119,9 +119,9 @@ minetest.register_node("christmas_craft:yellow_baubles", { fixed = { {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, - + -- side , top , side , side , bottom, side, - + }, }, selection_box = { @@ -146,9 +146,9 @@ minetest.register_node("christmas_craft:green_baubles", { fixed = { {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, - + -- side , top , side , side , bottom, side, - + }, }, selection_box = { @@ -174,9 +174,9 @@ minetest.register_node("christmas_craft:blue_baubles", { fixed = { {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, - + -- side , top , side , side , bottom, side, - + }, }, selection_box = { @@ -201,9 +201,9 @@ minetest.register_node("christmas_craft:orange_baubles", { fixed = { {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, - + -- side , top , side , side , bottom, side, - + }, }, selection_box = { @@ -228,9 +228,9 @@ minetest.register_node("christmas_craft:violet_baubles", { fixed = { {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, - + -- side , top , side , side , bottom, side, - + }, }, selection_box = { @@ -255,9 +255,9 @@ minetest.register_node("christmas_craft:pink_baubles", { fixed = { {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, - + -- side , top , side , side , bottom, side, - + }, }, selection_box = { @@ -282,9 +282,9 @@ minetest.register_node("christmas_craft:silver_baubles", { fixed = { {-0.25, 0.438, -0.25, 0.25, -0.05, 0.25}, {-0.08, 0.5, -0.08, 0.08, -0.0, 0.08}, - + -- side , top , side , side , bottom, side, - + }, }, selection_box = { @@ -298,9 +298,9 @@ minetest.register_node("christmas_craft:silver_baubles", { ------------ --nodes-- - + -- presents -- - + minetest.register_node("christmas_craft:present_box", { description = "Present Box", tiles = {"christmas_craft_present_box.png"}, @@ -309,7 +309,7 @@ minetest.register_node("christmas_craft:silver_baubles", { groups = {crumbly=3}, sounds = default.node_sound_sand_defaults(), }) - + minetest.register_node("christmas_craft:Christmas_present", { description = "Christmas Present", tiles = {"christmas_craft_present_wh.png^christmas_craft_bow_top.png", "christmas_craft_present_wh.png^christmas_craft_bow_bottom.png", "christmas_craft_present_wh.png^christmas_craft_bow_side.png"}, @@ -334,13 +334,13 @@ minetest.register_node("christmas_craft:silver_baubles", { {items = {'fake_fire:flint_and_steel'}, rarity = 90,}, {items = {'default:chest_locked'}, rarity = 80,}, {items = {'default:brick'}, rarity = 80,}, - {items = {'default:dirt_with_grass'}, rarity = 80,}, + {items = {'default:dirt_with_grass'}, rarity = 80,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), }) - + minetest.register_node("christmas_craft:Christmas_present_green", { description = "Christmas Present Green ", tiles = {"christmas_craft_present_gr.png^christmas_craft_bow_top.png", "christmas_craft_present_gr.png^christmas_craft_bow_bottom.png", "christmas_craft_present_gr.png^christmas_craft_bow_side.png"}, @@ -365,13 +365,13 @@ minetest.register_node("christmas_craft:silver_baubles", { {items = {'fake_fire:flint_and_steel'}, rarity = 15,}, {items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:brick'}, rarity = 25,}, - {items = {'default:dirt_with_grass'}, rarity = 30,}, + {items = {'default:dirt_with_grass'}, rarity = 30,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), }) - + minetest.register_node("christmas_craft:Christmas_present_red", { description = "Christmas Present Red ", tiles = {"christmas_craft_present_re.png^christmas_craft_bow_top.png", "christmas_craft_present_re.png^christmas_craft_bow_bottom.png", "christmas_craft_present_re.png^christmas_craft_bow_side.png"}, @@ -396,7 +396,7 @@ minetest.register_node("christmas_craft:silver_baubles", { {items = {'fake_fire:flint_and_steel'}, rarity = 15,}, {items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:brick'}, rarity = 25,}, - {items = {'default:dirt_with_grass'}, rarity = 30,}, + {items = {'default:dirt_with_grass'}, rarity = 30,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, @@ -427,13 +427,13 @@ minetest.register_node("christmas_craft:silver_baubles", { {items = {'fake_fire:flint_and_steel'}, rarity = 15,}, {items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:brick'}, rarity = 25,}, - {items = {'default:dirt_with_grass'}, rarity = 30,}, + {items = {'default:dirt_with_grass'}, rarity = 30,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), }) - + minetest.register_node("christmas_craft:Christmas_present_yellow", { description = "Christmas Present Yellow ", tiles = {"christmas_craft_present_ye.png^christmas_craft_bow_top.png", "christmas_craft_present_ye.png^christmas_craft_bow_bottom.png", "christmas_craft_present_ye.png^christmas_craft_bow_side.png"}, @@ -458,13 +458,13 @@ minetest.register_node("christmas_craft:silver_baubles", { {items = {'fake_fire:flint_and_steel'}, rarity = 15,}, {items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:brick'}, rarity = 25,}, - {items = {'default:dirt_with_grass'}, rarity = 30,}, + {items = {'default:dirt_with_grass'}, rarity = 30,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), }) - + minetest.register_node("christmas_craft:Christmas_present_red", { description = "Christmas Present Red ", tiles = {"christmas_craft_present_re.png^christmas_craft_bow_top.png", "christmas_craft_present_re.png^christmas_craft_bow_bottom.png", "christmas_craft_present_re.png^christmas_craft_bow_side.png"}, @@ -489,13 +489,13 @@ minetest.register_node("christmas_craft:silver_baubles", { {items = {'fake_fire:flint_and_steel'}, rarity = 15,}, {items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:brick'}, rarity = 25,}, - {items = {'default:dirt_with_grass'}, rarity = 30,}, + {items = {'default:dirt_with_grass'}, rarity = 30,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), }) - + minetest.register_node("christmas_craft:Christmas_present_violet", { description = "Christmas Present Violet ", tiles = {"christmas_craft_present_vi.png^christmas_craft_bow_top.png", "christmas_craft_present_vi.png^christmas_craft_bow_bottom.png", "christmas_craft_present_vi.png^christmas_craft_bow_side.png"}, @@ -520,13 +520,13 @@ minetest.register_node("christmas_craft:silver_baubles", { {items = {'fake_fire:flint_and_steel'}, rarity = 15,}, {items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:brick'}, rarity = 25,}, - {items = {'default:dirt_with_grass'}, rarity = 30,}, + {items = {'default:dirt_with_grass'}, rarity = 30,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), }) - + minetest.register_node("christmas_craft:Christmas_present_orange", { description = "Christmas Present Orange ", tiles = {"christmas_craft_present_or.png^christmas_craft_bow_top.png", "christmas_craft_present_or.png^christmas_craft_bow_bottom.png", "christmas_craft_present_or.png^christmas_craft_bow_side.png"}, @@ -551,13 +551,13 @@ minetest.register_node("christmas_craft:silver_baubles", { {items = {'fake_fire:flint_and_steel'}, rarity = 15,}, {items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:brick'}, rarity = 25,}, - {items = {'default:dirt_with_grass'}, rarity = 30,}, + {items = {'default:dirt_with_grass'}, rarity = 30,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), }) - + minetest.register_node("christmas_craft:Christmas_present_pink", { description = "Christmas Present Pink ", tiles = {"christmas_craft_present_pi.png^christmas_craft_bow_top.png", "christmas_craft_present_pi.png^christmas_craft_bow_bottom.png", "christmas_craft_present_pi.png^christmas_craft_bow_side.png"}, @@ -582,8 +582,8 @@ minetest.register_node("christmas_craft:silver_baubles", { {items = {'fake_fire:flint_and_steel'}, rarity = 15,}, {items = {'default:chest_locked'}, rarity = 20,}, {items = {'default:brick'}, rarity = 25,}, - {items = {'default:dirt_with_grass'}, rarity = 30,}, - }}, + {items = {'default:dirt_with_grass'}, rarity = 30,}, + }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), @@ -643,32 +643,32 @@ minetest.register_node("christmas_craft:silver_baubles", { stack_max = 99, liquids_pointable = false, }) - + -- string -- - + minetest.register_craftitem("christmas_craft:red_ribbon", { description = "Red Ribbon", inventory_image = "christmas_craft_red_ribbon.png", stack_max = 99, liquids_pointable = false, }) - + -- wish list -- - + minetest.register_craftitem("christmas_craft:wish_list", { description = "Wish list", inventory_image = "christmas_craft_which_list.png", stack_max = 99, liquids_pointable = false, }) - + ------------ -- minetest.register_craftitem("christmas_craft:snow_ball", { -- description = "Snow ball", -- inventory_image = "snow_ball.png", -- stack_max = 16, --- liquids_pointable = false, +-- liquids_pointable = false, --}) @@ -705,7 +705,7 @@ minetest.register_node("christmas_craft:silver_baubles", { }) --]] --- complex node -- +-- complex node -- snowball_DAMAGE=0.5 snowball_GRAVITY=9 @@ -734,7 +734,7 @@ snow_snowball_ENTITY={ textures = {"snowball.png"}, lastpos={}, collisionbox = {-0.25,-0.25,-0.25, 0.25,0.25,0.25}, - + } @@ -743,7 +743,7 @@ snow_snowball_ENTITY.on_step = function(self, dtime) self.timer=self.timer+dtime local pos = self.object:getpos() local node = minetest.get_node(pos) - + --Become item when hitting a node. if self.lastpos.x~=nil then --If there is no lastpos for some reason. if node.name ~= "air" then @@ -754,10 +754,10 @@ snow_snowball_ENTITY.on_step = function(self, dtime) {pos = pos, gain = 1.0, max_hear_distance = 32,}) self.object:remove() end - + end self.lastpos={x=pos.x, y=pos.y, z=pos.z} -- Set lastpos-->Node will be added at last pos outside the node - + end minetest.register_entity("christmas_craft:snowball_entity", snow_snowball_ENTITY) diff --git a/mods/christmas_craft/mods.lua b/mods/christmas_craft/mods.lua index 33b60123..5d5f8ef6 100755 --- a/mods/christmas_craft/mods.lua +++ b/mods/christmas_craft/mods.lua @@ -1,6 +1,6 @@ print (" ---- mods override is Loading! ---- ") --- leaves -- +-- leaves -- --minetest.register_node(":4seasons:leaves_winter", { @@ -29,7 +29,7 @@ minetest.register_node(":4seasons:grass_winter", { drop = { max_items = 2, items = { {items = {'default:dirt'}, rarity = 0,}, - {items = {'christmas_craft:snowball'}, rarity = 0,}, + {items = {'christmas_craft:snowball'}, rarity = 0,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, @@ -45,7 +45,7 @@ minetest.register_node(":4seasons:sand_winter", { drop = {'default:sand', max_items = 2, items = { {items = {'default:sand'}, rarity = 0,}, - {items = {'christmas_craft:snowball'}, rarity = 0,}, + {items = {'christmas_craft:snowball'}, rarity = 0,}, }}, sounds = default.node_sound_dirt_defaults({ @@ -61,7 +61,7 @@ minetest.register_node(":4seasons:desertsand_winter", { drop = {'default:desert_sand', max_items = 2, items = { {items = {'default:desert_sand'}, rarity = 0,}, - {items = {'christmas_craft:snowball'}, rarity = 0,}, + {items = {'christmas_craft:snowball'}, rarity = 0,}, }}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, @@ -78,7 +78,7 @@ minetest.register_node(":4seasons:cactus_winter", { drop = {'default:cactus', max_items = 2, items = { {items = {'default:cactus'}, rarity = 0,}, - {items = {'christmas_craft:snowball'}, rarity = 0,}, + {items = {'christmas_craft:snowball'}, rarity = 0,}, }}, sounds = default.node_sound_wood_defaults(), }) \ No newline at end of file diff --git a/mods/christmas_craft/settings.lua b/mods/christmas_craft/settings.lua index 29fd5dde..836a6866 100755 --- a/mods/christmas_craft/settings.lua +++ b/mods/christmas_craft/settings.lua @@ -52,10 +52,10 @@ minetest.register_node(":default:leaves", { selection_box = { type = "fixed", fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, }, }, -}) +}) -- remplace jungleleaves minetest.register_node(":default:jungleleaves", { description = "Jungle Leaves", @@ -90,7 +90,7 @@ minetest.register_node(":default:jungleleaves", { selection_box = { type = "fixed", fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, }, }, }) diff --git a/mods/coloredwood/fence.lua b/mods/coloredwood/fence.lua index 3bda324c..486a61c8 100755 --- a/mods/coloredwood/fence.lua +++ b/mods/coloredwood/fence.lua @@ -37,7 +37,7 @@ for shade = 1, 3 do drawtype = "fencelike", description = nodedesc, tiles = { pngname }, - inventory_image = pngnameinv, + inventory_image = pngnameinv, wield_image = pngnameinv, sunlight_propagates = colored_block_sunlight, paramtype = "light", @@ -54,7 +54,7 @@ for shade = 1, 3 do drawtype = "fencelike", description = s50nodedesc, tiles = { s50pngname }, - inventory_image = s50pngnameinv, + inventory_image = s50pngnameinv, wield_image = s50pngnameinv, sunlight_propagates = colored_block_sunlight, paramtype = "light", @@ -151,7 +151,7 @@ for hue = 1, 12 do drawtype = "fencelike", description = nodedesc, tiles = { pngname }, - inventory_image = pngnameinv, + inventory_image = pngnameinv, wield_image = pngnameinv, sunlight_propagates = colored_block_sunlight, paramtype = "light", @@ -252,7 +252,7 @@ for grey = 1,5 do drawtype = "fencelike", description = nodedesc, tiles = { pngname }, - inventory_image = pngnameinv, + inventory_image = pngnameinv, wield_image = pngnameinv, sunlight_propagates = colored_block_sunlight, paramtype = "light", diff --git a/mods/coloredwood/stick.lua b/mods/coloredwood/stick.lua index 09778ce7..a3ea8847 100755 --- a/mods/coloredwood/stick.lua +++ b/mods/coloredwood/stick.lua @@ -98,7 +98,7 @@ for hue = 1, 12 do } }) end - + -- ============================================================ -- The 5 levels of greyscale. diff --git a/mods/coloredwood/wood.lua b/mods/coloredwood/wood.lua index 2a604e27..e190132f 100755 --- a/mods/coloredwood/wood.lua +++ b/mods/coloredwood/wood.lua @@ -20,7 +20,7 @@ local colored_block_sound = "default.node_sound_wood_defaults()" -- Show the wood planks in the crafting guide: -- Value copy the groups table to another one to pass to stairsplus:register_all() -- oherwise stairsplus:register_all() will add the ["not_in_creative_inventory"] = 1 key/value to the groups --- of the original table and force the coloredwood planks to be removed from the crafting guide. +-- of the original table and force the coloredwood planks to be removed from the crafting guide. local stairsplus_groups = {} if coloredwood.enable_stairsplus then for k, v in pairs(colored_block_groups) do @@ -179,7 +179,7 @@ for hue = 1, 12 do }, }) end - + -- ============================================================ -- The 5 levels of greyscale. diff --git a/mods/colormachine/init.lua b/mods/colormachine/init.lua index 3266ac6f..9ca17662 100755 --- a/mods/colormachine/init.lua +++ b/mods/colormachine/init.lua @@ -22,7 +22,7 @@ -- Version 0.6 --- Changelog: +-- Changelog: -- 23.05.15 As all dyes can be crafted into other dyes, only white dye is consumed - provided the -- other dyes needed for the crafting chain are stored. -- 22.05.15 Added support for new homedecor meshnodes. @@ -61,7 +61,7 @@ -- Added some more labels in the main menu to make it easier to understand. -- 22.07.13 Added textures provided by Vanessae -- fixed a bug concerning normal dyes (when unifieddyes is not installed) - + -- adds a function to check ownership of a node; taken from VanessaEs homedecor mod colormachine = {}; @@ -86,14 +86,14 @@ local stained_glass_exception = 0; -- the names of suitable sources of that color (note: this does not work by group!); -- you can add your own color sources here if you want -colormachine.basic_dye_sources = { "flowers:rose", "flowers:tulip", "flowers:dandelion_yellow", +colormachine.basic_dye_sources = { "flowers:rose", "flowers:tulip", "flowers:dandelion_yellow", "", "default:cactus", "", "", "", -- no lime, no aqua, no cyan, no skyblue "flowers:geranium", "flowers:viola", "", "", -- no magenta, no redviolet "default:clay_lump", "", "", "", "default:coal_lump" }; -- if flowers is not installed -colormachine.alternate_basic_dye_sources = { - "default:apple", "default:desert_stone", "default:sand", +colormachine.alternate_basic_dye_sources = { + "default:apple", "default:desert_stone", "default:sand", "", "default:cactus", "", "", "", "default:leaves", "", "", "" , "default:clay_lump", "", "", "", "default:coal_lump" }; @@ -115,11 +115,11 @@ colormachine.dye_mixes = { red = {}, -- base color white = {}, -- base color lightgrey = {13,15}, -- white + grey - grey = {13,17}, -- black + white + grey = {13,17}, -- black + white darkgrey = {15,17}, -- grey + black black = {}, -- base color } - + -- construct the formspec for the color selector @@ -140,7 +140,7 @@ end -- defines the order in which blocks are shown -- nr: the diffrent block types need to be ordered by some system; the number defines that order --- modname: some mods define more than one type of colored blocks; the modname is needed +-- modname: some mods define more than one type of colored blocks; the modname is needed -- for checking if the mod is installed and for creating colored blocks -- shades: some mods (or parts thereof) do not support all possible shades -- grey_shades: some mods support only some shades of grey (or none at all) @@ -166,7 +166,7 @@ colormachine.data = { hardenedclay_ = { nr=3.5, modname='hardenedclay', shades={1,0,1,0,0,0,1,0}, grey_shades={1,0,1,1,1}, u=0, descr="hclay", block="hardenedclay:hardened_clay_white", add="hardened_clay_", p=16}, colouredstonebricks_ = { nr=3.6, modname='colouredstonebricks', shades={1,0,1,0,0,0,1,0}, grey_shades={1,0,1,1,1}, u=0, descr="cbrick", block="default:stonebrick", add="", p=1}, - + clstone_stone_ = { nr=3.7, modname='clstone', shades={1,0,1,0,0,0,1,0}, grey_shades={1,0,1,1,1}, u=0, descr="clstone",block="default:stone", add="", p=1, obj_postfix='_stone' }, colorcubes_1_ = { nr=3.8, modname='colorcubes', shades={1,0,1,0,0,0,1,0}, grey_shades={1,0,1,1,1}, u=0, descr="ccubes",block="default:stone", add="", p=1, obj_postfix='_single' }, @@ -403,7 +403,7 @@ colormachine.generate_form = function( m_prefix ) "label[0.3,1;light]"; -- not all mods offer all shades (and some offer even more) - local supported = colormachine.data[ m_prefix ].shades; + local supported = colormachine.data[ m_prefix ].shades; if( supported[2]==0 ) then form = form.. @@ -510,7 +510,7 @@ colormachine.decode_color_name = function( meta, new_color ) table.remove( liste, 1 ); -- the color has been selected end end - + -- the color was not found! error! keep the old color if( selected_color == -1 ) then if( meta ) then @@ -595,8 +595,8 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob if( meta ~= nil ) then c = tonumber(meta:get_string('selected_color')); - s = tonumber(meta:get_string('selected_shade')); - g = tonumber(meta:get_string('selected_grey_shade')); + s = tonumber(meta:get_string('selected_shade')); + g = tonumber(meta:get_string('selected_grey_shade')); end @@ -608,7 +608,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob local k_orig = k; -- unifieddyes_ does not supply all colors - if( k == 'unifieddyes_' + if( k == 'unifieddyes_' and ( (g==-1 and s==3 and (as_obj_name==1 or not(c==4 or c==6 or c==8 or c==12 or c==13 ))) or (g==-1 and s==1 and c==1 ) -- pink or (g==-1 and s==7 and c==5 ) -- dark brown @@ -646,7 +646,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob return 'homedecor:'..colormachine.data[k].add..'brown'..(colormachine.data[k].postfix or ''); end end - + if( k=='homedecor_table_' and as_obj_name==1 and new_color=='dark_orange' ) then return 'homedecor:'..colormachine.data[k].add..'mahogany'..(colormachine.data[k].postfix or ''); end @@ -661,8 +661,8 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob end -- beds and sofas are available in less colors - if( g==-1 - and (c==7 or c==11) + if( g==-1 + and (c==7 or c==11) and (k=='beds_bed_top_top_' or k=='lrfurn_sofa_right_front_' or k=='lrfurn_armchair_front_' or k=='lrfurn_longsofa_middle_front_' )) then return nil; @@ -674,7 +674,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob local color_used = ""; if( s==1 and c==1 ) then color_used = 'pink'; -- in blox, this is called "pink"; normally "light_red" - elseif( g>-1 ) then + elseif( g>-1 ) then color_used = colormachine.grey_names[ g ]; elseif( s ~= 3 ) then return nil; -- only normal saturation supported @@ -692,7 +692,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob return 'blox_'..( color_used )..( colormachine.data[k].add )..'.png'; end end - + local postfix = '.png'; local prefix = k; @@ -709,12 +709,12 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob return nil; -- no grey values for them end local h_trans = {yellow=1, lime=2, green=3, aqua=4, cyan=5, skyblue=6, blue=7, violet=8, magenta=9, redviolet=10, red=11,orange=12}; - + local h = h_trans[ colormachine.colors[c] ]; local b = ""; local sat = ""; - + if( k == 'stained_glass_' ) then prefix = "stained_glass:"..(colormachine.colors[c]).."_"; if( s==1 or s==2) then b = "8"; -- light @@ -723,7 +723,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob elseif( s==7 or s==8) then b = "3"; -- dark end prefix = prefix.."_"; - + sat = "7"; if( s==2 or s==4 or s==6 or s==8 ) then -- saturation sat = "6"; @@ -747,7 +747,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob if( s==1 and new_color=='light_blue' ) then -- only light blue is supported return prefix..'light_blue'..postfix; - + elseif( new_color=='dark_green' ) then return prefix..'forest_green'..postfix; @@ -760,14 +760,14 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob elseif( new_color=='orange' ) then return prefix..'oak'..postfix; - + end end if( k=='cotton_' and new_color=='grey') then new_color = 'mediumgrey'; end - + if( k=='framedglass_' and as_obj_name ~= 1) then postfix = 'glass.png'; @@ -791,7 +791,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob end -- those have split textures... - if( colormachine.data[k].modname == 'coloredblocks') then + if( colormachine.data[k].modname == 'coloredblocks') then @@ -818,7 +818,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob return 'coloredblocks_'..new_color..postfix; - elseif( new_color..'_' == colormachine.data[k].add ) then + elseif( new_color..'_' == colormachine.data[k].add ) then prefix = 'coloredblocks:'; --]] @@ -827,7 +827,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob end if( colormachine.data[k].modname == 'plasticbox' - and new_color == 'dark_green') then + and new_color == 'dark_green') then return prefix..'darkgreen'..postfix; end @@ -835,11 +835,11 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob if( as_obj_name == 1 and colormachine.data[k].obj_postfix ) then postfix = (colormachine.data[k].obj_postfix) ..postfix; end - + -- normal dyes (also used for wool) use a diffrent naming scheme if( colormachine.data[k].u == 0) then if( new_color == 'darkgrey' and k ~= 'framedglass_') then - return prefix..'dark_grey'..postfix; + return prefix..'dark_grey'..postfix; elseif( new_color == 'dark_orange' ) then return prefix..'brown'..postfix; elseif( new_color == 'dark_green' ) then @@ -847,7 +847,7 @@ colormachine.translate_color_name = function( meta, k, new_color, c, s, g, as_ob elseif( new_color == 'light_red' ) then return prefix..'pink'..postfix; -- lime, aqua, skyblue and redviolet do not exist as standard wool/dye colors - elseif( g == -1 and (c==4 or c==6 or c==8 or c==12) and k_orig ~= 'unifieddyes_') then + elseif( g == -1 and (c==4 or c==6 or c==8 or c==12) and k_orig ~= 'unifieddyes_') then return nil; -- all other colors of normal dye/wool exist only in normal shade elseif( g == -1 and s~= 3 and k_orig ~= 'unifieddyes_') then @@ -872,16 +872,16 @@ colormachine.get_color_from_blockname = function( mod_name, block_name ) if( mod_name == v.modname ) then table.insert( found, k ); end - end + end if( #found < 1 ) then return { error_code ="Sorry, this block is not supported by the spray booth.", found_name = "", blocktype = ""}; end - - -- another case of special treatment needed; at least the color is given in the tiles - if( mod_name =='stained_glass' and stained_glass_exception==1) then + + -- another case of special treatment needed; at least the color is given in the tiles + if( mod_name =='stained_glass' and stained_glass_exception==1) then local original_node = minetest.registered_items[ bname ]; if( original_node ~= nil ) then @@ -891,7 +891,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name ) end end - -- this mod does not seperate modname and objectname well enough :-( Naming scheme:- steel_framed_obsidian_glassCOLOR + -- this mod does not seperate modname and objectname well enough :-( Naming scheme:- steel_framed_obsidian_glassCOLOR if( mod_name =='framedglass' ) then block_name = string.sub( block_name, 28 ); end @@ -909,13 +909,13 @@ colormachine.get_color_from_blockname = function( mod_name, block_name ) local bloxdescr = original_node.description; -- bloxparts[1] will be filled with the name of the color: local bloxparts = string.split( bloxdescr, " "); - -- now extract the blocktype information + -- now extract the blocktype information if( bloxparts ~= nil and #bloxparts > 0 ) then -- we split with the color name local found_name = bloxparts[1]; local blocktype = 'blox_'..string.sub( block_name, string.len( found_name )+1 )..'_'; - + -- handle pink and purple if( found_name == 'pink' ) then found_name = 'light_red'; @@ -931,7 +931,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name ) -- if this point is reached, the decoding of the blox-block-name has failed return { error_code = "Error: Failed to decode color of this blox-block.", found_name = "", - blocktype = "" }; + blocktype = "" }; end @@ -944,9 +944,9 @@ colormachine.get_color_from_blockname = function( mod_name, block_name ) elseif( block_name == 'shutter_mahogany' ) then block_name = 'shutter_dark_orange'; - + -- this is the default, unpainted one..which can also be considered as "orange" in the menu --- elseif( blockname == 'shutter_oak' ) then +-- elseif( blockname == 'shutter_oak' ) then -- block_name = 'shutter_orange'; end end @@ -968,7 +968,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name ) if( colormachine.data[k].obj_postfix ) then local l = string.len( colormachine.data[k].obj_postfix); - if( string.len( block_name ) > l + if( string.len( block_name ) > l and string.sub( block_name, -1*l ) == colormachine.data[k].obj_postfix ) then block_name = string.sub( block_name, 1, (-1*l)-1 ); @@ -992,14 +992,14 @@ colormachine.get_color_from_blockname = function( mod_name, block_name ) liste[ curr_index ] = 'dark'; table.insert( liste, 'orange' ); curr_index = curr_index + 1; - + -- pink <=> light_red elseif( #liste > 0 and liste[ curr_index ]=='pink' ) then liste[ curr_index ] = 'light'; table.insert( liste, 'red' ); curr_index = curr_index + 1; end - + -- find out the saturation - either "s50" or omitted local sat = 0; if( curr_index > 1 and liste[ curr_index ] == "s50" ) then @@ -1060,7 +1060,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name ) -- for blocks that do not follow the naming scheme - the color cannot be decoded if( g==-1 and c==0 ) then - return { error_code ="This is a colored block: "..tostring( bname )..".", + return { error_code ="This is a colored block: "..tostring( bname )..".", found_name = "", blocktype = ""}; end @@ -1072,7 +1072,7 @@ colormachine.get_color_from_blockname = function( mod_name, block_name ) for k,v in pairs( colormachine.data ) do -- prefix and postfix have to fit - if( curr_index > 0 and add=="" and mod_name == v.modname and (liste[ curr_index ].."_") == v.add + if( curr_index > 0 and add=="" and mod_name == v.modname and (liste[ curr_index ].."_") == v.add -- if a postfix exists, we did check for that before and set blocktype accordingly and( not( blocktype ) or blocktype=='' or blocktype==k)) then add = v.add; @@ -1133,13 +1133,13 @@ colormachine.blocktype_menu = function( meta, new_color, page ) local y = 2; for i,k in ipairs( colormachine.ordered ) do - + -- only installed mods are of intrest - if( k ~= nil and colormachine.data[ k ].installed == 1 and i > start_at_offset and i <= (start_at_offset + per_page)) then + if( k ~= nil and colormachine.data[ k ].installed == 1 and i > start_at_offset and i <= (start_at_offset + per_page)) then -- that particular mod may not offer this color form = form.."button["..tostring(x)..","..tostring(y-0.8).. ";1,1;"..k..";"..colormachine.data[k].descr.."]".. - "item_image["..tostring(x)..","..tostring(y )..";1,1;"..colormachine.data[k].block.."]"; + "item_image["..tostring(x)..","..tostring(y )..";1,1;"..colormachine.data[k].block.."]"; local button = colormachine.print_color_image( meta, k, new_color, nil, nil, nil, tostring(x), tostring(y+1), 1);-- translated_color as return value for button if( button ~= "" ) then @@ -1198,7 +1198,7 @@ colormachine.main_menu_formspec = function( pos, option ) "label[3,0.0;1. Input - Insert material to paint:]".. "list[current_name;input;4.5,0.5;1,1;]".. - + "label[9.3,-0.5;Additional storage for dyes:]".. "list[current_name;extrastore;9.3,0;5,9]"; @@ -1228,7 +1228,7 @@ colormachine.main_menu_formspec = function( pos, option ) if( bname == v.block and colormachine.data[ k ].installed==1) then table.insert( found, k ); end - end + end -- make sure all output fields are empty for i = 1, inv:get_size( "output" ) do @@ -1288,13 +1288,13 @@ colormachine.main_menu_formspec = function( pos, option ) end -- so that we can determine the factor when taking blocks from the output slots meta:set_string('p_values', minetest.serialize( p_values )); - + -- this color was not supported if( anz_found == 0 ) then form = form.."label[2.2,3.0;Block is not available in that color.]"; return form; end - + form = form.."label[3.0,1.2;2. Select color for any style:]".. "label[3.0,2.9;3. Take output (determines style):]".. "list[current_name;output;"..tostring(out_offset+1)..",3.5;"..tostring( anz_found )..",1;]"; @@ -1308,7 +1308,7 @@ colormachine.main_menu_formspec = function( pos, option ) form = form.."label[2.2,3.0;ERROR! Failed to analyze the name of this node: "..tostring(bname).."]"; return form; end - + -- it may be a dye source for i,v in ipairs( colormachine.basic_dye_sources ) do @@ -1330,7 +1330,7 @@ colormachine.main_menu_formspec = function( pos, option ) -- the previous analyse was necessary in order to determine which block we ought to use if( option == 'remove_paint' ) then - -- actually remove the paint from the + -- actually remove the paint from the inv:set_stack( "input", 1, colormachine.data[ found_color_data.blocktype ].block.." "..tostring( anz_blocks )); -- update display (we changed the input!) return colormachine.main_menu_formspec(pos, "analyze"); @@ -1353,7 +1353,7 @@ colormachine.main_menu_formspec = function( pos, option ) else form = form.."label[5.5,2.0;This is the selected color.]"; end - + return form; end @@ -1368,7 +1368,7 @@ colormachine.get_node_name_painted = function( old_node_name, dye_node_name ) table.insert( possible_blocks, k ); unpainted_block = old_node_name; end - end + end if( unpainted_block == "" ) then local parts = string.split(old_node_name,":"); @@ -1399,7 +1399,7 @@ colormachine.get_node_name_painted = function( old_node_name, dye_node_name ) table.insert( possible_blocks, k ); end end - end + end -- remove paint if( not( dye_node_name ) or dye_node_name == "") then @@ -1429,7 +1429,7 @@ colormachine.get_node_name_painted = function( old_node_name, dye_node_name ) local new_block_name = colormachine.translate_color_name( nil, k, dye_name, cdata.c, cdata.s, cdata.g, 1 ); table.insert( found, new_block_name ); - end + end if( #found < 1 ) then return; end @@ -1468,7 +1468,7 @@ colormachine.allow_inventory_access = function(pos, listname, index, stack, play local stack_name = stack:get_name(); -- the dyes are a bit special - they accept only powder of the correct name - if( listname == "dyes" + if( listname == "dyes" and stack_name ~= ("dye:".. colormachine.colors_and_greys[ index ]) and stack_name ~= ("unifieddyes:"..colormachine.colors_and_greys[ index ]) and (stack_name ~= "dye:light_grey" or colormachine.colors_and_greys[ index ]~="lightgrey" ) @@ -1500,7 +1500,7 @@ end colormachine.on_metadata_inventory_put = function( pos, listname, index, stack, player ) - + local meta = minetest.get_meta(pos); local inv = meta:get_inventory(); @@ -1558,7 +1558,7 @@ end colormachine.on_metadata_inventory_take = function( pos, listname, index, stack, player ) - + local meta = minetest.get_meta(pos); local inv = meta:get_inventory(); @@ -1598,7 +1598,7 @@ colormachine.on_metadata_inventory_take = function( pos, listname, index, stack, else inv:set_stack( "input", 1, inv:get_stack("input",1):get_name().." "..tostring( anz_present )); end - + -- the main menu needs to be updated as well meta:set_string( 'formspec', colormachine.main_menu_formspec( pos, "analyze" )); return; @@ -1637,7 +1637,7 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume ) needed[ colormachine.colors[ c ]] = 1; -- handle saturation if( s==1 ) then needed[ "white" ]=1; -- light --- elseif( s==3 ) then -- normal color - no changes needed +-- elseif( s==3 ) then -- normal color - no changes needed elseif( s==4 ) then needed[ "white" ]=2; needed[ "black" ] =1; -- normal, low saturation elseif( s==5 ) then needed[ "black" ] =1; -- medium dark elseif( s==6 ) then needed[ "white" ]=1; needed[ "black" ] =1; -- medium dark, low saturation @@ -1651,7 +1651,7 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume ) anz_pigments = anz_pigments + v; end - + -- n: portions of *mixtures* needed local n = 1; -- if the colors are to be consumed, we need to calculate how many we actually need @@ -1663,7 +1663,7 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume ) -- now we need to check how many pigments of each color we have for i,v in ipairs( colormachine.colors_and_greys ) do - if( needed[ v ] and needed[ v ]> 0 ) then + if( needed[ v ] and needed[ v ]> 0 ) then -- find out how many blocks of this type we can actually color local stack = inv:get_stack( "dyes", i ); @@ -1688,8 +1688,8 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume ) n = math.min( anz_white, need_white ); end - - + + -- return how many *could* be colored if( amount_needed > 0 and do_consume ~= 1 ) then return n*anz_pigments; @@ -1700,8 +1700,8 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume ) for i,v in ipairs( colormachine.colors_and_greys ) do - if( needed[ v ] and needed[ v ]> 0 ) then - + if( needed[ v ] and needed[ v ]> 0 ) then + -- show how many pigments of this color are needed for the selected mixture -- normal color if( i <= #colormachine.colors ) then @@ -1717,9 +1717,9 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume ) if( amount_needed > 0 and n > 0 ) then local stack = inv:get_stack( "dyes", i ); local found = stack:get_count(); - --print( ' CONSUMED '..math.floor( n * needed[ v ] )..' of '..tostring( stack:get_name())); + --print( ' CONSUMED '..math.floor( n * needed[ v ] )..' of '..tostring( stack:get_name())); if( found > math.floor( n * needed[ v ] )) then - inv:set_stack( "dyes", i, stack:get_name()..' '..tostring( math.max( 1, found - math.floor( n * needed[ v ] )))); + inv:set_stack( "dyes", i, stack:get_name()..' '..tostring( math.max( 1, found - math.floor( n * needed[ v ] )))); else inv:set_stack( "dyes", i, "" ); end @@ -1730,7 +1730,7 @@ colormachine.calc_dyes_needed = function( meta, inv, amount_needed, do_consume ) -- in case pigments where consumed, return how many blocks where colored successfully if( amount_needed > 0 and n > 0 ) then ---print('Successfully colored: '..tostring( n*anz_pigments )); +--print('Successfully colored: '..tostring( n*anz_pigments )); return n*anz_pigments; end @@ -1763,9 +1763,9 @@ colormachine.mix_colors = function( inv, i, sender ) local stack1 = inv:get_stack( "dyes", mix[1] ); local stack2 = inv:get_stack( "dyes", mix[2] ); local stack3 = inv:get_stack( "dyes", i ); - - if( stack3:get_free_space() > 1 -- we need space for two + + if( stack3:get_free_space() > 1 -- we need space for two and stack1:get_count() > 0 and stack2:get_count() > 0 ) then @@ -1794,12 +1794,12 @@ colormachine.mix_colors = function( inv, i, sender ) elseif( stack3:get_free_space() > 1 ) then minetest.chat_send_player( sender:get_player_name(), 'Need '..colormachine.colors_and_greys[ mix[1] ]..' and '.. - colormachine.colors_and_greys[ mix[2] ]..' in order to mix '..farbe..'.'); + colormachine.colors_and_greys[ mix[2] ]..' in order to mix '..farbe..'.'); end end --- this generates the formspec for all supported mods and the general colormachine.dye_management_formspec +-- this generates the formspec for all supported mods and the general colormachine.dye_management_formspec colormachine.init = function() local liste = {}; -- create formspecs for all machines @@ -1820,7 +1820,7 @@ colormachine.init = function() end end - table.sort( liste, function(a,b) return colormachine.data[a].nr < colormachine.data[b].nr end); + table.sort( liste, function(a,b) return colormachine.data[a].nr < colormachine.data[b].nr end); colormachine.ordered = liste; -- if no flowers are present, take dye sources from default (so we only have to depend on dyes) @@ -1854,7 +1854,7 @@ colormachine.init = function() -- align colors horizontal for i,k in ipairs( colormachine.colors ) do - + local prefix = 'dye:'; if( i==4 or i==6 or i==8 or i==12 or i==14 ) then if( colormachine.data[ 'unifieddyes_' ].installed == 1 ) then @@ -1871,15 +1871,15 @@ colormachine.init = function() form = form.."item_image["..tostring(i)..",1;1,1;"..source.."]"; -- even those colors may be additionally mixed - if( #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then + if( #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then form = form.. "button["..tostring(i-0.1)..",1.9;0.8,0.2;mix_"..colormachine.colors_and_greys[ i ]..";mix]"; end -- a color that can be mixed - elseif( #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then + elseif( #colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ] == 2 ) then local mixes = colormachine.dye_mixes[ colormachine.colors_and_greys[ i ] ]; - + local source1 = 'dye:'..colormachine.colors_and_greys[ mixes[1] ]; local source2 = 'dye:'..colormachine.colors_and_greys[ mixes[2] ]; @@ -1887,7 +1887,7 @@ colormachine.init = function() "item_image["..tostring(i+0.3)..",1.3;1,1;"..source2.."]".. "button["..tostring(i-0.1)..",1.9;0.8,0.2;mix_"..colormachine.colors_and_greys[ i ]..";mix]"; end - + form = form.. "item_image["..tostring(i)..",2;1,1;"..tostring( prefix..colormachine.colors[ i ] ).."]".. "label["..tostring(i)..",3.6;" ..tostring( colormachine.colors_and_greys[ i ] ).."]"; else @@ -1897,14 +1897,14 @@ colormachine.init = function() -- align grey-values vertical for i,k in ipairs( colormachine.grey_names ) do - + if( i ~= 2 or colormachine.data[ 'unifieddyes_' ].installed == 1 ) then local source = colormachine.basic_dye_sources[ #colormachine.colors + i ]; if( source and source ~= "" ) then form = form.."item_image[10,"..tostring(i+4)..";1,1;"..source.."]"; - elseif( #colormachine.dye_mixes[ colormachine.colors_and_greys[ #colormachine.colors + i ] ] == 2 ) then + elseif( #colormachine.dye_mixes[ colormachine.colors_and_greys[ #colormachine.colors + i ] ] == 2 ) then local mixes = colormachine.dye_mixes[ colormachine.colors_and_greys[ #colormachine.colors + i ] ]; @@ -1915,7 +1915,7 @@ colormachine.init = function() "item_image[10.3,"..tostring(i+4.3)..";1,1;"..source2.."]".. "button[9.8," ..tostring(i+4.9)..";0.8,0.2;mix_"..colormachine.colors_and_greys[ #colormachine.colors + i ]..";mix]"; end - + local dye_name = 'dye:'..k; -- lightgrey exists only in unifieddyes @@ -1930,7 +1930,7 @@ colormachine.init = function() elseif( i==4 ) then dye_name = 'dye:dark_grey'; end - + if( dye_name ~= "" ) then form = form.. "item_image[11,"..tostring(i+4)..";1,1;"..tostring( dye_name ).."]".. "label[ 12.9,"..tostring(i+4)..";" ..tostring( colormachine.colors_and_greys[ #colormachine.colors + i ] ).."]"; @@ -1939,8 +1939,8 @@ colormachine.init = function() form = form.."label[12.2,"..tostring(i+4)..";n/a]"; end end - - + + colormachine.dye_management_formspec = form; end @@ -1957,7 +1957,7 @@ minetest.after( 0, colormachine.init ); -- unifiedbricks: clay blocks, brick blocks (skip individual clay lumps and bricks!) -- multicolor: 3 shades, usual amount of colors -- cotton: (by jordach) probably the same as coloredwood --- +-- -- stained_glass: 9 shades/intensities @@ -2051,15 +2051,15 @@ minetest.register_node("colormachine:colormachine", { return; elseif( colormachine.data[ k ] ) then -- remember the page we where at - meta:set_string( 'formspec', colormachine.data[ k ].formspec.. + meta:set_string( 'formspec', colormachine.data[ k ].formspec.. "field[20,20;0.1,0.1;page;;"..tostring(fields.page).."]" ); return; elseif( k=='key_escape') then -- nothing to do else local inv = meta:get_inventory(); - - -- perhaps we ought to mix colors + + -- perhaps we ought to mix colors for i,f in ipairs( colormachine.colors_and_greys ) do if( k==("mix_"..f )) then colormachine.mix_colors( inv, i, sender ); @@ -2083,8 +2083,8 @@ minetest.register_node("colormachine:colormachine", { elseif( k=='last_page') then fields.page = math.ceil(#colormachine.ordered/(3*13)-1); end - - meta:set_string( 'formspec', colormachine.blocktype_menu( meta, k, fields.page )); + + meta:set_string( 'formspec', colormachine.blocktype_menu( meta, k, fields.page )); else @@ -2102,7 +2102,7 @@ minetest.register_node("colormachine:colormachine", { return 0; end, - + allow_metadata_inventory_put = function(pos, listname, index, stack, player) return colormachine.allow_inventory_access(pos, listname, index, stack, player, "put" ); end, @@ -2131,13 +2131,13 @@ minetest.register_node("colormachine:colormachine", { if( not( inv:is_empty("input")) or not( inv:is_empty("refill"))) then - minetest.chat_send_player( player:get_player_name(), "Please remove the material in the input- and/or refill slot first!"); - meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0)); + minetest.chat_send_player( player:get_player_name(), "Please remove the material in the input- and/or refill slot first!"); + meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0)); return false; end if( not( inv:is_empty("dyes"))) then - minetest.chat_send_player( player:get_player_name(), "Please remove the stored dyes first!"); - meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0 )); + minetest.chat_send_player( player:get_player_name(), "Please remove the stored dyes first!"); + meta:set_string( 'formspec', colormachine.blocktype_menu( meta, meta:get_string('selected_name'), 0 )); return false; end diff --git a/mods/columnia/init.lua b/mods/columnia/init.lua index fcbae41c..10aef516 100755 --- a/mods/columnia/init.lua +++ b/mods/columnia/init.lua @@ -18,8 +18,8 @@ minetest.register_craft({ } }) --- Bracket -minetest.register_node("columnia:bracket", { +-- Bracket +minetest.register_node("columnia:bracket", { description = 'Bracket (Column)', tiles = {"columnia_rusty.png",}, drawtype = "nodebox", @@ -40,7 +40,7 @@ minetest.register_node("columnia:bracket", { groups = {choppy=2, oddly_breakable_by_hand=2,}, sounds = default.node_sound_stone_defaults(), }) - + minetest.register_craft({ output = 'columnia:bracket 4', recipe = { @@ -70,7 +70,7 @@ minetest.register_node("columnia:lamp_ceiling", { type = "fixed", fixed = { {-0.1875, 0.4375, -0.1875, 0.1875, 0.5, 0.1875}, - {-0.125, 0.375, -0.125, 0.125, 0.4375, 0.125}, + {-0.125, 0.375, -0.125, 0.125, 0.4375, 0.125}, }, }, sounds = default.node_sound_glass_defaults(), @@ -189,7 +189,7 @@ function columnia.register_column_top(subname, recipeitem, groups, images, descr type = "fixed", fixed = { {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25}, - {-0.5, 0.25, -0.5, 0.5, 0.5, 0.5}, + {-0.5, 0.25, -0.5, 0.5, 0.5, 0.5}, {-0.375, 0, -0.375, 0.375, 0.5, 0.375}, }, }, @@ -545,7 +545,7 @@ columnia.register_column_ia("stone", "default:stone", "Stone Column Link", "Stone Column Linkdown", default.node_sound_stone_defaults()) - + columnia.register_column_ia("stonebrick", "default:stonebrick", {cracky=3}, {"default_stone_brick.png"}, @@ -566,7 +566,7 @@ columnia.register_column_ia("desert_stonebrick", "default:desert_stonebrick", "Desert Stone Brick Column Crosslink", "Desert Stone Brick Column Link", "Desert Stone Brick Column Linkdown", - default.node_sound_stone_defaults()) + default.node_sound_stone_defaults()) columnia.register_column_ia("desert_stone", "default:desert_stone", {cracky=3}, @@ -577,8 +577,8 @@ columnia.register_column_ia("desert_stone", "default:desert_stone", "Desert Stone Column Crosslink", "Desert Stone Column Link", "Desert Stone Column Linkdown", - default.node_sound_stone_defaults()) - + default.node_sound_stone_defaults()) + columnia.register_column_ia("cobble", "default:cobble", {cracky=3}, {"default_cobble.png"}, @@ -599,8 +599,8 @@ columnia.register_column_ia("brick", "default:brick", "Brick Column Crosslink", "Brick Column Link", "Brick Column Linkdown", - default.node_sound_stone_defaults()) - + default.node_sound_stone_defaults()) + columnia.register_column_ia("sandstone", "default:sandstone", {crumbly=2,cracky=2}, {"default_sandstone.png"}, @@ -611,7 +611,7 @@ columnia.register_column_ia("sandstone", "default:sandstone", "Sandstone Column Link", "Sandstone Column Linkdown", default.node_sound_stone_defaults()) - + columnia.register_column_ia("sandstonebrick", "default:sandstonebrick", {crumbly=2,cracky=2}, {"default_sandstone_brick.png"}, @@ -622,7 +622,7 @@ columnia.register_column_ia("sandstonebrick", "default:sandstonebrick", "Sandstone Brick Column Link", "Sandstone Brick Column Linkdown", default.node_sound_stone_defaults()) - + columnia.register_column_ia("wood", "default:wood", {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3}, {"default_wood.png"}, diff --git a/mods/compassgps/cgpsmap.lua b/mods/compassgps/cgpsmap.lua index cab62ed6..13c0c011 100755 --- a/mods/compassgps/cgpsmap.lua +++ b/mods/compassgps/cgpsmap.lua @@ -139,7 +139,7 @@ minetest.register_craftitem("compassgps:cgpsmap_marked", { e:setyaw(yaw) local dist=math.abs(pos.x-x)+math.abs(pos.y-y)+math.abs(pos.z-z) if growing_wall_maps == false then - e:set_properties({visual_size={x=0.85,y=0.85}}) + e:set_properties({visual_size={x=0.85,y=0.85}}) elseif dist>30000 then e:set_properties({visual_size={x=3.45,y=3.45}}) elseif dist>15000 then diff --git a/mods/darkage/crafts.lua b/mods/darkage/crafts.lua index 2897fd16..6db3dfc6 100755 --- a/mods/darkage/crafts.lua +++ b/mods/darkage/crafts.lua @@ -100,7 +100,7 @@ if minetest.get_modpath("farming") == nil then {"default:dry_shrub","default:dry_shrub"}, } }) - + minetest.register_craft({ output = "darkage:straw 2", recipe = { @@ -131,7 +131,7 @@ else {"default:dry_shrub","default:dry_shrub"}, } }) - + minetest.register_craft({ output = "farming:straw 2", recipe = { @@ -139,7 +139,7 @@ else {"darkage:dry_leaves","darkage:dry_leaves"}, } }) - + minetest.register_craft({ output = "darkage:straw_bale", recipe = { @@ -147,7 +147,7 @@ else {"farming:straw","farming:straw"}, } }) - + minetest.register_craft({ output = "darkage:adobe 4", recipe = { diff --git a/mods/darkage/mapgen.lua b/mods/darkage/mapgen.lua index 6d91643a..446cac5e 100755 --- a/mods/darkage/mapgen.lua +++ b/mods/darkage/mapgen.lua @@ -155,7 +155,7 @@ local function generate_claylike(name, minp, maxp, seed, chance, minh, maxh, dir end if num_water_around >= 3 then is_shallow = false - end + end if is_shallow then for x1=-divlen,divlen do for z1=-divlen,divlen do diff --git a/mods/darkage/stairs.lua b/mods/darkage/stairs.lua index 5be881af..e41fe4d2 100755 --- a/mods/darkage/stairs.lua +++ b/mods/darkage/stairs.lua @@ -7,7 +7,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "marble", "darkage:marble", { description = "Marble", tiles = {"darkage_marble.png"}, @@ -15,7 +15,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "serpentine", "darkage:serpentine", { description = "Serpentine", tiles = {"darkage_serpentine.png"}, @@ -23,7 +23,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "ors", "darkage:ors", { description = "Old Red Sandstone", tiles = {"darkage_ors.png"}, @@ -31,7 +31,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "schist", "darkage:schist", { description = "Schist", tiles = {"darkage_schist.png"}, @@ -39,7 +39,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "slate", "darkage:slate", { description = "Slate", tiles = {"darkage_slate.png"}, @@ -47,7 +47,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "gneiss", "darkage:gneiss", { description = "Gneiss", tiles = {"darkage_gneiss.png"}, @@ -55,7 +55,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "chalk", "darkage:chalk", { description = "Chalk", tiles = {"darkage_chalk.png"}, @@ -63,7 +63,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "slate_cobble", "darkage:slate_cobble", { description = "Slate Cobble", tiles = {"darkage_slate_cobble.png"}, @@ -71,7 +71,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "ors_cobble", "darkage:ors_cobble", { description = "Old Red Sandstone Cobble", tiles = {"darkage_ors_cobble.png"}, @@ -79,7 +79,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "gneiss_cobble", "darkage:gneiss_cobble", { description = "Gneiss Cobble", tiles = {"darkage_gneiss_cobble.png"}, @@ -87,7 +87,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "basalt_cobble", "darkage:basalt_cobble", { description = "Basalt Cobble", tiles = {"darkage_basalt_cobble.png"}, @@ -113,7 +113,7 @@ if stairsplus then sunlight_propagates = true, }) end - + stairsplus:register_all("darkage", "straw_bale", "darkage:straw_bale", { description = "Straw Bale", tiles = {"darkage_straw_bale.png"}, @@ -121,7 +121,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "slate_tile", "darkage:slate_tile", { description = "Slate Tile", tiles = {"darkage_slate_tile.png"}, @@ -129,7 +129,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "marble_tile", "darkage:marble_tile", { description = "Marble Tile", tiles = {"darkage_marble_tile.png"}, @@ -137,7 +137,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "stone_brick", "darkage:stone_brick", { description = "Stone Brick", tiles = {"darkage_stone_brick.png"}, @@ -145,7 +145,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "reinforced_chalk", "darkage:reinforced_chalk", { description = "Reinforced Chalk", tiles = {"darkage_chalk.png^darkage_reinforce.png"}, @@ -153,7 +153,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "glass", "darkage:glass", { description = "Medieval Glass", tiles = {"darkage_glass.png"}, @@ -161,7 +161,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "glow_glass", "darkage:glow_glass", { description = "Medieval Glow Glass", tiles = {"darkage_glass.png"}, @@ -171,7 +171,7 @@ if stairsplus then sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) - + stairsplus:register_all("darkage", "reinforced_wood", "darkage:reinforced_wood", { description = "Reinforced Wood", tiles = {"default_wood.png^darkage_reinforce.png"}, @@ -189,7 +189,7 @@ elseif stairs then "Basalt Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("marble", "darkage:marble", {cracky=3}, {"darkage_marble.png"}, @@ -197,7 +197,7 @@ elseif stairs then "Marble Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("marble", "darkage:serpentine", {cracky=3}, {"darkage_serpentine.png"}, @@ -205,7 +205,7 @@ elseif stairs then "Serpentine Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("ors", "darkage:ors", {crumbly=2,cracky=2}, {"darkage_ors.png"}, @@ -213,7 +213,7 @@ elseif stairs then "Old Red Sandstone Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("schist", "darkage:schist", {cracky=3}, {"darkage_schist.png"}, @@ -221,7 +221,7 @@ elseif stairs then "Schist Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("slate", "darkage:slate", {cracky=2}, {"darkage_slate.png"}, @@ -229,7 +229,7 @@ elseif stairs then "Slate Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("gneiss", "darkage:gneiss", {cracky=3}, {"darkage_gneiss.png"}, @@ -237,7 +237,7 @@ elseif stairs then "Gneiss Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("chalk", "darkage:chalk", {crumbly=2,cracky=2}, {"darkage_chalk.png"}, @@ -245,7 +245,7 @@ elseif stairs then "Chalk Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("slate_cobble", "darkage:slate_cobble", {cracky=2}, {"darkage_slate_cobble.png"}, @@ -253,7 +253,7 @@ elseif stairs then "Slate Cobble Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("ors_cobble", "darkage:ors_cobble", {crumbly=2,cracky=2}, {"darkage_ors_cobble.png"}, @@ -261,7 +261,7 @@ elseif stairs then "Old Red Sandstone Cobble Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("gneiss_cobble", "darkage:gneiss_cobble", {crumbly=2,cracky=2}, {"darkage_gneiss_cobble.png"}, @@ -269,7 +269,7 @@ elseif stairs then "Gneiss Cobble Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("basalt_cobble", "darkage:basalt_cobble", {cracky=3}, {"darkage_basalt_cobble.png"}, @@ -302,7 +302,7 @@ elseif stairs then "Straw Bale Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("slate_tile", "darkage:slate_tile", {cracky=2}, {"darkage_slate_tile.png"}, @@ -310,7 +310,7 @@ elseif stairs then "Slate Tile Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("marble_tile", "darkage:marble_tile", {cracky=2}, {"darkage_marble_tile.png"}, @@ -318,7 +318,7 @@ elseif stairs then "Marble Tile Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("stone_brick", "darkage:stone_brick", {cracky=3}, {"darkage_stone_brick.png"}, @@ -326,7 +326,7 @@ elseif stairs then "Stone Brick Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("reinforced_chalk", "darkage:reinforced_chalk", {cracky=3}, {"darkage_chalk.png^darkage_reinforce.png"}, @@ -334,7 +334,7 @@ elseif stairs then "Reinforced Chalk Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("glass", "darkage:glass", {snappy=2,cracky=3,oddly_breakable_by_hand=3}, {"darkage_glass.png"}, @@ -342,7 +342,7 @@ elseif stairs then "Medieval Glass Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("glow_glass", "darkage:glow_glass", {snappy=2,cracky=3,oddly_breakable_by_hand=3}, {"darkage_glass.png"}, @@ -350,7 +350,7 @@ elseif stairs then "Medieval Glow Glass Slab", default.node_sound_stone_defaults() ) - + stairs.register_stair_and_slab("reinforced_wood", "darkage:reinforced_wood", {snappy=2,choppy=3,oddly_breakable_by_hand=3,flammable=3}, {"default_wood.png^darkage_reinforce.png"}, @@ -358,5 +358,5 @@ elseif stairs then "Reinforced Wood Slab", default.node_sound_stone_defaults() ) - + end diff --git a/mods/death_messages/init.lua b/mods/death_messages/init.lua index 1f539233..d748415d 100755 --- a/mods/death_messages/init.lua +++ b/mods/death_messages/init.lua @@ -115,7 +115,7 @@ if RANDOM_MESSAGES == true then minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player:get_player_name(),"other")}) sound_play_all(player:get_player_name()) end) - + else minetest.register_on_dieplayer(function(player) local player_name = player:get_player_name() diff --git a/mods/dropondie/init.lua b/mods/dropondie/init.lua index d7b90d52..d725c616 100755 --- a/mods/dropondie/init.lua +++ b/mods/dropondie/init.lua @@ -42,7 +42,7 @@ minetest.register_on_dieplayer(function(player) -- Drop unified_inventory bags and their contents if minetest.get_modpath("unified_inventory") then - + local bag_id = {"bag1", "bag2", "bag3", "bag4"} local contents_id = "" local n = 0 diff --git a/mods/eventobjects/init.lua b/mods/eventobjects/init.lua index 9c57b131..d15a01c0 100755 --- a/mods/eventobjects/init.lua +++ b/mods/eventobjects/init.lua @@ -60,7 +60,7 @@ minetest.register_node("eventobjects:surprise_node", { end end, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - + end, on_punch = function(pos, node, puncher, pointed_things) -- Spawn betweek 5 and 20 random nodes diff --git a/mods/factions/chatcommands.lua b/mods/factions/chatcommands.lua index e37fddda..31f47a19 100755 --- a/mods/factions/chatcommands.lua +++ b/mods/factions/chatcommands.lua @@ -31,14 +31,14 @@ function factions_chat.init() give_to_singleplayer = true, } ) - + minetest.register_privilege("faction_admin", { description = "this user is allowed to create or delete factions", give_to_singleplayer = true, } ) - + minetest.register_chatcommand("factions", { params = " .. ", @@ -47,7 +47,7 @@ function factions_chat.init() func = factions_chat.cmdhandler, } ) - + minetest.register_chatcommand("af", { params = "text", @@ -56,7 +56,7 @@ function factions_chat.init() func = factions_chat.allfactions_chathandler, } ) - + minetest.register_chatcommand("f", { params = " text", @@ -82,13 +82,13 @@ function factions_chat.cmdhandler(playername,parameter) local player = minetest.get_player_by_name(playername) local params = parameter:split(" ") local cmd = params[1] - + --handle common commands if parameter == nil or parameter == "" then - + local playerfactions = factions.get_factions(player) - + local tosend = "Factions: " .. playername .. " factions:" for i,v in ipairs(playerfactions) do if i ~= #playerfactions then @@ -96,33 +96,33 @@ function factions_chat.cmdhandler(playername,parameter) else tosend = tosend .. " " .. v end - end + end minetest.chat_send_player(playername, tosend, false) return end - + --list all known factions if cmd == "list" then local list = factions.get_faction_list() local tosend = "Factions: current available factions:" - + for i,v in ipairs(list) do if i ~= #list then tosend = tosend .. " " .. v .. "," else tosend = tosend .. " " .. v end - end + end minetest.chat_send_player(playername, tosend, false) return end - + --show factions mod version if cmd == "version" then minetest.chat_send_player(playername, "Factions: version " .. factions_version , false) return end - + --show description of faction if cmd == "info" then if params[2] ~= nil then @@ -132,7 +132,7 @@ function factions_chat.cmdhandler(playername,parameter) return end end - + if cmd == "leave" then if params[2] ~= nil then if params[3] ~= nil then @@ -141,22 +141,22 @@ function factions_chat.cmdhandler(playername,parameter) if minetest.check_player_privs(playername,{ faction_admin=true }) or factions.is_admin(params[2],playername) and toremove ~= nil then - + factions.member_remove(params[2],toremove) - minetest.chat_send_player(playername, - "Factions: " .. params[3] .. " has been removed from " + minetest.chat_send_player(playername, + "Factions: " .. params[3] .. " has been removed from " .. params[2], false) return end else factions.member_remove(params[2],player) - minetest.chat_send_player(playername, + minetest.chat_send_player(playername, "Factions: You have left " .. params[2], false) return end end end - + --handle superadmin only commands if minetest.check_player_privs(playername,{ faction_admin=true }) then --create new faction @@ -176,14 +176,14 @@ function factions_chat.cmdhandler(playername,parameter) end end end - + if cmd == "join" then - if params[2] ~= nil then + if params[2] ~= nil then if params[3] ~= nil and minetest.check_player_privs(playername,{ faction_admin=true }) then - + local toadd = minetest.get_player_by_name(params[3]) - + if toadd ~= nil then if factions.member_add(params[2],toadd) then minetest.chat_send_player(playername, @@ -219,16 +219,16 @@ function factions_chat.cmdhandler(playername,parameter) "Factions: you are not allowed to join " .. params[2], false) return - end + end end end end - + --all following commands require at least two parameters if params[2] ~= nil then if minetest.check_player_privs(playername,{ faction_admin=true }) or factions.is_admin(params[2],playername) then - + --delete faction if cmd == "delete" then if factions.delete_faction(params[2]) then @@ -243,19 +243,19 @@ function factions_chat.cmdhandler(playername,parameter) return end end - + if cmd == "set_free" then if params[3] ~= nil and (params[3] == "true" or params[3] == "false")then - + local value = false if params[3] == "true" then value = true end - + if factions.set_free(params[2],value) then minetest.chat_send_player(playername, - "Factions: free to join for " .. params[2] .. + "Factions: free to join for " .. params[2] .. " has been set to " .. params[3], false) else @@ -266,20 +266,20 @@ function factions_chat.cmdhandler(playername,parameter) end end end - + --set player admin status if cmd == "admin" then if params[3] ~= nil and params[4] ~= nil and (params[4] == "true" or params[4] == "false") then - + local value = false if params[4] == "true" then value = true end - + if factions.set_admin(params[2],params[3],value) then minetest.chat_send_player(playername, - "Factions: adminstate of " .. params[3] .. + "Factions: adminstate of " .. params[3] .. " has been set to " .. params[4], false) else @@ -291,40 +291,40 @@ function factions_chat.cmdhandler(playername,parameter) end return end - + if cmd == "description" and params[2] ~= nil and params[3] ~= nil then - + local desc = params[3] for i=4, #params, 1 do desc = desc .. " " .. params[i] end if factions.set_description(params[2],desc) then minetest.chat_send_player(playername, - "Factions: updated description of faction " .. + "Factions: updated description of faction " .. params[2], false) return else minetest.chat_send_player(playername, - "Factions: FAILED to update description of faction " .. + "Factions: FAILED to update description of faction " .. params[2], false) return end end - + if cmd == "invite" and params[2] ~= nil and params[3] ~= nil then if factions.member_invite(params[2],params[3]) then minetest.chat_send_player(params[3], - "Factions: " .. params[3] .. + "Factions: " .. params[3] .. " you have been invited to join faction " .. params[2], false) minetest.chat_send_player(playername, - "Factions: " .. params[3] .. + "Factions: " .. params[3] .. " has been invited to join faction " .. params[2], false) return @@ -353,22 +353,22 @@ end --! @param parameter data supplied to command ------------------------------------------------------------------------------- function factions_chat.allfactions_chathandler(playername,parameter) - + local player = minetest.get_player_by_name(playername) - + if player ~= nil then local recipients = {} - + for faction,value in pairs(factions.get_factions(player)) do for name,value in pairs(factions.dynamic_data.membertable[faction]) do local object_to_check = minetest.get_player_by_name(name) - + if object_to_check ~= nil then recipients[name] = true end end end - + for recipient,value in pairs(recipients) do if recipient ~= playername then minetest.chat_send_player(recipient,playername ..": " .. parameter,false) @@ -390,26 +390,26 @@ end --! @param parameter data supplied to command ------------------------------------------------------------------------------- function factions_chat.chathandler(playername,parameter) - - local player = minetest.get_player_by_name(playername) - + + local player = minetest.get_player_by_name(playername) + if player ~= nil then - local line = parameter:split(" ") - local target_faction = line[1] + local line = parameter:split(" ") + local target_faction = line[1] local text = line[2] for i=3,#line,1 do text = text .. " " .. line[i] end - + local valid_faction = false - + for faction,value in pairs(factions.get_factions(player)) do if target_faction == faction then valid_faction = true end end - + if faction ~= nil and valid_faction and factions.dynamic_data.membertable[faction] ~= nil then for name,value in pairs(factions.dynamic_data.membertable[faction]) do @@ -443,7 +443,7 @@ function factions_chat.show_help(playername) local MSG = function(text) minetest.chat_send_player(playername,text,false) end - + MSG("Factions mod") MSG("Usage:") MSG("\tUser commands:") @@ -453,7 +453,7 @@ function factions_chat.show_help(playername) MSG("\t\t/factions leave -> leave specified faction") MSG("\t\t/factions join -> join specified faction") MSG("\t\t/factions version -> show version number of mod") - + MSG("\tAdmin commands:") MSG("\t\t/factions create -> create a new faction") MSG("\t\t/factions delete -> delete a faction faction") diff --git a/mods/factions/factions.lua b/mods/factions/factions.lua index fe0b8fa1..aa3443f7 100755 --- a/mods/factions/factions.lua +++ b/mods/factions/factions.lua @@ -53,11 +53,11 @@ function factions.add_faction(name) factions.data.factions[name].base_reputation = {} factions.data.factions[name].adminlist = {} factions.data.factions[name].invitations = {} - + factions.dynamic_data.membertable[name] = {} - + factions.save() - + return true end @@ -81,7 +81,7 @@ function factions.set_base_reputation(faction1,faction2,value) if factions.data.factions[faction1] ~= nil and factions.data.factions[faction2] ~= nil then - + factions.data.factions[faction1].base_reputation[faction2] = value factions.data.factions[faction2].base_reputation[faction1] = value factions.save() @@ -166,13 +166,13 @@ end --! @return true/false ------------------------------------------------------------------------------- function factions.exists(name) - + for key,value in pairs(factions.data.factions) do if key == name then return true end end - + return false end @@ -188,11 +188,11 @@ end function factions.get_faction_list() local retval = {} - + for key,value in pairs(factions.data.factions) do table.insert(retval,key) end - + return retval end @@ -210,9 +210,9 @@ end function factions.delete_faction(name) factions.data.factions[name] = nil - + factions.save() - + if factions.data.factions[name] == nil then return true end @@ -235,25 +235,25 @@ end function factions.member_add(name, object) local new_entry = {} new_entry.factions = {} - + if object.object ~= nil then object = object.object end - + if not factions.exists(name) then print("Unable to add to NON existant faction >" .. name .. "<") return false end - + new_entry.name,new_entry.temporary = factions.get_name(object) - + factions.dbg_lvl2("Adding name=" .. dump(new_entry.name) .. " to faction: " .. name ) - + if new_entry.name ~= nil then if factions.data.objects[new_entry.name] == nil then factions.data.objects[new_entry.name] = new_entry end - + if factions.data.objects[new_entry.name].factions[name] == nil then factions.data.objects[new_entry.name].factions[name] = true factions.dynamic_data.membertable[name][new_entry.name] = true @@ -262,7 +262,7 @@ function factions.member_add(name, object) return true end end - + --return false if no valid object or already member return false end @@ -287,7 +287,7 @@ function factions.member_invite(name, playername) factions.save() return true end - + --return false if not a valid faction or player already invited return false end @@ -307,9 +307,9 @@ end function factions.member_remove(name,object) local id,type = factions.get_name(object) - + factions.dbg_lvl2("removing name=" .. dump(id) .. " to faction: " .. name ) - + if id ~= nil and factions.data.objects[id] ~= nil and factions.data.objects[id].factions[name] ~= nil then @@ -318,7 +318,7 @@ function factions.member_remove(name,object) factions.save() return true end - + if id ~= nil and factions.data.factions[name].invitations[id] ~= nil then factions.data.factions[name].invitations[id] = nil @@ -414,7 +414,7 @@ function factions.is_free(name) factions.data.factions[name].open then return true end - + return false end @@ -436,7 +436,7 @@ function factions.is_admin(name,playername) factions.data.factions[name].adminlist[playername] == true then return true end - + return false end @@ -459,7 +459,7 @@ function factions.is_invited(name,playername) factions.data.factions[name].open == true) then return true end - + return false end @@ -477,7 +477,7 @@ end function factions.get_factions(object) local id,type = factions.get_name(object) - + local retval = {} if id ~= nil and factions.data.objects[id] ~= nil then @@ -485,7 +485,7 @@ function factions.get_factions(object) table.insert(retval,key) end end - + return retval end @@ -504,7 +504,7 @@ end function factions.is_member(name,object) local retval = false - + local id,type = factions.get_name(object) if id ~= nil and @@ -516,7 +516,7 @@ function factions.is_member(name,object) end end end - + return retval end @@ -536,14 +536,14 @@ end function factions.get_reputation(name,object) local id,type = factions.get_name(object) - + factions.dbg_lvl3("get_reputation: " .. name .. "<-->" .. dump(id)) - + if id ~= nil and factions.data.factions[name] ~= nil then - + factions.dbg_lvl3("get_reputation: object reputation: " .. dump(factions.data.factions[name].reputation[id])) - + if factions.data.factions[name].reputation[id] == nil then factions.data.factions[name].reputation[id] = factions.calc_base_reputation(name,object) @@ -571,21 +571,21 @@ end --! @return true/false ------------------------------------------------------------------------------- function factions.modify_reputation(name,object,delta) - + local id,type = factions.get_name(object) - + if factions.data.factions[name] ~= nil then if factions.data.factions[name].reputation[id] == nil then factions.data.factions[name].reputation[id] = factions.calc_base_reputation(name,object) end - + factions.data.factions[name].reputation[id] = factions.data.factions[name].reputation[id] + delta factions.save() return true end - + return false end @@ -604,21 +604,21 @@ function factions.get_name(object) if object == nil then return nil,true end - + if object.object ~= nil then object = object.object end - + if object:is_player() then return object:get_player_name(),false else local luaentity = object:get_luaentity() - + if luaentity ~= nil then return tostring(luaentity),true end end - + return nil,true end @@ -639,9 +639,9 @@ function factions.calc_base_reputation(name,object) --calculate initial reputation based uppon all groups local object_factions = factions.get_factions(object) local rep_value = 0 - + factions.dbg_lvl3("calc_base_reputation: " .. name .. " <--> " .. tostring(object)) - + if object_factions ~= nil then factions.dbg_lvl3("calc_base_reputation: " .. tostring(object) .. " is in " .. #object_factions .. " factions") for k,v in pairs(object_factions) do @@ -655,10 +655,10 @@ function factions.calc_base_reputation(name,object) end end end - + rep_value = rep_value / #object_factions end - + return rep_value end @@ -675,16 +675,16 @@ function factions.save() --due to figuring out which data to save and which is temporary only --all data is saved here --this implies data needs to be cleant up on load - + local file,error = io.open(factions_worldid .. "/" .. "factions.conf","w") - + if file ~= nil then file:write(minetest.serialize(factions.data)) file:close() else minetest.log("error","MOD factions: unable to save factions world specific data!: " .. error) end - + end ------------------------------------------------------------------------------- @@ -698,23 +698,23 @@ end ------------------------------------------------------------------------------- function factions.load() local file,error = io.open(factions_worldid .. "/" .. "factions.conf","r") - + if file ~= nil then local raw_data = file:read("*a") file:close() - + if raw_data ~= nil and raw_data ~= "" then - + local raw_table = minetest.deserialize(raw_data) - - + + --read object data local temp_objects = {} - + if raw_table.objects ~= nil then for key,value in pairs(raw_table.objects) do - + if value.temporary == false then factions.data.objects[key] = value else @@ -722,7 +722,7 @@ function factions.load() end end end - + if raw_table.factions ~= nil then for key,value in pairs(raw_table.factions) do factions.data.factions[key] = {} @@ -730,18 +730,18 @@ function factions.load() factions.data.factions[key].adminlist = value.adminlist factions.data.factions[key].open = value.open factions.data.factions[key].invitations = value.invitations - + factions.data.factions[key].reputation = {} for repkey,repvalue in pairs(value.reputation) do if temp_objects[repkey] == nil then factions.data.factions[key].reputation[repkey] = repvalue end end - + factions.dynamic_data.membertable[key] = {} end end - + --populate dynamic faction member table for id,object in pairs(factions.data.objects) do for name,value in pairs(factions.data.objects[id].factions) do @@ -753,7 +753,7 @@ function factions.load() end else local file,error = io.open(factions_worldid .. "/" .. "factions.conf","w") - + if file ~= nil then file:close() else diff --git a/mods/fail/cookie.lua b/mods/fail/cookie.lua index 2e6f831c..6371e6be 100755 --- a/mods/fail/cookie.lua +++ b/mods/fail/cookie.lua @@ -24,7 +24,7 @@ end minetest.log("action","[FailPoints] CooKies baked") -- Global callbacks -minetest.register_on_shutdown(function() +minetest.register_on_shutdown(function() -- Stocking CooKies pntf = io.open(data.oven,"w") for i,v in pairs(data.cookies) do @@ -48,20 +48,20 @@ minetest.register_chatcommand("cookie", { minetest.chat_send_player(name,"/cookie | ") minetest.chat_send_player(name,"Available subcommands :") minetest.chat_send_player(name," - help : show this help") - minetest.chat_send_player(name," - view | view : View player's CooKies amount") + minetest.chat_send_player(name," - view | view : View player's CooKies amount") return elseif param == "settings" then if not minetest.get_player_privs(name)["server"] then minetest.chat_send_player(name,"You're not allowed to perform this command. (Missing privilege : server)") return end - + minetest.chat_send_player(name,"=== CK_DEBUG_LINES SENT ===") print("=== CK_DEBUG_LINES ===") local send_admin = function(msg) minetest.chat_send_player(name,msg) end - + send_admin("CK File") if pntf ~= nil then send_admin("Found") @@ -69,7 +69,7 @@ minetest.register_chatcommand("cookie", { send_admin("Missing!") end table.foreach(data,print) - + return elseif param == "view" then if param2 == "" or param2 == nil then @@ -80,14 +80,14 @@ minetest.register_chatcommand("cookie", { minetest.chat_send_player(name,"-CK- You own "..owncookies.." CooKies.") return true end - + if data.cookies[param2] ~= nil and data.cookies[param2] > 0 then minetest.chat_send_player(name,"-CK- Player "..param2.." owns "..data.cookies[param2].." CooKies.") else minetest.chat_send_player(name,"-CK- Player "..param2.." doesn't seem to own any CooKie.") end else - + -- If not any known command if name == param then if minetest.get_player_privs(name)["baker"] == true then @@ -100,7 +100,7 @@ minetest.register_chatcommand("cookie", { end return false end - + if param == "" then minetest.chat_send_player(name,"-CK- You failed: Not enough parameters given, type /cookie help for help") return false @@ -110,7 +110,7 @@ minetest.register_chatcommand("cookie", { minetest.chat_send_player(name,"-CK- You failed: Sorry, "..param.." isn't online.") return false end - + -- Take, or not, cookies from name's account to give them to param if minetest.get_player_privs(name)["baker"] ~= true then if data.cookies[name] == nil or data.failpoints[name] == 0 then @@ -122,14 +122,14 @@ minetest.register_chatcommand("cookie", { else minetest.log("action","[FailPoints] "..name.." has baked a CooKie.") end - + -- Give/Add the CooKie to param' account if data.cookies[param] == nil then data.cookies[param] = 1 else data.cookies[param] = data.cookies[param]+1 end - + minetest.log("action","[FailPoints] "..name.." has given a CooKie to "..param) minetest.log("action","[FailPoints] "..param.." now own "..data.cookies[param].."CKs") minetest.log("action","[FailPoints] "..name.." now own "..(data.cookies[name] or 0).."CKs") diff --git a/mods/fail/init.lua b/mods/fail/init.lua index 29f1046b..1c85865a 100755 --- a/mods/fail/init.lua +++ b/mods/fail/init.lua @@ -1,6 +1,6 @@ -- Fails mod By Mg --[[ - + /-----\-\ / /--] \-\ | |-] |-| @@ -48,7 +48,7 @@ end data.is_player_available = minetest.get_player_by_name if data.STRICT_PLAYER_CHECK == false then - + data.is_player_available = function (name) return (io.open(minetest.get_worldpath().."/players/"..name) ~= nil) end @@ -68,7 +68,7 @@ end minetest.log("action","[FailPoints] Loaded") -- Global callbacks -minetest.register_on_shutdown(function() +minetest.register_on_shutdown(function() -- Saving failpoints pntf = io.open(data.fp_file,"w") for i,v in pairs(data.failpoints) do @@ -96,20 +96,20 @@ minetest.register_chatcommand("fail", { minetest.chat_send_player(name,"Available subcommands :") minetest.chat_send_player(name," - help : show this help") minetest.chat_send_player(name," - version : show actual fail version") - minetest.chat_send_player(name," - view | view : View player's failpoints amount") + minetest.chat_send_player(name," - view | view : View player's failpoints amount") return elseif param == "settings" then if not minetest.get_player_privs(name)["server"] then minetest.chat_send_player(name,"You're not allowed to perform this command. (Missing privilege : server)") return end - + minetest.chat_send_player(name,"=== FP_DEBUG_LINES SENT ===") print("=== FP_DEBUG_LINES ===") local send_admin = function(msg) minetest.chat_send_player(name,msg) end - + send_admin("FP File") if pntf ~= nil then send_admin("Found") @@ -117,7 +117,7 @@ minetest.register_chatcommand("fail", { send_admin("Missing!") end table.foreach(data,print) - + return elseif param == "view" then if param2 == "" or param2 == nil then @@ -128,14 +128,14 @@ minetest.register_chatcommand("fail", { minetest.chat_send_player(name,"-FP- You own "..ownfail.." FailPoints.") return true end - + if data.failpoints[param2] ~= nil and data.failpoints[param2] > 0 then minetest.chat_send_player(name,"-FP- Player "..param2.." owns "..data.failpoints[param2].." FailPoints.") else minetest.chat_send_player(name,"-FP- Player "..param2.." doesn't seem to own any FailPoint.") end else - + -- If not any known command if name == param then if minetest.get_player_privs(name)["fp_create"] == true then @@ -148,7 +148,7 @@ minetest.register_chatcommand("fail", { end return false end - + if param == "" then minetest.chat_send_player(name,"-FP- You failed: Not enough parameters given, type /fail help for help") return false @@ -158,7 +158,7 @@ minetest.register_chatcommand("fail", { minetest.chat_send_player(name,"-FP- You failed: Sorry, "..param.." isn't online.") return false end - + -- Take, or not, failpoints from name's account to give them to param if minetest.get_player_privs(name)["fp_create"] ~= true then if data.failpoints[name] == nil or data.failpoints[name] == 0 then @@ -170,14 +170,14 @@ minetest.register_chatcommand("fail", { else minetest.log("action","[FailPoints] "..name.." has created a FailPoint.") end - + -- Give/Add the failpoint to param' account if data.failpoints[param] == nil then data.failpoints[param] = 1 else data.failpoints[param] = data.failpoints[param]+1 end - + minetest.log("action","[FailPoints] "..name.." has given a failpoint to "..param) minetest.log("action","[FailPoints] "..param.." now own "..data.failpoints[param].."FPs") minetest.log("action","[FailPoints] "..name.." now own "..(data.failpoints[name] or 0).."FPs") diff --git a/mods/farming/cocoa.lua b/mods/farming/cocoa.lua index 50dc0bec..d39de09f 100755 --- a/mods/farming/cocoa.lua +++ b/mods/farming/cocoa.lua @@ -8,9 +8,9 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname) if not pt and pt.type ~= "node" then return end - + local under = minetest.get_node(pt.under) - + -- return if any of the nodes is not registered if not minetest.registered_nodes[under.name] then return @@ -20,7 +20,7 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname) if under.name ~= "default:jungletree" then return end - + -- add the node and remove 1 item from the itemstack minetest.add_node(pt.above, {name=plantname}) if not minetest.setting_getbool("creative_mode") then @@ -144,7 +144,7 @@ minetest.register_abm({ elseif dir == 4 then pos.z = pos.z -1 else return end - + if minetest.get_node(pos).name == "air" and minetest.get_node_light(pos) > 12 then -- print ("COCOA", pos.x, pos.y, pos.z) minetest.set_node(pos,{name="farming:cocoa_"..tostring(math.random(1,3))}) diff --git a/mods/farming/corn.lua b/mods/farming/corn.lua index e29c578f..8eb1e93b 100755 --- a/mods/farming/corn.lua +++ b/mods/farming/corn.lua @@ -28,7 +28,7 @@ minetest.register_craft({ --= Ethanol (Thanks to JKMurray for this idea) -minetest.register_craftitem("farming:bottle_ethanol", { +minetest.register_craftitem("farming:bottle_ethanol", { description = "Bottle of Ethanol", inventory_image = "farming_bottle_ethanol.png", }) diff --git a/mods/farming/hoes.lua b/mods/farming/hoes.lua index bad72313..6f1ca2f6 100755 --- a/mods/farming/hoes.lua +++ b/mods/farming/hoes.lua @@ -66,7 +66,7 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses) if not pt or pt.type ~= "node" then return end - + local under = minetest.get_node(pt.under) local upos = pointed_thing.under @@ -77,23 +77,23 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses) local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} local above = minetest.get_node(p) - + -- return if any of the nodes is not registered if not minetest.registered_nodes[under.name] or not minetest.registered_nodes[above.name] then return end - + -- check if the node above the pointed thing is air if above.name ~= "air" then return end - + -- check if pointing at dirt if minetest.get_item_group(under.name, "soil") ~= 1 then return end - + -- turn the node into soil, wear out item and play sound minetest.set_node(pt.under, {name="farming:soil"}) minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5,}) diff --git a/mods/farming/init.lua b/mods/farming/init.lua index e26fce0d..6bf452af 100755 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -404,7 +404,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) -- can I replace above node, and am I pointing at soil if not minetest.registered_nodes[above.name].buildable_to - or minetest.get_item_group(under.name, "soil") < 2 + or minetest.get_item_group(under.name, "soil") < 2 or minetest.get_item_group(above.name, "plant") ~= 0 then -- ADDED this line for multiple seed placement bug return end @@ -471,7 +471,7 @@ farming.register_plant = function(name, def) {items = {mname .. ":seed_" .. pname}, rarity = 18 - i * 2}, } } - + local g = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, growing = 1} -- Last step doesn't need growing=1 so Abm never has to check these if i == def.steps then diff --git a/mods/fences/init.lua b/mods/fences/init.lua index d4fc3b9d..f3caa360 100755 --- a/mods/fences/init.lua +++ b/mods/fences/init.lua @@ -48,15 +48,15 @@ local function find_dock(pos, second) local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} if second > 0 then local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} - minetest.set_node(pos, tmp_node) + minetest.set_node(pos, tmp_node) end elseif code == 0 then if second == 2 then local tmp_node = {name="fences:fence_wood", param1=me.param1, param2=me.param2} - minetest.set_node(pos, tmp_node) + minetest.set_node(pos, tmp_node) end end - + end local function punch(pos, puncher) @@ -576,7 +576,7 @@ minetest.register_craft({ local meta2 local state2 = 0 -local function update_gate(pos, node) +local function update_gate(pos, node) minetest.set_node(pos, node) end diff --git a/mods/fishing/bobber.lua b/mods/fishing/bobber.lua index 23d9d98f..fbb6360a 100755 --- a/mods/fishing/bobber.lua +++ b/mods/fishing/bobber.lua @@ -39,17 +39,17 @@ minetest.register_alias("flowers_plus:seaweed", "flowers:seaweed") -- exception local PLaNTS = { -- MoD* iTeM MeSSaGe ("You caught "..) - {"flowers", "waterlily", "a Waterlily." }, - {"flowers", "waterlily_225", "a Waterlily." }, - {"flowers", "waterlily_45", "a Waterlily." }, - {"flowers", "waterlily_675", "a Waterlily." }, - {"flowers", "waterlily_s1", "a Waterlily." }, - {"flowers", "waterlily_s2", "a Waterlily." }, - {"flowers", "waterlily_s3", "a Waterlily." }, + {"flowers", "waterlily", "a Waterlily." }, + {"flowers", "waterlily_225", "a Waterlily." }, + {"flowers", "waterlily_45", "a Waterlily." }, + {"flowers", "waterlily_675", "a Waterlily." }, + {"flowers", "waterlily_s1", "a Waterlily." }, + {"flowers", "waterlily_s2", "a Waterlily." }, + {"flowers", "waterlily_s3", "a Waterlily." }, {"flowers", "waterlily_s4", "a Waterlily." }, - {"flowers", "seaweed", "some Seaweed."}, - {"flowers", "seaweed_2", "some Seaweed."}, - {"flowers", "seaweed_3", "some Seaweed."}, + {"flowers", "seaweed", "some Seaweed."}, + {"flowers", "seaweed_2", "some Seaweed."}, + {"flowers", "seaweed_3", "some Seaweed."}, {"flowers", "seaweed_4", "some Seaweed."}, {"trunks", "twig_1", "a Twig." }, {"trunks", "twig_2", "a Twig." }, @@ -89,7 +89,7 @@ minetest.register_node("fishing:bobber_box", { "fishing_bobber.png", "fishing_bobber.png", "fishing_bobber.png^[transformFX" - }, -- + }, -- groups = {not_in_creative_inventory=1}, }) @@ -123,7 +123,7 @@ local FISHING_BOBBER_ENTITY={ }) self.object:remove() end, --- WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE) +-- WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE) on_rightclick = function (self, clicker) local item = clicker:get_wielded_item() local player = clicker:get_player_name() @@ -141,7 +141,7 @@ local FISHING_BOBBER_ENTITY={ minetest.add_node({x=pos.x, y=pos.y, z=pos.z}, {name="air"}) if inv:room_for_item("main", {name=DRoP, count=1, wear=0, metadata=""}) then inv:add_item("main", {name=DRoP, count=1, wear=0, metadata=""}) - if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught Plant + if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught Plant end if not minetest.setting_getbool("creative_mode") then if inv:room_for_item("main", {name="fishing:bait_worm", count=1, wear=0, metadata=""}) then @@ -176,13 +176,13 @@ local FISHING_BOBBER_ENTITY={ iTeM = "fish_blue_white" WeaR = 0 MeSSaGe = S("a Blue white fish.") - obj:remove() + obj:remove() end end -- add (in)visible fish to inventory if inv:room_for_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""}) then inv:add_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""}) - if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught somethin' + if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught somethin' end if not minetest.setting_getbool("creative_mode") then if GeTBaiTBack == true then @@ -211,12 +211,12 @@ local FISHING_BOBBER_ENTITY={ if inv:room_for_item("main", {name="fishing:bait_worm", count=1, wear=0, metadata=""}) then inv:add_item("main", {name="fishing:bait_worm", count=1, wear=0, metadata=""}) if MESSAGES == true then say(player, S("The bait is still there."), false) end -- bait still there - end + end end end end end - end + end -- weither player has fishing pole or not -- make sound and remove bobber minetest.sound_play("fishing_bobber1", { @@ -240,7 +240,7 @@ local FISHING_BOBBER_ENTITY={ end end end - + if math.random(1, 4) == 1 then self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/2880*math.pi)) end @@ -259,9 +259,9 @@ local FISHING_BOBBER_ENTITY={ minetest.sound_play("fishing_bobber1", {pos = self.object:getpos(),gain = 0.5,}) self.object:remove() end - - - + + + if self.object:get_hp() > 310 then local find_fish = minetest.get_objects_inside_radius({x=pos.x,y=pos.y+0.5,z=pos.z}, 1) for k, obj in pairs(find_fish) do @@ -274,8 +274,8 @@ local FISHING_BOBBER_ENTITY={ end end end - - + + local do_env_damage = function(self) self.object:set_hp(self.object:get_hp()-self.water_damage) if self.object:get_hp() == 600 then @@ -306,7 +306,7 @@ local FISHING_BOBBER_ENTITY={ self.object:moveto({x=pos.x,y=pos.y+0.0625,z=pos.z}) elseif self.object:get_hp() == 285 then self.object:moveto({x=pos.x,y=pos.y-0.1,z=pos.z}) - elseif self.object:get_hp() < 284 then + elseif self.object:get_hp() < 284 then self.object:moveto({x=pos.x+(0.001*(math.random(-8, 8))),y=pos.y,z=pos.z+(0.001*(math.random(-8, 8)))}) self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/1440*math.pi)) elseif self.object:get_hp() == 0 then diff --git a/mods/fishing/bobber_shark.lua b/mods/fishing/bobber_shark.lua index 0422ee91..6b34253a 100755 --- a/mods/fishing/bobber_shark.lua +++ b/mods/fishing/bobber_shark.lua @@ -34,17 +34,17 @@ local CaTCH_BiG = { local PLaNTS = { -- MoD* iTeM MeSSaGe ("You caught "..) - {"flowers", "waterlily", "a Waterlily." }, - {"flowers", "waterlily_225", "a Waterlily." }, - {"flowers", "waterlily_45", "a Waterlily." }, - {"flowers", "waterlily_675", "a Waterlily." }, - {"flowers", "waterlily_s1", "a Waterlily." }, - {"flowers", "waterlily_s2", "a Waterlily." }, - {"flowers", "waterlily_s3", "a Waterlily." }, + {"flowers", "waterlily", "a Waterlily." }, + {"flowers", "waterlily_225", "a Waterlily." }, + {"flowers", "waterlily_45", "a Waterlily." }, + {"flowers", "waterlily_675", "a Waterlily." }, + {"flowers", "waterlily_s1", "a Waterlily." }, + {"flowers", "waterlily_s2", "a Waterlily." }, + {"flowers", "waterlily_s3", "a Waterlily." }, {"flowers", "waterlily_s4", "a Waterlily." }, - {"flowers", "seaweed", "some Seaweed."}, - {"flowers", "seaweed_2", "some Seaweed."}, - {"flowers", "seaweed_3", "some Seaweed."}, + {"flowers", "seaweed", "some Seaweed."}, + {"flowers", "seaweed_2", "some Seaweed."}, + {"flowers", "seaweed_3", "some Seaweed."}, {"flowers", "seaweed_4", "some Seaweed."}, {"trunks", "twig_1", "a Twig." }, {"trunks", "twig_2", "a Twig." }, @@ -83,7 +83,7 @@ local FISHING_BOBBER_ENTITY_SHARK={ }) self.object:remove() end, --- WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE) +-- WHEN RIGHTCLICKING THE BOBBER THE FOLLOWING HAPPENS (CLICK AT THE RIGHT TIME WHILE HOLDING A FISHING POLE) on_rightclick = function (self, clicker) local item = clicker:get_wielded_item() local player = clicker:get_player_name() @@ -101,7 +101,7 @@ local FISHING_BOBBER_ENTITY_SHARK={ minetest.add_node({x=pos.x, y=pos.y, z=pos.z}, {name="air"}) if inv:room_for_item("main", {name=DRoP, count=1, wear=0, metadata=""}) then inv:add_item("main", {name=DRoP, count=1, wear=0, metadata=""}) - if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught Plant + if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught Plant end if not minetest.setting_getbool("creative_mode") then if inv:room_for_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""}) then @@ -129,7 +129,7 @@ local FISHING_BOBBER_ENTITY_SHARK={ if minetest.get_modpath(MoD) ~= nil then if inv:room_for_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""}) then inv:add_item("main", {name=MoD..":"..iTeM, count=1, wear=WeaR, metadata=""}) - if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught somethin' + if MESSAGES == true then say(player, S("You caught "..MeSSaGe), false) end -- caught somethin' end if not minetest.setting_getbool("creative_mode") then if GeTBaiTBack == true then @@ -146,20 +146,20 @@ local FISHING_BOBBER_ENTITY_SHARK={ if MESSAGES == true then say(player, S("Your fish escaped."), false) end -- fish escaped end end - if self.object:get_hp() > 300 and minetest.get_node(pos).name == "air" then + if self.object:get_hp() > 300 and minetest.get_node(pos).name == "air" then if MESSAGES == true then say(player, S("You didn't catch any fish."), false) end -- fish escaped if not minetest.setting_getbool("creative_mode") then if math.random(1, 3) == 1 then if inv:room_for_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""}) then inv:add_item("main", {name="fishing:fish_raw", count=1, wear=0, metadata=""}) if MESSAGES == true then say(player, S("The bait is still there."), false) end -- bait still there - end + end end end end --end - else - if MESSAGES == true then say(player, S("Your fish escaped."), false) end -- fish escaped + else + if MESSAGES == true then say(player, S("Your fish escaped."), false) end -- fish escaped end minetest.sound_play("fishing_bobber1", { pos = self.object:getpos(), @@ -230,7 +230,7 @@ local FISHING_BOBBER_ENTITY_SHARK={ self.object:moveto({x=pos.x,y=pos.y+0.0625,z=pos.z}) elseif self.object:get_hp() == 285 then self.object:moveto({x=pos.x,y=pos.y-0.0625,z=pos.z}) - elseif self.object:get_hp() < 284 then + elseif self.object:get_hp() < 284 then self.object:moveto({x=pos.x+(0.001*(math.random(-8, 8))),y=pos.y,z=pos.z+(0.001*(math.random(-8, 8)))}) self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/720*math.pi)) elseif self.object:get_hp() == 0 then diff --git a/mods/fishing/crafting.lua b/mods/fishing/crafting.lua index 70f4bc84..b2e95521 100755 --- a/mods/fishing/crafting.lua +++ b/mods/fishing/crafting.lua @@ -14,7 +14,7 @@ -- Wooden Fishing Pole minetest.register_craft({ output = "fishing:pole", - recipe = { + recipe = { {"", "", "group:stick" }, {"", "group:stick", "farming:string"}, {"group:stick", "", "farming:string"}, @@ -24,7 +24,7 @@ minetest.register_craft({ if minetest.get_modpath("moreblocks") ~= nil then minetest.register_craft({ output = "fishing:pole", - recipe = { + recipe = { {"", "", "group:stick" }, {"", "group:stick", "moreblocks:rope" }, {"group:stick", "", "moreblocks:rope" }, @@ -35,7 +35,7 @@ end if minetest.get_modpath("ropes") ~= nil then minetest.register_craft({ output = "fishing:pole", - recipe = { + recipe = { {"", "", "group:stick" }, {"", "group:stick", "ropes:rope" }, {"group:stick", "", "ropes:rope" }, @@ -47,7 +47,7 @@ end if minetest.get_modpath("moreores") ~= nil then minetest.register_craft({ output = "fishing:pole_perfect", - recipe = { + recipe = { {"", "", "moreores:mithril_ingot" }, {"", "moreores:mithril_ingot", "mobs:spider_cobweb" }, {"moreores:mithril_ingot", "", "mobs:spider_cobweb" }, @@ -86,7 +86,7 @@ minetest.register_craft({ type = "shapeless", output = "fishing:sushi", recipe = {"fishing:fish_raw", "farming:seed_wheat", "seaplants:kelpgreen" }, - + }) ----------------------------------------------------------------------------------------------- diff --git a/mods/fishing/fishes.lua b/mods/fishing/fishes.lua index 5faca951..50f181d8 100755 --- a/mods/fishing/fishes.lua +++ b/mods/fishing/fishes.lua @@ -58,7 +58,7 @@ minetest.register_craftitem("fishing:shark", { inventory_image = "fishing_shark_cooked.png", on_use = minetest.item_eat(6), }) - + ----------------------------------------------------------------------------------------------- -- Pike ----------------------------------------------------------------------------------------------- diff --git a/mods/fishing/init.lua b/mods/fishing/init.lua index 18eecf4b..89dc9376 100755 --- a/mods/fishing/init.lua +++ b/mods/fishing/init.lua @@ -77,10 +77,10 @@ minetest.register_tool("fishing:pole", { gain = 0.5, }) minetest.add_entity({interval = 1,x=pt.under.x, y=pt.under.y+(45/64), z=pt.under.z}, "fishing:bobber_entity") - - if WEAR_OUT == true + + if WEAR_OUT == true and not minetest.setting_getbool("creative_mode") then - return rod_wear(itemstack, user, pointed_thing, 30) + return rod_wear(itemstack, user, pointed_thing, 30) else return {name="fishing:pole", count=1, wear=0, metadata=""} end @@ -94,10 +94,10 @@ minetest.register_tool("fishing:pole", { gain = 0.5, }) minetest.add_entity({interval = 1,x=pt.under.x, y=pt.under.y+(45/64), z=pt.under.z}, "fishing:bobber_entity_shark") - - if WEAR_OUT == true + + if WEAR_OUT == true and not minetest.setting_getbool("creative_mode") then - return rod_wear(itemstack, user, pointed_thing, 30) + return rod_wear(itemstack, user, pointed_thing, 30) else return {name="fishing:pole", count=1, wear=0, metadata=""} end @@ -150,10 +150,10 @@ minetest.register_tool("fishing:pole_perfect", { gain = 0.5, }) minetest.add_entity({interval = 1,x=pt.under.x, y=pt.under.y+(45/64), z=pt.under.z}, "fishing:bobber_entity") - - if WEAR_OUT == true + + if WEAR_OUT == true and not minetest.setting_getbool("creative_mode") then - return rod_wear(itemstack, user, pointed_thing, 1500) + return rod_wear(itemstack, user, pointed_thing, 1500) else return {name="fishing:pole_perfect", count=1, wear=0, metadata=""} end @@ -167,10 +167,10 @@ minetest.register_tool("fishing:pole_perfect", { gain = 0.5, }) minetest.add_entity({interval = 1,x=pt.under.x, y=pt.under.y+(45/64), z=pt.under.z}, "fishing:bobber_entity_shark") - - if WEAR_OUT == true + + if WEAR_OUT == true and not minetest.setting_getbool("creative_mode") then - return rod_wear(itemstack, user, pointed_thing, 1500) + return rod_wear(itemstack, user, pointed_thing, 1500) else return {name="fishing:pole_perfect", count=1, wear=0, metadata=""} end @@ -240,7 +240,7 @@ if SIMPLE_DECO_FISHING_POLE == true then minetest.remove_node(pos) end, }) - + --Canne à pêche parfaite deco minetest.register_node("fishing:pole_perfect_deco", { description = S("Perfect Fishing Pole"), @@ -348,7 +348,7 @@ else minetest.remove_node(pos) end, }) - + --Canne à pêche parfaite deco minetest.register_node("fishing:pole_perfect_deco", { description = S("Perfect Fishing Pole"), @@ -455,11 +455,11 @@ else if pt.type ~= "node" then return end - + local under = minetest.get_node(pt.under) local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} local above = minetest.get_node(p) - + -- return if any of the nodes is not registered if not minetest.registered_nodes[under.name] then return @@ -467,24 +467,24 @@ else if not minetest.registered_nodes[above.name] then return end - + -- check if the node above the pointed thing is air if above.name ~= "air" then return end - + -- check if pointing at dirt if minetest.get_item_group(under.name, "soil") ~= 1 then return end - + -- turn the node into soil, play sound, get worm and wear out item minetest.set_node(pt.under, {name="farming:soil"}) minetest.sound_play("default_dig_crumbly", { pos = pt.under, gain = 0.5, }) - + if math.random(1, 100) < WORM_CHANCE then if WORM_IS_MOB == true then minetest.add_entity({x=pt.under.x, y=pt.under.y+0.4, z=pt.under.z}, "fishing:bait_worm_entity") diff --git a/mods/fishing/trophies.lua b/mods/fishing/trophies.lua index d2446450..e55d7910 100755 --- a/mods/fishing/trophies.lua +++ b/mods/fishing/trophies.lua @@ -80,11 +80,11 @@ for i in pairs(TRoPHY) do return has_trophy_privilege(meta, player) end, }) - + minetest.register_craft({ type = "shapeless", output = "fishing:trophy_"..iTeM, recipe = {MoD..":"..iTeM, "default:sign_wall"}, }) - + end diff --git a/mods/fishing/worm.lua b/mods/fishing/worm.lua index 454fef9a..626c6d56 100755 --- a/mods/fishing/worm.lua +++ b/mods/fishing/worm.lua @@ -69,16 +69,16 @@ minetest.register_entity("fishing:bait_worm_entity", { if n.name == "air" then -- fall when in air self.object:moveto({x=pos.x,y=pos.y-0.5,z=pos.z}) self.object:set_hp(self.object:get_hp()-75) - + --if n.name == "snappy" then -- fall when leaves or similar elseif minetest.get_item_group(n.name, "snappy") ~= 0 then self.object:moveto({x=pos.x+(0.001*(math.random(-32, 32))),y=pos.y-(0.001*(math.random(0, 64))),z=pos.z+(0.001*(math.random(-32, 32)))}) - - + + elseif string.find(n.name, "default:water") then -- sink when in water self.object:moveto({x=pos.x,y=pos.y-0.25,z=pos.z}) self.object:set_hp(self.object:get_hp()-37) - + elseif minetest.get_item_group(n.name, "soil") ~= 0 then if minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-0.1,z=pos.z}).name, "soil") == 0 and self.object:get_hp() > 200 then self.object:set_hp(199) @@ -95,24 +95,24 @@ minetest.register_entity("fishing:bait_worm_entity", { local goal_02 = check_group(minetest.get_node({x = pos.x, y = pos.y-0.4, z = pos.z + 1}).name, "soil") local goal_03 = check_group(minetest.get_node({x = pos.x - 1, y = pos.y-0.4, z = pos.z }).name, "soil") local goal_04 = check_group(minetest.get_node({x = pos.x, y = pos.y-0.4, z = pos.z - 1}).name, "soil") - + local goal_1a = check_group(minetest.get_node({x = pos.x + 1, y = pos.y+0.6, z = pos.z }).name, "soil") local goal_2a = check_group(minetest.get_node({x = pos.x, y = pos.y+0.6, z = pos.z + 1}).name, "soil") local goal_3a = check_group(minetest.get_node({x = pos.x - 1, y = pos.y+0.6, z = pos.z }).name, "soil") local goal_4a = check_group(minetest.get_node({x = pos.x, y = pos.y+0.6, z = pos.z - 1}).name, "soil") -- if there's dirt nearby, go there if goal_01 ~= 0 or goal_1a ~= 0 then - self.object:moveto({x=pos.x+0.002,y=pos.y,z=pos.z+(0.001*(math.random(-2, 2)))}) + self.object:moveto({x=pos.x+0.002,y=pos.y,z=pos.z+(0.001*(math.random(-2, 2)))}) elseif goal_02 ~= 0 or goal_2a ~= 0 then - self.object:moveto({x=pos.x+(0.001*(math.random(-2, 2))),y=pos.y,z=pos.z+0.002}) + self.object:moveto({x=pos.x+(0.001*(math.random(-2, 2))),y=pos.y,z=pos.z+0.002}) elseif goal_03 ~= 0 or goal_3a ~= 0 then - self.object:moveto({x=pos.x-0.002,y=pos.y,z=pos.z+(0.001*(math.random(-2, 2)))}) + self.object:moveto({x=pos.x-0.002,y=pos.y,z=pos.z+(0.001*(math.random(-2, 2)))}) elseif goal_04 ~= 0 or goal_4a ~= 0 then - self.object:moveto({x=pos.x+(0.001*(math.random(-2, 2))),y=pos.y,z=pos.z-0.002}) + self.object:moveto({x=pos.x+(0.001*(math.random(-2, 2))),y=pos.y,z=pos.z-0.002}) else -- I'm lost, no dirt - self.object:moveto({x=pos.x+(0.001*(math.random(-8, 8))),y=pos.y,z=pos.z+(0.001*(math.random(-8, 8)))}) + self.object:moveto({x=pos.x+(0.001*(math.random(-8, 8))),y=pos.y,z=pos.z+(0.001*(math.random(-8, 8)))}) end - end + end end look_whats_up(self) end, diff --git a/mods/forceload/init.lua b/mods/forceload/init.lua index 24a169a3..e552e78d 100755 --- a/mods/forceload/init.lua +++ b/mods/forceload/init.lua @@ -24,7 +24,7 @@ function ForceloadManager(filetoopen, hide_file_errors) end end for i = 1, #blocks do - if not minetest.forceload_block(blocks[i]) then + if not minetest.forceload_block(blocks[i]) then minetest.log("error", "Failed to load block " .. minetest.pos_to_string(blocks[i])) end end @@ -40,7 +40,7 @@ function ForceloadManager(filetoopen, hide_file_errors) end, unload = function(self, pos) for i = 1, #self._blocks do - if vector.equals(pos, self._blocks[i]) then + if vector.equals(pos, self._blocks[i]) then minetest.forceload_free_block(pos) table.remove(self._blocks, i) return true @@ -56,16 +56,16 @@ function ForceloadManager(filetoopen, hide_file_errors) end end, verify = function(self) - return self:verify_each(function(pos, block) + return self:verify_each(function(pos, block) local name = "ignore" if block ~= nil then name = block.name end - if name == "ignore" then + if name == "ignore" then if not pos.last or elapsed_time > pos.last + 15 then pos.last = elapsed_time - if not minetest.forceload_block(pos) then + if not minetest.forceload_block(pos) then minetest.log("error", "Failed to force load " .. minetest.pos_to_string(pos)) pos.remove = true end @@ -74,15 +74,15 @@ function ForceloadManager(filetoopen, hide_file_errors) elseif name == "forceload:anchor" then pos.last = elapsed_time return true - else + else minetest.log("error", minetest.pos_to_string(pos) .. " shouldn't be loaded") pos.remove = true - return false + return false end end) end, verify_each = function(self, func) - local not_loaded = {} + local not_loaded = {} for i = 1, #self._blocks do local res = minetest.get_node(self._blocks[i]) if not func(self._blocks[i], res) then @@ -125,10 +125,10 @@ minetest.register_node("forceload:anchor",{ if not minetest.check_player_privs(placer:get_player_name(), {forceload = true}) then minetest.chat_send_player(placer:get_player_name(), "The forceload privilege is required to do that.") - elseif flm:load(pos) then + elseif flm:load(pos) then flm:save(minetest.get_worldpath().."/flm.json") return - end + end minetest.set_node(pos, {name="air"}) return true end diff --git a/mods/framedglass/init.lua b/mods/framedglass/init.lua index 9d7cfbc8..ba9aa68f 100755 --- a/mods/framedglass/init.lua +++ b/mods/framedglass/init.lua @@ -87,7 +87,7 @@ function add_coloured_framedglass(name, desc, dye) use_texture_alpha = true, groups = {cracky=3}, sounds = default.node_sound_glass_defaults(), - }) + }) minetest.register_craft({ type = "shapeless", diff --git a/mods/gauges/init.lua b/mods/gauges/init.lua index c2c66d0a..968923ec 100755 --- a/mods/gauges/init.lua +++ b/mods/gauges/init.lua @@ -12,7 +12,7 @@ local hp_bar = { function hp_bar:on_step(dtime) local wielder = self.wielder - if wielder == nil then + if wielder == nil then self.object:remove() return elseif minetest.get_player_by_name(wielder:get_player_name()) == nil then diff --git a/mods/hud/armor.lua b/mods/hud/armor.lua index 7f0d0cff..82ff3587 100755 --- a/mods/hud/armor.lua +++ b/mods/hud/armor.lua @@ -18,7 +18,7 @@ end function hud.set_armor(player_name, ges_state, items) local max_items = 4 - if items == 5 then + if items == 5 then max_items = items end local max = max_items * 65535 diff --git a/mods/hud/hunger.lua b/mods/hud/hunger.lua index 823842ff..0580dd95 100755 --- a/mods/hud/hunger.lua +++ b/mods/hud/hunger.lua @@ -17,7 +17,7 @@ local function poisenp(tick, time, time_left, player) if player:get_hp()-1 > 0 then player:set_hp(player:get_hp()-1) end - + end function hud.item_eat(hunger_change, replace_with_item, poisen, heal) @@ -301,7 +301,7 @@ if minetest.get_modpath("mobs") ~= nil then overwrite("mobs:chicken_cooked", 4) overwrite("mobs:egg", 1) overwrite("mobs:chicken_egg_fried", 2) - if minetest.get_modpath("bucket") then + if minetest.get_modpath("bucket") then overwrite("mobs:bucket_milk", 3, "bucket:bucket_empty") end end diff --git a/mods/hud/init.lua b/mods/hud/init.lua index 8204aa89..168d0fa0 100755 --- a/mods/hud/init.lua +++ b/mods/hud/init.lua @@ -49,7 +49,7 @@ HUD_TICK = 0.1 --Some hunger settings hud.exhaustion = {} -- Exhaustion is experimental! -HUD_HUNGER_TICK = 800 -- time in seconds after that 1 hunger point is taken +HUD_HUNGER_TICK = 800 -- time in seconds after that 1 hunger point is taken HUD_HUNGER_EXHAUST_DIG = 3 -- exhaustion increased this value after digged node HUD_HUNGER_EXHAUST_PLACE = 1 -- exhaustion increased this value after placed HUD_HUNGER_EXHAUST_MOVE = 0.3 -- exhaustion increased this value if player movement detected @@ -69,7 +69,7 @@ end --load custom settings local set = io.open(minetest.get_modpath("hud").."/hud.conf", "r") -if set then +if set then dofile(minetest.get_modpath("hud").."/hud.conf") set:close() else @@ -243,7 +243,7 @@ hud.set_hunger = function(player) if not inv or not value then return nil end if value > 30 then value = 30 end if value < 0 then value = 0 end - + inv:set_stack("hunger", 1, ItemStack({name=":", count=value+1})) return true @@ -321,7 +321,7 @@ minetest.after(2.5, function() -- update all hud elements update_hud(player) - + if HUD_ENABLE_HUNGER then local controls = player:get_player_control() -- Determine if the player is walking @@ -331,7 +331,7 @@ minetest.after(2.5, function() end end end - + end if timer > 4 then timer = 0 end if timer2 > HUD_HUNGER_TICK then timer2 = 0 end diff --git a/mods/inventorycheck/init.lua b/mods/inventorycheck/init.lua index 79965e3e..33de1e19 100755 --- a/mods/inventorycheck/init.lua +++ b/mods/inventorycheck/init.lua @@ -30,6 +30,6 @@ minetest.register_chatcommand("inv", { invlist = invlist..items.." | " end end - minetest.chat_send_player(name, invlist) + minetest.chat_send_player(name, invlist) end, }) diff --git a/mods/invtweak/init.lua b/mods/invtweak/init.lua index 9672f921..eee96d63 100755 --- a/mods/invtweak/init.lua +++ b/mods/invtweak/init.lua @@ -156,7 +156,7 @@ tweak.sort = function(player, mode, con) if inv then local list = inv:get_list("main") local tmp_list = {} - + --write whole list as table for _,stack in ipairs(list) do local tbl_stack = stack:to_table() diff --git a/mods/irc/botcmds.lua b/mods/irc/botcmds.lua index 34978a87..44077407 100755 --- a/mods/irc/botcmds.lua +++ b/mods/irc/botcmds.lua @@ -46,13 +46,13 @@ function irc:bot_command(msg, text) cmd = text args = "" end - + if not self.bot_commands[cmd] then self:reply("Unknown command '"..cmd.."'. Try 'list'." .." Or use @playername to send a private message") return end - + local success, message = self.bot_commands[cmd].func(msg.user, args) if message then self:reply(message) diff --git a/mods/irc/player_part.lua b/mods/irc/player_part.lua index d39d2abd..c9916c40 100755 --- a/mods/irc/player_part.lua +++ b/mods/irc/player_part.lua @@ -10,7 +10,7 @@ function irc:player_part(name) self.joined_players[name] = nil minetest.chat_send_player(name, "IRC: You are now out of the channel.") end - + function irc:player_join(name) if self.joined_players[name] then minetest.chat_send_player(name, "IRC: You are already in the channel.") @@ -28,7 +28,7 @@ minetest.register_chatcommand("join", { irc:player_join(name) end }) - + minetest.register_chatcommand("part", { description = "Part the IRC channel", privs = {shout=true}, @@ -36,7 +36,7 @@ minetest.register_chatcommand("part", { irc:player_part(name) end }) - + minetest.register_chatcommand("who", { description = "Tell who is currently on the channel", privs = {}, @@ -49,13 +49,13 @@ minetest.register_chatcommand("who", { end }) - + minetest.register_on_joinplayer(function(player) local name = player:get_player_name() irc.joined_players[name] = irc.config.auto_join end) - - + + minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() irc.joined_players[name] = nil diff --git a/mods/item_drop/init.lua b/mods/item_drop/init.lua index 069633d2..63deb33a 100755 --- a/mods/item_drop/init.lua +++ b/mods/item_drop/init.lua @@ -7,7 +7,7 @@ minetest.register_globalstep(function(dtime) if player:get_hp() > 0 or not enable_damage then local pos = player:getpos() local inv = player:get_inventory() - + for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then @@ -20,7 +20,7 @@ minetest.register_globalstep(function(dtime) end end end - + for _,object in ipairs(minetest.get_objects_inside_radius(pos, 1)) do if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then if object:get_luaentity().always_collect then @@ -37,7 +37,7 @@ minetest.register_globalstep(function(dtime) object:get_luaentity().object:set_properties({ physical = false }) - + minetest.after(1, function(args) local lua = object:get_luaentity() if object == nil or lua == nil or lua.itemstring == nil then @@ -58,7 +58,7 @@ minetest.register_globalstep(function(dtime) }) end end, {player, object}) - + end end end @@ -86,7 +86,7 @@ function minetest.handle_node_drops(pos, drops, digger) local obj local x = math.random(1, 5) if math.random(1,2) == 1 then x = -x end - + local z = math.random(1, 5) if math.random(1,2) == 1 then z = -z end diff --git a/mods/lantern/init.lua b/mods/lantern/init.lua index 8914e5fc..b3dd8968 100755 --- a/mods/lantern/init.lua +++ b/mods/lantern/init.lua @@ -17,8 +17,8 @@ minetest.register_node("lantern:lantern", { sounds = default.node_sound_glass_defaults(), node_box = { type = "wallmounted", - wall_top = {-1/6, 1/6, -1/6, 1/6, 0.5, 1/6}, - wall_bottom = {-1/6, -0.5, -1/6, 1/6, -1/6, 1/6}, + wall_top = {-1/6, 1/6, -1/6, 1/6, 0.5, 1/6}, + wall_bottom = {-1/6, -0.5, -1/6, 1/6, -1/6, 1/6}, wall_side = {-1/6, -1/6, -1/6, -0.5, 1/6, 1/6}, }, }) @@ -44,7 +44,7 @@ minetest.register_node("lantern:candle", { inventory_image = "candle_inv.png", tiles = { {name="candle.png", animation={type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 0.8}}, - }, + }, paramtype = "light", sunlight_propagates = true, walkable = false, @@ -184,16 +184,16 @@ minetest.register_node("lantern:lamp1", { sounds = default.node_sound_glass_defaults(), selection_box = { type = "fixed", - fixed = {-0.5, -2.5, -0.5, 1.5, 1.5, 0.5}, + fixed = {-0.5, -2.5, -0.5, 1.5, 1.5, 0.5}, }, after_dig_node = function(pos) - minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) - minetest.remove_node({x = pos.x + 1, y = pos.y + 1, z = pos.z }) + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) + minetest.remove_node({x = pos.x + 1, y = pos.y + 1, z = pos.z }) minetest.remove_node({x = pos.x + 1, y = pos.y , z = pos.z }) - minetest.remove_node({x = pos.x + 1, y = pos.y - 1, z = pos.z }) - minetest.remove_node({x = pos.x + 1, y = pos.y - 2, z = pos.z }) + minetest.remove_node({x = pos.x + 1, y = pos.y - 1, z = pos.z }) + minetest.remove_node({x = pos.x + 1, y = pos.y - 2, z = pos.z }) end -}) +}) minetest.register_node("lantern:lamp2", { description = "Lamp2", @@ -207,16 +207,16 @@ minetest.register_node("lantern:lamp2", { sounds = default.node_sound_glass_defaults(), selection_box = { type = "fixed", - fixed = {-0.5, -2.5, -0.5, 0.5, 1.5, 1.5}, + fixed = {-0.5, -2.5, -0.5, 0.5, 1.5, 1.5}, }, after_dig_node = function(pos) - minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) - minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z + 1}) + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z + 1}) minetest.remove_node({x = pos.x, y = pos.y , z = pos.z + 1}) - minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z + 1}) - minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z + 1}) + minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z + 1}) + minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z + 1}) end -}) +}) minetest.register_node("lantern:lamp3", { description = "Lamp3", @@ -230,16 +230,16 @@ minetest.register_node("lantern:lamp3", { sounds = default.node_sound_glass_defaults(), selection_box = { type = "fixed", - fixed = {-1.5, -2.5, -0.5, 0.5, 1.5, 0.5}, + fixed = {-1.5, -2.5, -0.5, 0.5, 1.5, 0.5}, }, after_dig_node = function(pos) - minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) - minetest.remove_node({x = pos.x - 1, y = pos.y + 1, z = pos.z}) + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) + minetest.remove_node({x = pos.x - 1, y = pos.y + 1, z = pos.z}) minetest.remove_node({x = pos.x - 1, y = pos.y , z = pos.z}) - minetest.remove_node({x = pos.x - 1, y = pos.y - 1, z = pos.z}) - minetest.remove_node({x = pos.x - 1, y = pos.y - 2, z = pos.z}) + minetest.remove_node({x = pos.x - 1, y = pos.y - 1, z = pos.z}) + minetest.remove_node({x = pos.x - 1, y = pos.y - 2, z = pos.z}) end -}) +}) minetest.register_node("lantern:lamp4", { description = "Lamp4", @@ -253,16 +253,16 @@ minetest.register_node("lantern:lamp4", { sounds = default.node_sound_glass_defaults(), selection_box = { type = "fixed", - fixed = {-0.5, -2.5, -1.5, 0.5, 1.5, 0.5}, + fixed = {-0.5, -2.5, -1.5, 0.5, 1.5, 0.5}, }, after_dig_node = function(pos) - minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) - minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z - 1}) + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z - 1}) minetest.remove_node({x = pos.x, y = pos.y , z = pos.z - 1}) - minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z - 1}) - minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z - 1}) + minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z - 1}) + minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z - 1}) end -}) +}) -- -- register crafting recipes: diff --git a/mods/lavatemple/dagger.lua b/mods/lavatemple/dagger.lua index e1e24f13..a06fbc1a 100755 --- a/mods/lavatemple/dagger.lua +++ b/mods/lavatemple/dagger.lua @@ -17,7 +17,7 @@ minetest.register_globalstep(function(dtime) if string.sub(wielded_item, 0, 18) == "lavatemple:dagger_" then player:set_wielded_item("lavatemple:dagger_"..compass_image) else - if player:get_inventory() then + if player:get_inventory() then for i,stack in ipairs(player:get_inventory():get_list("main")) do if string.sub(stack:get_name(), 0, 18) == "lavatemple:dagger_" and stack:get_name() ~= "lavatemple:dagger_"..compass_image then diff --git a/mods/lavatemple/mapgen.lua b/mods/lavatemple/mapgen.lua index 94426f5d..fdc6139d 100755 --- a/mods/lavatemple/mapgen.lua +++ b/mods/lavatemple/mapgen.lua @@ -2,11 +2,11 @@ lavatemple.mapgen_data = {} lavatemple.file = minetest.get_worldpath()..'/lavatemple.mt' -- try to load the data from file -local f = io.open(lavatemple.file, "r") +local f = io.open(lavatemple.file, "r") if f then local contents = f:read() io.close(f) - if contents ~= nil then + if contents ~= nil then lavatemple.mapgen_data = minetest.deserialize(contents) end end @@ -25,7 +25,7 @@ if type (lavatemple.mapgen_data) ~= "table" or y=math.random(-500,-50), z=math.random(-2000,2000) } - + -- save data local f = io.open(lavatemple.file, "w") f:write(minetest.serialize(lavatemple.mapgen_data)) diff --git a/mods/lavatemple/nodes.lua b/mods/lavatemple/nodes.lua index c516349d..4131c171 100755 --- a/mods/lavatemple/nodes.lua +++ b/mods/lavatemple/nodes.lua @@ -26,7 +26,7 @@ minetest.register_node("lavatemple:ladder", { sunlight_propagates = true, paramtype2 = "wallmounted", climbable = true, - walkable = true, + walkable = true, node_box = { type = "wallmounted", wall_top = {-0.375, 0.4375, -0.5, 0.375, 0.5, 0.5}, diff --git a/mods/mana/init.lua b/mods/mana/init.lua index 14632cd1..a07fbc00 100755 --- a/mods/mana/init.lua +++ b/mods/mana/init.lua @@ -39,7 +39,7 @@ end API functions ]===] -function mana.set(playername, value) +function mana.set(playername, value) if value < 0 then minetest.log("info", "[mana] Warning: mana.set was called with negative value!") value = 0 @@ -108,7 +108,7 @@ function mana.add(playername, value) local t = mana.playerlist[playername] value = mana.round(value) 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) return true else @@ -120,7 +120,7 @@ function mana.subtract(playername, value) local t = mana.playerlist[playername] value = mana.round(value) 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) return true else @@ -212,7 +212,7 @@ end) minetest.register_on_joinplayer(function(player) local playername = player:get_player_name() - + if mana.playerlist[playername] == nil then mana.playerlist[playername] = {} mana.playerlist[playername].mana = 0 @@ -285,7 +285,7 @@ else function mana.manastring(playername) return string.format("Mana: %d/%d", mana.get(playername), mana.getmax(playername)) end - + function mana.hud_add(playername) local player = minetest.get_player_by_name(playername) id = player:hud_add({ @@ -312,12 +312,12 @@ else mana.playerlist[playername].hudid = id return id end - + function mana.hud_update(playername) local player = minetest.get_player_by_name(playername) player:hud_change(mana.playerlist[playername].hudid, "text", mana.manastring(playername)) end - + function mana.hud_remove(playername) local player = minetest.get_player_by_name(playername) player:hud_remove(mana.playerlist[playername].hudid) diff --git a/mods/maptools/default_nodes.lua b/mods/maptools/default_nodes.lua index ca28c529..34e63ec4 100755 --- a/mods/maptools/default_nodes.lua +++ b/mods/maptools/default_nodes.lua @@ -438,15 +438,15 @@ local function find_dock(pos, second) local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} if second > 0 then local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} - minetest.set_node(pos, tmp_node) + minetest.set_node(pos, tmp_node) end elseif code == 0 then if second == 2 then local tmp_node = {name="fences:fence_wood", param1=me.param1, param2=me.param2} - minetest.set_node(pos, tmp_node) + minetest.set_node(pos, tmp_node) end end - + end diff --git a/mods/markers/areas.lua b/mods/markers/areas.lua index 8daa0fa6..8a19fed7 100755 --- a/mods/markers/areas.lua +++ b/mods/markers/areas.lua @@ -100,10 +100,10 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se table.insert( id_list, id ); end end - + elseif( mode=='all' ) then - title = 'All areas:'; + title = 'All areas:'; tlabel = '*all areas*'; 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[0.5,8.5;Doubleclick to select area.]".. "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 = ''; 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..','; end liste = liste..minetest.formspec_escape( areas:toString( v ) ); - + end -- highlight selected entry @@ -145,14 +145,14 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se else formspec = formspec..liste..';]'; end - + local pname = player:get_player_name(); if( not( markers.menu_data_by_player[ pname ] )) then markers.menu_data_by_player[ pname ] = {}; end -- display information about the location of the area the player clicked on - if( selected + if( selected and id_list[ selected ] 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 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 )..']'; 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;'.. minetest.formspec_escape( 'List subareas ('..tostring( #subareas )..')')..']'; end - + if( mode=='player' ) then formspec = formspec.. @@ -208,8 +208,8 @@ markers.get_area_list_formspec = function(ppos, player, mode, pos, mode_data, se selected = id_list[ selected ], }; - - + + return formspec; end @@ -264,7 +264,7 @@ markers.get_area_desc_formspec = function( id, player, pos ) and this_area.parent and areas.areas[ this_area.parent ] and areas.areas[ this_area.parent ].owner == pname ) then - + formspec = formspec.. '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]'; @@ -311,12 +311,12 @@ markers.get_area_desc_formspec = function( id, player, pos ) else formspec = formspec.. 'label[4.7,2.5;-none-]'; - + if( is_owner ) then formspec = formspec.. 'button_exit[8.0,2.5;2,0.5;add_owner;Add]'; end - end + end -- 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..']' )..']'.. 'button_exit[8.0,3.0;2,0.5;show_parent;Show main area]'; end - + -- does the area have subareas, i.e. is it a parent area for others? local sub_areas = {}; @@ -377,14 +377,14 @@ markers.get_area_desc_formspec = function( id, player, pos ) -- player selected markers.menu_data_by_player[ pname ] = { typ = 'show_area', - mode = nil, + mode = nil, pos = pos, mode_data = nil, list = nil, selected = id, }; - + return formspec; 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? -- if possible, show how far the area streches into each direction relative to pos - if( pos.x >= pos1.x and pos.x <= pos2.x - and pos.y >= pos1.y and pos.y <= pos2.y + if( pos.x >= pos1.x and pos.x <= pos2.x + and pos.y >= pos1.y and pos.y <= pos2.y and pos.z >= pos1.z and pos.z <= pos2.z ) then - + if( with_text ) then formspec = formspec.. '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_south..']'; end - + return formspec; end @@ -469,32 +469,32 @@ markers.form_input_handler_areas = function( player, formname, fields) if( formname ~= "markers:info" or not( player ) or not( markers.menu_data_by_player[ pname ] )) then - + return false; end - + local menu_data = markers.menu_data_by_player[ pname ]; local formspec = ''; -- rename an area - if( fields.rename + if( fields.rename and menu_data.selected and areas.areas[ menu_data.selected ] and areas.areas[ menu_data.selected ].owner == pname ) then - + local area = areas.areas[ menu_data.selected ]; if( not( area.name )) then area.name = '-enter area name-'; end 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 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 - + local area = areas.areas[ menu_data.selected ]; -- 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.'); -- shwo the renamed area formspec = markers.get_area_desc_formspec( menu_data.selected, player, menu_data.pos ); - - + + -- change owner the area elseif( fields.change_owner and menu_data.selected and areas.areas[ menu_data.selected ] ) then - + -- there are no checks here - those happen when the area is transferred 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-]'; @@ -523,9 +523,9 @@ markers.form_input_handler_areas = function( player, formname, fields) local area = areas.areas[ menu_data.selected ]; -- 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 - + minetest.chat_send_player( pname, 'Permission denied. You do not own the area.'); 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 areas.areas[ menu_data.selected ] and areas.areas[ menu_data.selected ].owner == pname ) then - + 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-]'; - elseif( fields.add_owner_name + elseif( fields.add_owner_name -- the player has to own the area already; we need a diffrent name here and fields.add_owner_name ~= pname and menu_data.selected @@ -594,20 +594,20 @@ markers.form_input_handler_areas = function( player, formname, fields) -- delete area - elseif( fields.delete + elseif( fields.delete and menu_data.selected and areas.areas[ menu_data.selected ] ) then local area = areas.areas[ menu_data.selected ]; -- a player can only delete own areas or subareas of own areas - if( area.owner ~= pname - and not( area.parent - and areas.areas[ area.parent ] + if( area.owner ~= pname + and not( area.parent + and areas.areas[ area.parent ] and areas.areas[ area.parent ].owner and areas.areas[ area.parent ].owner == pname ) 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.'); -- shwo the area where the renaming failed 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 - elseif( fields.delete_confirm + elseif( fields.delete_confirm and menu_data.selected and areas.areas[ menu_data.selected ] ) then - + local area = areas.areas[ menu_data.selected ]; local old_owner = area.owner; @@ -635,13 +635,13 @@ markers.form_input_handler_areas = function( player, formname, fields) end -- a player can only delete own areas or subareas of own areas - if( area.owner ~= pname - and not( area.parent - and areas.areas[ area.parent ] + if( area.owner ~= pname + and not( area.parent + and areas.areas[ area.parent ] and areas.areas[ area.parent ].owner and areas.areas[ area.parent ].owner == pname ) 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.'); -- shwo the renamed area 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 ); -- 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!'); 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 ); end - - elseif( fields.show_parent + + elseif( fields.show_parent and menu_data.selected and areas.areas[ menu_data.selected ] 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 formspec = markers.get_area_list_formspec(ppos, player, 'main_areas', menu_data.pos, nil, nil ); - + elseif( fields.list_areas_at and menu_data.pos ) then @@ -740,7 +740,7 @@ markers.show_marker_stone_formspec = function( player, pos ) local pname = player:get_player_name(); 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 markers.menu_data_by_player[ pname ] = { 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.]'.. '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]'; - + -- found exactly one areaa - display it elseif( #found_areas == 1 ) then diff --git a/mods/markers/land_title_register.lua b/mods/markers/land_title_register.lua index 4156acbc..237b6000 100755 --- a/mods/markers/land_title_register.lua +++ b/mods/markers/land_title_register.lua @@ -3,7 +3,7 @@ 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.", - groups = {}, + groups = {}, inventory_image = "default_book.png", -- TODO wield_image = "", 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 local pos = minetest.get_pointed_thing_position( pointed_thing, false ); -- not above - + if( not( pos ) or not( pos.x )) then minetest.chat_send_player( name, "Position not found."); return itemstack; @@ -41,7 +41,7 @@ minetest.register_tool( "markers:land_title_register", return itemstack; -- nothing consumed, nothing changed end, - + 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 pos = minetest.get_pointed_thing_position( pointed_thing, false ); -- not above - + if( not( pos ) or not( pos.x )) then minetest.chat_send_player( name, "Position not found."); return itemstack; diff --git a/mods/mobs/bee.lua b/mods/mobs/bee.lua index 0a5a0653..48f6fadb 100755 --- a/mods/mobs/bee.lua +++ b/mods/mobs/bee.lua @@ -21,7 +21,7 @@ mobs:register_mob("mobs:bee", { makes_footstep_sound = false, sounds = { random = "mobs_bee", - }, + }, -- speed and jump walk_velocity = 1, jump = true, @@ -86,7 +86,7 @@ minetest.register_node("mobs:beehive", { minetest.add_entity(pos, "mobs:bee") end end, - + }) minetest.register_craft({ diff --git a/mods/mobs/bunny.lua b/mods/mobs/bunny.lua index c489f10c..daa8ad46 100755 --- a/mods/mobs/bunny.lua +++ b/mods/mobs/bunny.lua @@ -7,7 +7,7 @@ mobs:register_mob("mobs:bunny", { -- is it aggressive passive = true, -- health & armor - hp_min = 3, hp_max = 6, armor = 200, + hp_min = 3, hp_max = 6, armor = 200, -- textures and model collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268}, visual = "mesh", diff --git a/mods/mobs/creeper.lua b/mods/mobs/creeper.lua index 7d5ab346..f251d570 100755 --- a/mods/mobs/creeper.lua +++ b/mods/mobs/creeper.lua @@ -46,7 +46,7 @@ mobs:register_mob("mobs:creeper", { -- model animation animation = { stand_start = 0, stand_end = 24, - walk_start = 25, walk_end = 47, + walk_start = 25, walk_end = 47, run_start = 48, run_end = 62, punch_start = 48, punch_end = 62, speed_normal = 15, speed_run = 15, diff --git a/mods/mobs/greenslimes.lua b/mods/mobs/greenslimes.lua index 1351b060..de180bff 100755 --- a/mods/mobs/greenslimes.lua +++ b/mods/mobs/greenslimes.lua @@ -30,7 +30,7 @@ mobs:register_mob("mobs:greensmall", { textures = { green_textures }, blood_texture = "mobs_green_slime_blood.png", 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, sounds = green_sounds, -- speed and jump, sinks in water @@ -76,7 +76,7 @@ mobs:register_mob("mobs:greenmedium", { textures = { green_textures }, blood_texture = "mobs_green_slime_blood.png", 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, sounds = green_sounds, -- speed and jump, sinks in water @@ -125,7 +125,7 @@ mobs:register_mob("mobs:greenbig", { textures = { green_textures }, blood_texture = "mobs_green_slime_blood.png", 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, sounds = green_sounds, -- speed and jump, sinks in water diff --git a/mods/mobs/lavaslimes.lua b/mods/mobs/lavaslimes.lua index 7dfd75cc..94dfd0f5 100755 --- a/mods/mobs/lavaslimes.lua +++ b/mods/mobs/lavaslimes.lua @@ -30,7 +30,7 @@ mobs:register_mob("mobs:lavasmall", { textures = { lava_textures }, blood_texture = "mobs_lava_slime_blood.png", 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, sounds = lava_sounds, -- speed and jump, sinks in water @@ -78,7 +78,7 @@ mobs:register_mob("mobs:lavamedium", { textures = { lava_textures }, blood_texture = "mobs_lava_slime_blood.png", 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, sounds = lava_sounds, -- speed and jump, sinks in water @@ -129,7 +129,7 @@ mobs:register_mob("mobs:lavabig", { textures = { lava_textures }, blood_texture = "mobs_lava_slime_blood.png", 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, sounds = lava_sounds, -- speed and jump, sinks in water diff --git a/mods/mobs/rat.lua b/mods/mobs/rat.lua index 03502890..fcbfa0e8 100755 --- a/mods/mobs/rat.lua +++ b/mods/mobs/rat.lua @@ -48,7 +48,7 @@ mobs:register_mob("mobs:rat", { mobs:register_spawn("mobs:rat", {"default:stone"}, 20, 0, 10000, 1, 31000) -- register spawn egg mobs:register_egg("mobs:rat", "Rat", "mobs_rat_inventory.png", 0) - + -- cooked rat, yummy! minetest.register_craftitem("mobs:rat_cooked", { description = "Cooked Rat", diff --git a/mods/money/init.lua b/mods/money/init.lua index 9809c776..f2adeb43 100755 --- a/mods/money/init.lua +++ b/mods/money/init.lua @@ -71,7 +71,7 @@ local exist = money.exist end end) --]] --End. - + --Registration privileges. --[[minetest.register_privilege("money", "Can use /money [pay ] command") minetest.register_privilege("money_admin", { @@ -134,7 +134,7 @@ minetest.register_privilege("money_admin", { end if param1 and param2 and param3 then --/money pay/take/set/inc/dec 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) >= 0 then param3 = tonumber(param3) @@ -154,7 +154,7 @@ minetest.register_privilege("money_admin", { end else minetest.chat_send_player(name, "Your account is frozen.") - end + end return true end 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.") return true 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 end set_money(sender_name, get_money(sender_name) + meta:get_string("costsell")) @@ -520,7 +520,7 @@ minetest.register_node("money:barter_shop", { end, }) --End. - + minetest.register_craft({--Barter shop recipe. output = "money:barter_shop", recipe = { diff --git a/mods/more_chests/shared.lua b/mods/more_chests/shared.lua index bb291f3a..f4d05b4a 100755 --- a/mods/more_chests/shared.lua +++ b/mods/more_chests/shared.lua @@ -93,7 +93,7 @@ minetest.register_node("more_chests:shared", { end, on_receive_fields = function(pos, formspec, fields, sender) local meta = minetest.get_meta(pos); - if fields.shared then + if fields.shared then if meta:get_string("owner") == sender:get_player_name() then meta:set_string("shared", fields.shared); meta:set_string("formspec", get_formspec(fields.shared)) diff --git a/mods/moreblocks/circular_saw.lua b/mods/moreblocks/circular_saw.lua index 4735dcda..8f1bf4cb 100755 --- a/mods/moreblocks/circular_saw.lua +++ b/mods/moreblocks/circular_saw.lua @@ -135,7 +135,7 @@ function circular_saw:update_inventory(pos, amount) self:reset(pos) return end - + local stack = inv:get_stack("input", 1) -- At least one "normal" block is necessary to see what kind of stairs are requested. if stack:is_empty() then @@ -333,14 +333,14 @@ function circular_saw.can_dig(pos,player) end minetest.register_node("moreblocks:circular_saw", { - description = S("Circular Saw"), - drawtype = "nodebox", + description = S("Circular Saw"), + drawtype = "nodebox", node_box = { - type = "fixed", + type = "fixed", fixed = { {-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.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.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) @@ -351,9 +351,9 @@ minetest.register_node("moreblocks:circular_saw", { tiles = {"moreblocks_circular_saw_top.png", "moreblocks_circular_saw_bottom.png", "moreblocks_circular_saw_side.png"}, - paramtype = "light", + paramtype = "light", sunlight_propagates = true, - paramtype2 = "facedir", + paramtype2 = "facedir", groups = {choppy = 2,oddly_breakable_by_hand = 2}, sounds = default.node_sound_wood_defaults(), on_construct = circular_saw.on_construct, diff --git a/mods/moreblocks/crafting.lua b/mods/moreblocks/crafting.lua index 0faa8a37..08e07691 100755 --- a/mods/moreblocks/crafting.lua +++ b/mods/moreblocks/crafting.lua @@ -461,7 +461,7 @@ minetest.register_craft({ if minetest.setting_getbool("moreblocks.circular_saw_crafting") ~= false then -- “If nil or true then” minetest.register_craft({ - output = "moreblocks:circular_saw", + output = "moreblocks:circular_saw", recipe = { { "", "default:steel_ingot", "" }, { "group:wood", "group:wood", "group:wood"}, diff --git a/mods/moreores/init.lua b/mods/moreores/init.lua index 806b7aeb..0136840a 100755 --- a/mods/moreores/init.lua +++ b/mods/moreores/init.lua @@ -38,21 +38,21 @@ local function hoe_on_use(itemstack, user, pointed_thing, uses) if pt.type ~= "node" then return end - + local under = minetest.get_node(pt.under) local pos = {x = pt.under.x, y = pt.under.y + 1, z = pt.under.z} local above = minetest.get_node(pos) - + -- Return if any of the nodes is not registered: if not minetest.registered_nodes[under.name] then return end if not minetest.registered_nodes[above.name] then return end - + -- Check if the node above the pointed thing is air: if above.name ~= "air" then return end - + -- Check if pointing at dirt: if minetest.get_item_group(under.name, "soil") ~= 1 then return end - + -- Turn the node into soil, wear out item and play sound: minetest.set_node(pt.under, {name ="farming:soil"}) minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5}) @@ -149,7 +149,7 @@ local function add_ore(modname, description, mineral_name, oredef) }) minetest.register_alias(mineral_name .. "_ingot", ingot) end - + if oredef.makes.chest then minetest.register_craft( { output = "default:chest_locked", @@ -163,11 +163,11 @@ local function add_ore(modname, description, mineral_name, oredef) recipe = get_recipe(ingot, "lockedchest") }) end - + oredef.oredef.ore_type = "scatter" oredef.oredef.ore = modname .. ":mineral_" .. mineral_name oredef.oredef.wherein = "default:stone" - + minetest.register_ore(oredef.oredef) 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 } } - + if tool_name == "sword" then tdef.tool_capabilities.full_punch_interval = tooldef.full_punch_interval tdef.tool_capabilities.damage_groups = tooldef.damage_groups tdef.description = S("%s Sword"):format(S(description)) end - + if tool_name == "pick" then tdef.tool_capabilities.full_punch_interval = tooldef.full_punch_interval tdef.tool_capabilities.damage_groups = tooldef.damage_groups tdef.description = S("%s Pickaxe"):format(S(description)) end - + if tool_name == "axe" then tdef.tool_capabilities.full_punch_interval = tooldef.full_punch_interval 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.description = S("%s Shovel"):format(S(description)) end - + if tool_name == "hoe" then tdef.description = S("%s Hoe"):format(S(description)) local uses = tooldef.uses diff --git a/mods/moretrees/init.lua b/mods/moretrees/init.lua index 5f1bfdb2..523d4982 100755 --- a/mods/moretrees/init.lua +++ b/mods/moretrees/init.lua @@ -2,13 +2,13 @@ -- -- 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. -- -- Brought together into one mod and made L-systems compatible by Vanessa -- 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 -- by RealBadAngel. -- @@ -214,7 +214,7 @@ function moretrees:grow_jungletree(pos) local r2 = math.random(3) if r1 == 1 then moretrees.jungletree_model.leaves2 = "moretrees:jungletree_leaves_red" - else + else moretrees.jungletree_model.leaves2 = "moretrees:jungletree_leaves_yellow" end moretrees.jungletree_model.leaves2_chance = math.random(25, 75) diff --git a/mods/moretrees/leafdecay.lua b/mods/moretrees/leafdecay.lua index 04ee7114..efcbccbd 100755 --- a/mods/moretrees/leafdecay.lua +++ b/mods/moretrees/leafdecay.lua @@ -83,10 +83,10 @@ if moretrees.enable_default_leafdecay then minetest.remove_node(pos) nodeupdate(pos) 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 minetest.register_abm({ nodenames = "moretrees:apple_blossoms", @@ -112,6 +112,6 @@ if moretrees.enable_default_jungle_leafdecay then minetest.remove_node(pos) nodeupdate(pos) end - }) + }) end diff --git a/mods/moretrees/node_defs.lua b/mods/moretrees/node_defs.lua index b8ba3624..ffcbc817 100755 --- a/mods/moretrees/node_defs.lua +++ b/mods/moretrees/node_defs.lua @@ -1,7 +1,7 @@ local S = moretrees.intllib moretrees.avoidnodes = {} - + moretrees.treelist = { {"beech", "Beech 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_plantlike_leaves_visual_scale = 1 -if moretrees.plantlike_leaves then +if moretrees.plantlike_leaves then moretrees_new_leaves_drawtype = "plantlike" moretrees_plantlike_leaves_visual_scale = 1.189 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}, sounds = default.node_sound_defaults(), }) - + minetest.register_node("moretrees:"..treename.."_sapling_ongen", { description = S(treedesc.." Sapling"), drawtype = "plantlike", @@ -180,7 +180,7 @@ for i in ipairs(moretrees.treelist) do stairsplus:register_all( "moretrees", 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 }, tiles = { diff --git a/mods/name_restrictions/init.lua b/mods/name_restrictions/init.lua index 0dcadd0d..2868a83c 100755 --- a/mods/name_restrictions/init.lua +++ b/mods/name_restrictions/init.lua @@ -166,7 +166,7 @@ minetest.register_on_prejoinplayer(function(name, ip) .. " (" .. #name .. " characters, must be " .. min_name_len .. " characters at least)." .. " Please try a longer name." end - + if #name > max_name_len then return "Your player name is too long" .. " (" .. #name .. " characters, must be " .. max_name_len .. " characters at most)." diff --git a/mods/names_per_ip/init.lua b/mods/names_per_ip/init.lua index d3c2b00e..ccaa3aaa 100755 --- a/mods/names_per_ip/init.lua +++ b/mods/names_per_ip/init.lua @@ -23,7 +23,7 @@ minetest.register_chatcommand("whois", { minetest.chat_send_player(name, "The player \"" .. param .. "\" did not join yet.") return end - + local ip = ipnames.data[param] local names = ""; for k, v in pairs(ipnames.data) do @@ -52,11 +52,11 @@ minetest.register_on_prejoinplayer(function(name, ip) names = names .. k .. ", " end end - + if count <= ipnames.name_per_ip_limit and count > 1 then minetest.log("action", name .. " now has " .. count .. " accounts. Other accounts: " .. names) end - + if count > ipnames.name_per_ip_limit then ipnames.tmp_data[name] = nil if tostring(ip) ~= "127.0.0.1" then diff --git a/mods/news/init.lua b/mods/news/init.lua index e3a1e8f9..ab9709d9 100755 --- a/mods/news/init.lua +++ b/mods/news/init.lua @@ -3,24 +3,24 @@ local news = {} local path = minetest.get_worldpath() 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 --else -- article = "news_"..article..".txt" --end - + local newsfile = io.open(path.."/"..article,"r") - + local formspec = "size[12,10;]" formspec = formspec.."background[-0.22,-0.25;13,11;background.jpg]" if newsfile ~= nil then local newscontent = newsfile:read("*a") 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]" - end + end formspec = formspec.."button_exit[5,9.25;2,1;exit;Fermer" if ( newsfile ~= nil ) then newsfile:close() @@ -40,7 +40,7 @@ minetest.register_chatcommand("news",{ description="Montre les news du serveur", func = function (name,params) 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, }) diff --git a/mods/pipeworks/autocrafter.lua b/mods/pipeworks/autocrafter.lua index 36090687..def9603b 100755 --- a/mods/pipeworks/autocrafter.lua +++ b/mods/pipeworks/autocrafter.lua @@ -238,24 +238,24 @@ local function upgrade_autocrafter(pos, meta) end minetest.register_node("pipeworks:autocrafter", { - description = "Autocrafter", - drawtype = "normal", - tiles = {"pipeworks_autocrafter.png"}, - groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, + description = "Autocrafter", + drawtype = "normal", + tiles = {"pipeworks_autocrafter.png"}, + groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, tube = {insert_object = function(pos, node, stack, direction) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local added = inv:add_item("src", stack) after_inventory_change(pos) return added - end, + end, can_insert = function(pos, node, stack, direction) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() return inv:room_for_item("src", stack) - end, - input_inventory = "dst", - connect_sides = {left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1}}, + end, + input_inventory = "dst", + connect_sides = {left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1}}, on_construct = function(pos) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -282,7 +282,7 @@ minetest.register_node("pipeworks:autocrafter", { local meta = minetest.get_meta(pos) local inv = meta:get_inventory() return (inv:is_empty("src") and inv:is_empty("dst")) - end, + end, after_place_node = pipeworks.scan_for_tube_objects, after_dig_node = function(pos) pipeworks.scan_for_tube_objects(pos) diff --git a/mods/pipeworks/devices.lua b/mods/pipeworks/devices.lua index 52f3002f..c96ad977 100755 --- a/mods/pipeworks/devices.lua +++ b/mods/pipeworks/devices.lua @@ -67,10 +67,10 @@ for s in ipairs(states) do drop = "pipeworks:pump_off", mesecons = {effector = { 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, 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 }}, 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 }) end }) - + minetest.register_node("pipeworks:valve_"..states[s].."_empty", { description = "Valve", drawtype = "mesh", @@ -107,10 +107,10 @@ for s in ipairs(states) do drop = "pipeworks:valve_off_empty", mesecons = {effector = { 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, 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 }}, on_punch = function(pos, node, puncher) @@ -148,10 +148,10 @@ minetest.register_node("pipeworks:valve_on_loaded", { drop = "pipeworks:valve_off_empty", mesecons = {effector = { 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, 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 }}, on_punch = function(pos, node, puncher) @@ -284,7 +284,7 @@ minetest.register_node("pipeworks:entry_panel_empty", { collision_box = panel_cbox, on_place = function(itemstack, placer, pointed_thing) 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 local node = minetest.get_node(pointed_thing.under) @@ -376,7 +376,7 @@ minetest.register_node("pipeworks:flow_sensor_empty", { end, on_construct = function(pos) if mesecon then - mesecon.receptor_off(pos, rules) + mesecon.receptor_off(pos, rules) end end, selection_box = { @@ -415,7 +415,7 @@ minetest.register_node("pipeworks:flow_sensor_loaded", { end, on_construct = function(pos) if mesecon then - mesecon.receptor_on(pos, rules) + mesecon.receptor_on(pos, rules) end end, selection_box = { @@ -522,7 +522,7 @@ minetest.register_node("pipeworks:fountainhead", { end, on_construct = function(pos) if mesecon then - mesecon.receptor_on(pos, rules) + mesecon.receptor_on(pos, rules) end end, selection_box = { @@ -553,7 +553,7 @@ minetest.register_node("pipeworks:fountainhead_pouring", { end, on_construct = function(pos) if mesecon then - mesecon.receptor_on(pos, rules) + mesecon.receptor_on(pos, rules) end end, selection_box = { diff --git a/mods/pipeworks/flowing_logic.lua b/mods/pipeworks/flowing_logic.lua index e0a6236d..4364e02e 100755 --- a/mods/pipeworks/flowing_logic.lua +++ b/mods/pipeworks/flowing_logic.lua @@ -46,8 +46,8 @@ pipeworks.check_for_inflows = function(pos,node) source = {x=coords[i].x,y=coords[i].y,z=coords[i].z} end end - if newnode then - minetest.add_node(pos,{name=newnode, param2 = node.param2}) + if newnode then + minetest.add_node(pos,{name=newnode, param2 = node.param2}) minetest.get_meta(pos):set_string("source",minetest.pos_to_string(source)) end end @@ -61,15 +61,15 @@ pipeworks.check_sources = function(pos,node) newnode = string.gsub(node.name,"loaded","empty") end - if newnode then - minetest.add_node(pos,{name=newnode, param2 = node.param2}) + if newnode then + minetest.add_node(pos,{name=newnode, param2 = node.param2}) minetest.get_meta(pos):set_string("source","") end end pipeworks.spigot_check = function(pos, node) 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 fdir=node.param2 local check = { @@ -99,7 +99,7 @@ end pipeworks.fountainhead_check = function(pos, node) 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 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 diff --git a/mods/pipeworks/item_transport.lua b/mods/pipeworks/item_transport.lua index fb9f6262..e8553dab 100755 --- a/mods/pipeworks/item_transport.lua +++ b/mods/pipeworks/item_transport.lua @@ -77,7 +77,7 @@ local function go_next(pos, velocity, stack) if not next_positions[1] then return false, nil end - + local n = (cmeta:get_int("tubedir") % (#next_positions)) + 1 if pipeworks.enable_cyclic_mode then cmeta:set_int("tubedir", n) @@ -182,7 +182,7 @@ luaentity.register_entity("pipeworks:tubed_item", { self.itemstring = itemstring self.item_entity = self:add_attached_entity("pipeworks:tubed_item", itemstring) end, - + set_color = function(self, color) if self.color == color then return @@ -204,13 +204,13 @@ luaentity.register_entity("pipeworks:tubed_item", { self.start_pos = vector.round(pos) self:setpos(pos) end - + local pos = self:getpos() local stack = ItemStack(self.itemstring) local drop_pos - + local velocity = self:getvelocity() - + local moved = false local speed = math.abs(velocity.x + velocity.y + velocity.z) if speed == 0 then @@ -218,12 +218,12 @@ luaentity.register_entity("pipeworks:tubed_item", { moved = true end 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 self.start_pos = vector.add(self.start_pos, vel) moved = true end - + minetest.load_position(self.start_pos) local node = minetest.get_node(self.start_pos) 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()) return end - + if moved then local found_next, new_velocity = go_next(self.start_pos, velocity, stack) -- todo: color if not found_next then 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) self:remove() return end end - + if new_velocity and not vector.equals(velocity, new_velocity) then self:setpos(self.start_pos) self:setvelocity(new_velocity) diff --git a/mods/pipeworks/legacy.lua b/mods/pipeworks/legacy.lua index b36cdedd..e02a2360 100755 --- a/mods/pipeworks/legacy.lua +++ b/mods/pipeworks/legacy.lua @@ -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.register_abm({ @@ -37,10 +37,10 @@ if not minetest.get_modpath("auto_tree_tap") and after_place_node = function (pos, placer) pipeworks.scan_for_tube_objects(pos, placer) local placer_pos = placer:getpos() - + --correct for the player's height if placer:is_player() then placer_pos.y = placer_pos.y + 1.5 end - + --correct for 6d facedir if placer_pos then local dir = { diff --git a/mods/pipeworks/luaentity.lua b/mods/pipeworks/luaentity.lua index 241da144..4b3d808e 100755 --- a/mods/pipeworks/luaentity.lua +++ b/mods/pipeworks/luaentity.lua @@ -194,7 +194,7 @@ local entitydef_default = { end end, getvelocity = function(self) - return vector.new(self._velocity) + return vector.new(self._velocity) end, setvelocity = function(self, velocity) self._velocity = vector.new(velocity) @@ -268,7 +268,7 @@ function luaentity.add_entity(pos, name) _acceleration = {x = 0, y = 0, z = 0}, _attached_entities = {}, } - + local prototype = luaentity.registered_entities[name] setmetatable(entity, prototype) -- Default to prototype for other methods luaentity.entities[index] = entity diff --git a/mods/pipeworks/models.lua b/mods/pipeworks/models.lua index 3be773cf..1a302b59 100755 --- a/mods/pipeworks/models.lua +++ b/mods/pipeworks/models.lua @@ -34,7 +34,7 @@ pipeworks.tube_frontstub = { pipeworks.tube_backstub = { { -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} diff --git a/mods/pipeworks/pipes.lua b/mods/pipeworks/pipes.lua index 2056fdfa..3bfe4bf9 100755 --- a/mods/pipeworks/pipes.lua +++ b/mods/pipeworks/pipes.lua @@ -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}} for index, connects in ipairs(cconnects) do local outsel = {} - + local jx = 0 local jy = 0 local jz = 0 @@ -28,7 +28,7 @@ for index, connects in ipairs(cconnects) do local v = connects[1] v = v-1 + 2*(v%2) -- Opposite side end - + local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1} local pipedesc = "Pipe segement".." "..dump(connects).."... You hacker, you." local image = nil @@ -38,11 +38,11 @@ for index, connects in ipairs(cconnects) do pipedesc = "Pipe segment" image = "pipeworks_pipe_inv.png" end - + local outimg_e = { "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_l = { "pipeworks_pipe_3_loaded.png" } end @@ -82,7 +82,7 @@ for index, connects in ipairs(cconnects) do pipeworks.scan_for_pipe_objects(pos) end }) - + local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1} minetest.register_node("pipeworks:pipe_"..index.."_loaded", { @@ -112,7 +112,7 @@ for index, connects in ipairs(cconnects) do pipeworks.scan_for_pipe_objects(pos) end }) - + table.insert(pipes_empty_nodenames, "pipeworks:pipe_"..index.."_empty") table.insert(pipes_full_nodenames, "pipeworks:pipe_"..index.."_loaded") end @@ -206,7 +206,7 @@ minetest.register_abm({ nodenames = {"pipeworks:spigot","pipeworks:spigot_pouring"}, interval = 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) end }) @@ -215,7 +215,7 @@ minetest.register_abm({ nodenames = {"pipeworks:fountainhead","pipeworks:fountainhead_pouring"}, interval = 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) end }) diff --git a/mods/pipeworks/teleport_tube.lua b/mods/pipeworks/teleport_tube.lua index 3a870f52..f9b03281 100755 --- a/mods/pipeworks/teleport_tube.lua +++ b/mods/pipeworks/teleport_tube.lua @@ -173,7 +173,7 @@ pipeworks.register_tube("pipeworks:teleport_tube", { if mode == ":" then minetest.chat_send_player(sender_name, "Sorry, channel '"..new_channel.."' is reserved for exclusive use by "..name) return - + --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 minetest.chat_send_player(sender_name, "Sorry, receiving from channel '"..new_channel.."' is reserved for "..name) diff --git a/mods/pipeworks/trashcan.lua b/mods/pipeworks/trashcan.lua index 87980ab7..35ea321b 100755 --- a/mods/pipeworks/trashcan.lua +++ b/mods/pipeworks/trashcan.lua @@ -1,6 +1,6 @@ minetest.register_node("pipeworks:trashcan", { - description = "Trash Can", - drawtype = "normal", + description = "Trash Can", + drawtype = "normal", tiles = { "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", - }, - groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, + }, + groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, tube = { insert_object = function(pos, node, stack, direction) return ItemStack("") end, connect_sides = {left = 1, right = 1, front = 1, back = 1, top = 1, bottom = 1}, priority = 1, -- Lower than anything else - }, + }, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", @@ -31,7 +31,7 @@ minetest.register_node("pipeworks:trashcan", { "list[current_player;main;0,3;8,4;]") meta:set_string("infotext", "Trash Can") meta:get_inventory():set_size("trash", 1) - end, + end, after_place_node = pipeworks.after_place, after_dig_node = pipeworks.after_dig, on_metadata_inventory_put = function(pos, listname, index, stack, player) diff --git a/mods/pipeworks/tube_registration.lua b/mods/pipeworks/tube_registration.lua index c9262165..8f4803e2 100755 --- a/mods/pipeworks/tube_registration.lua +++ b/mods/pipeworks/tube_registration.lua @@ -38,11 +38,11 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e local outboxes = {} local outsel = {} local outimgs = {} - + for i = 1, 6 do outimgs[vti[i]] = plain[i] end - + for _, v in ipairs(connects) do table.extend(outboxes, pipeworks.tube_boxes[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 } wscale = {x = 1, y = 1, z = 0.01} end - + local rname = string.format("%s_%s", name, tname) table.insert(tubenodes, rname) - + local nodedef = { description = tubedesc, drawtype = "nodebox", @@ -112,7 +112,7 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e if style == "6d" then nodedef.paramtype2 = "facedir" end - + if special == nil then special = {} end for key, value in pairs(special) do diff --git a/mods/quartz/init.lua b/mods/quartz/init.lua index 94c09c23..8006e4c1 100755 --- a/mods/quartz/init.lua +++ b/mods/quartz/init.lua @@ -20,7 +20,7 @@ minetest.register_node("quartz:quartz_ore", { drop = 'quartz:quartz_crystal', sounds = default.node_sound_stone_defaults(), }) - + minetest.register_ore({ ore_type = "scatter", 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 stair", "Quartz Pillar slab", - default.node_sound_glass_defaults()) + default.node_sound_glass_defaults()) + + + + + + - - - - - - --Crafting --Quartz Crystal Piece @@ -99,7 +99,7 @@ minetest.register_craft({ {'', '', ''} } }) - + --Chiseled Quartz minetest.register_craft({ output = "quartz:chiseled 2", @@ -169,22 +169,22 @@ if minetest.get_modpath("moreblocks") and enable_stairsplus then "Quartz Block", "block", 0) - + register_stair_slab_panel_micro("quartz", "chiseled", "quartz:chiseled", {cracky=3}, {"quartz_chiseled.png"}, "Chiseled Quartz", "chiseled", 0) - + register_stair_slab_panel_micro("quartz", "pillar", "quartz:pillar", {cracky=3}, {"quartz_pillar_top.png", "quartz_pillar_top.png", "quartz_pillar_side.png"}, "Quartz Pillar", "pillar", 0) - + table.insert(circular_saw.known_stairs, "quartz:block") table.insert(circular_saw.known_stairs, "quartz:chiseled") table.insert(circular_saw.known_stairs, "quartz:pillar") -end +end diff --git a/mods/random_messages/init.lua b/mods/random_messages/init.lua index c8124982..6aae9e64 100755 --- a/mods/random_messages/init.lua +++ b/mods/random_messages/init.lua @@ -4,7 +4,7 @@ arsdragonfly@gmail.com 6/19/2013 --]] --Time between two subsequent messages. -local MESSAGE_INTERVAL = 0 +local MESSAGE_INTERVAL = 0 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. minetest.setting_set("random_messages_interval",120) minetest.setting_save(); - return 120 + return 120 end function random_messages.set_interval() --Read the interval from minetest.conf(set it if it doesn'st exist) diff --git a/mods/riesenpilz/init.lua b/mods/riesenpilz/init.lua index c118ce40..39774775 100755 --- a/mods/riesenpilz/init.lua +++ b/mods/riesenpilz/init.lua @@ -99,7 +99,7 @@ function riesenpilz_minecraft_fliegenpilz(pos) local manip = minetest.get_voxel_manip() local area = r_area(manip, 2, 4, pos) local nodes = manip:get_data() - local param2s = manip:get_param2_data() + local param2s = manip:get_param2_data() local height = 3 diff --git a/mods/shutdown/init.lua b/mods/shutdown/init.lua index 643bb9fe..de5a979d 100755 --- a/mods/shutdown/init.lua +++ b/mods/shutdown/init.lua @@ -13,7 +13,7 @@ local timer = 0 minetest.register_globalstep(function(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 if timer < 60 then return @@ -24,7 +24,7 @@ minetest.register_globalstep(function(dtime) local jour = os.date("%u") -- Warn only on monday, thursday, and saturday if jour ~= 1 and jour~= 4 and jour ~= 6 then return end - + 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("Attention, server will shutdown in 30 minutes for backup.") diff --git a/mods/snowdrift/init.lua b/mods/snowdrift/init.lua index 5c2261fd..4cd0b93e 100755 --- a/mods/snowdrift/init.lua +++ b/mods/snowdrift/init.lua @@ -21,7 +21,7 @@ local SETTLE = false -- Snow collects on ground within 32 nodes of player local RAIN = false -- Rain above humidity threshold local THOVER = false -- Instead use a temperature and humidity system with -- snow in overlap of cold and humid areas, else rain in humid areas - + -- Temperature noise parameters 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 @@ -46,7 +46,7 @@ minetest.register_globalstep(function(dtime) local perlinp = minetest.get_perlin(813, 1, 0.5, SCALP) if perlinp:get2d({x = os.clock()/60, y = 0}) < PRET then return - end + end for _, player in ipairs(minetest.get_connected_players()) do if math.random() > PPPCHA or player:getpos().y < -19600 then return @@ -66,7 +66,7 @@ minetest.register_globalstep(function(dtime) local perlint = minetest.get_perlin(SEEDT, OCTAT, PERST, SCALT) noiset = perlint:get2d({x = pposx, y = pposz}) end - if RAIN or THOVER then + if RAIN or THOVER then local perlinh = minetest.get_perlin(SEEDH, OCTAH, PERSH, SCALH) noiseh = perlinh:get2d({x = pposx, y = pposz}) end @@ -188,6 +188,6 @@ minetest.register_globalstep(function(dtime) playername = player:get_player_name(), }) end - end + end end end) diff --git a/mods/soundset/init.lua b/mods/soundset/init.lua index 1a66c4d3..f45a2c4f 100755 --- a/mods/soundset/init.lua +++ b/mods/soundset/init.lua @@ -40,7 +40,7 @@ soundset.set_sound = function(name, param) minetest.chat_send_player(name, "invalid param, /setsound ") return end - + 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) return @@ -50,18 +50,18 @@ soundset.set_sound = function(name, param) minetest.chat_send_player(name, "invalid value, " ..param_value .. " must be number") return end - + if value < 0 then value = 0 elseif value > 100 then value = 100 end - + if soundset.gainplayers[name][param_name] == value then minetest.chat_send_player(name, "volume " .. param_name .. " already set to " .. value) return end - + soundset.gainplayers[name][param_name] = value minetest.chat_send_player(name, "sound " .. param_name .. " set to " .. value) save_sounds_config() @@ -203,7 +203,7 @@ minetest.register_chatcommand("soundset", { if not name then return end on_show_settings(name, soundset.gainplayers[name]["music"], soundset.gainplayers[name]["ambience"], soundset.gainplayers[name]["other"]) end -}) +}) diff --git a/mods/spawn/init.lua b/mods/spawn/init.lua index bc21d502..fbc5692a 100755 --- a/mods/spawn/init.lua +++ b/mods/spawn/init.lua @@ -7,7 +7,7 @@ minetest.register_on_chat_message(function(name, message, playername, player) if message:sub(0, #cmd) == cmd then if message == '/spawn' then local player = minetest.get_player_by_name(name) - + -- Checking timers local timer_player = os.difftime(os.time(),timers[name]) if timer_player ~= nil and timer_player < SPAWN_INTERVAL then -- less than x minutes diff --git a/mods/sponge/init.lua b/mods/sponge/init.lua index 0139afde..a6a695a4 100755 --- a/mods/sponge/init.lua +++ b/mods/sponge/init.lua @@ -21,7 +21,7 @@ minetest.register_node("sponge:sponge", { local on_water = false local pos = pointed_thing.above -- verifier si il est dans l'eau ou a cotée - if string.find(minetest.get_node(pointed_thing.above).name, "water_source") + if string.find(minetest.get_node(pointed_thing.above).name, "water_source") or string.find(minetest.get_node(pointed_thing.above).name, "water_flowing") then on_water = true end @@ -49,7 +49,7 @@ minetest.register_node("sponge:sponge", { on_water = true end end - + if on_water == true then for i=-3,3 do for j=-3,3 do @@ -68,13 +68,13 @@ minetest.register_node("sponge:sponge", { p = {x=pos.x, y=pos.y, z=pos.z} n = minetest.get_node(p) if change == true then - minetest.add_node(pointed_thing.above, {name = "sponge:sponge_wet"}) + minetest.add_node(pointed_thing.above, {name = "sponge:sponge_wet"}) else - minetest.add_node(pointed_thing.above, {name = "sponge:sponge"}) + minetest.add_node(pointed_thing.above, {name = "sponge:sponge"}) end itemstack:take_item() return itemstack - + end }) diff --git a/mods/sprint/esprint.lua b/mods/sprint/esprint.lua index adda7e9b..330ed593 100755 --- a/mods/sprint/esprint.lua +++ b/mods/sprint/esprint.lua @@ -2,9 +2,9 @@ Sprint mod for Minetest by GunshipPenguin To the extent possible under law, the author(s) -have dedicated all copyright and related and neighboring rights +have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is -distributed without any warranty. +distributed without any warranty. ]] local players = {} @@ -15,9 +15,9 @@ minetest.register_on_joinplayer(function(player) players[playerName] = { sprinting = false, - timeOut = 0, - stamina = SPRINT_STAMINA, - epressed = false, + timeOut = 0, + stamina = SPRINT_STAMINA, + epressed = false, } if SPRINT_HUDBARS_USED then hb.init_hudbar(player, "sprint") @@ -61,12 +61,12 @@ minetest.register_globalstep(function(dtime) setSprinting(playerName, false) playerInfo["timeOut"] = 3 end - - + + if gameTime > 0.4 then gameTime = 0 local pos = player:getpos() - -- From playerplus : + -- From playerplus : -- am I near a cactus? pos.y = pos.y + 0.1 local near = minetest.find_node_near(pos, 1, "default:cactus") @@ -75,8 +75,8 @@ minetest.register_globalstep(function(dtime) player:set_hp(player:get_hp()-1) end end - - --If the player is sprinting, create particles behind him/her + + --If the player is sprinting, create particles behind him/her if playerInfo["sprinting"] == true then local numParticles = math.random(1, 2) local playerPos = player:getpos() @@ -97,14 +97,14 @@ minetest.register_globalstep(function(dtime) end end end - + --Adjust player states if players[playerName]["epressed"] == true and playerInfo["timeOut"] == 0 then --Stopped setSprinting(playerName, true) elseif players[playerName]["epressed"] == false then setSprinting(playerName, false) end - + if playerInfo["timeOut"] > 0 then playerInfo["timeOut"] = playerInfo["timeOut"] - dtime if playerInfo["timeOut"] < 0 then @@ -112,7 +112,7 @@ minetest.register_globalstep(function(dtime) end else --Lower the player's stamina by dtime if he/she is sprinting and set his/her state to 0 if stamina is zero - if playerInfo["sprinting"] == true then + if playerInfo["sprinting"] == true then playerInfo["stamina"] = playerInfo["stamina"] - dtime if playerInfo["stamina"] <= 0 then playerInfo["stamina"] = 0 @@ -122,7 +122,7 @@ minetest.register_globalstep(function(dtime) end end end - + --Increase player's stamina if he/she is not sprinting and his/her stamina is less than SPRINT_STAMINA if playerInfo["sprinting"] == false and playerInfo["stamina"] < SPRINT_STAMINA then playerInfo["stamina"] = playerInfo["stamina"] + dtime @@ -131,7 +131,7 @@ minetest.register_globalstep(function(dtime) if playerInfo["stamina"] > SPRINT_STAMINA then playerInfo["stamina"] = SPRINT_STAMINA end - + --Update the players's hud sprint stamina bar if SPRINT_HUDBARS_USED then diff --git a/mods/sprint/init.lua b/mods/sprint/init.lua index 91da678e..ee90f0c9 100755 --- a/mods/sprint/init.lua +++ b/mods/sprint/init.lua @@ -2,9 +2,9 @@ Sprint mod for Minetest by GunshipPenguin To the extent possible under law, the author(s) -have dedicated all copyright and related and neighboring rights +have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is -distributed without any warranty. +distributed without any warranty. ]] --Configuration variables, these are all explained in README.md diff --git a/mods/sprint/wsprint.lua b/mods/sprint/wsprint.lua index 719ba760..2923d83c 100755 --- a/mods/sprint/wsprint.lua +++ b/mods/sprint/wsprint.lua @@ -2,9 +2,9 @@ Sprint mod for Minetest by GunshipPenguin To the extent possible under law, the author(s) -have dedicated all copyright and related and neighboring rights +have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is -distributed without any warranty. +distributed without any warranty. ]] local players = {} @@ -13,10 +13,10 @@ local staminaHud = {} minetest.register_on_joinplayer(function(player) local playerName = player:get_player_name() players[playerName] = { - state = 0, - timeOut = 0, - stamina = SPRINT_STAMINA, - moving = false, + state = 0, + timeOut = 0, + stamina = SPRINT_STAMINA, + moving = false, } if SPRINT_HUDBARS_USED then @@ -53,7 +53,7 @@ minetest.register_globalstep(function(dtime) local near = minetest.find_node_near(pos, 1, "default:cactus") if near then pos = near - + -- am I touching the cactus? if so it hurts for _,player in ipairs(minetest.get_objects_inside_radius(pos, 1.0)) do if player:get_hp() > 0 then @@ -61,10 +61,10 @@ minetest.register_globalstep(function(dtime) end end end - + --Check if they are moving or not players[playerName]["moving"] = player:get_player_control()["up"] - + --If the player has tapped w longer than SPRINT_TIMEOUT ago, set his/her state to 0 if playerInfo["state"] == 2 then if playerInfo["timeOut"] + SPRINT_TIMEOUT < gameTime then @@ -72,7 +72,7 @@ minetest.register_globalstep(function(dtime) setState(playerName, 0) end - --If the player is sprinting, create particles behind him/her + --If the player is sprinting, create particles behind him/her elseif playerInfo["state"] == 3 and gameTime % 0.1 == 0 then local numParticles = math.random(1, 2) local playerPos = player:getpos() @@ -103,16 +103,16 @@ minetest.register_globalstep(function(dtime) elseif players[playerName]["moving"] == true and playerInfo["state"] == 2 then --Sprinting setState(playerName, 3) end - + --Lower the player's stamina by dtime if he/she is sprinting and set his/her state to 0 if stamina is zero - if playerInfo["state"] == 3 then + if playerInfo["state"] == 3 then playerInfo["stamina"] = playerInfo["stamina"] - dtime if playerInfo["stamina"] <= 0 then playerInfo["stamina"] = 0 setState(playerName, 0) minetest.sound_play("default_breathless",{object=player}) end - + --Increase player's stamina if he/she is not sprinting and his/her stamina is less than SPRINT_STAMINA elseif playerInfo["state"] ~= 3 and playerInfo["stamina"] < SPRINT_STAMINA then playerInfo["stamina"] = playerInfo["stamina"] + dtime @@ -121,7 +121,7 @@ minetest.register_globalstep(function(dtime) if playerInfo["stamina"] > SPRINT_STAMINA then playerInfo["stamina"] = SPRINT_STAMINA end - + --Update the players's hud sprint stamina bar if SPRINT_HUDBARS_USED then diff --git a/mods/stained_glass/init.lua b/mods/stained_glass/init.lua index 08e647fa..f61c470c 100755 --- a/mods/stained_glass/init.lua +++ b/mods/stained_glass/init.lua @@ -159,7 +159,7 @@ for h = 1, 12 do end --hues ---secondary loop for light blocks +--secondary loop for light blocks --(as they don't have 50% saturation blocks to go along with 'em) @@ -200,7 +200,7 @@ for h = 1, 12 do end --hues ---third loop for pastel blocks +--third loop for pastel blocks --(as they don't have 50% saturation blocks to go along with 'em) --(plus they have a diff recipe to create.) @@ -244,7 +244,7 @@ for h = 1, 12 do end --hues ---last loop for faint blocks +--last loop for faint blocks --(as they don't have 50% saturation blocks to go along with 'em) --(plus they have a diff recipe to create.) diff --git a/mods/throwing/build_arrow.lua b/mods/throwing/build_arrow.lua index 7f09a63c..fbf6dd25 100755 --- a/mods/throwing/build_arrow.lua +++ b/mods/throwing/build_arrow.lua @@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_build_box", { {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - + {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, diff --git a/mods/throwing/dig_arrow.lua b/mods/throwing/dig_arrow.lua index 4e7cf9be..bed3b87e 100755 --- a/mods/throwing/dig_arrow.lua +++ b/mods/throwing/dig_arrow.lua @@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_dig_box", { {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - + {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, diff --git a/mods/throwing/fire_arrow.lua b/mods/throwing/fire_arrow.lua index 9457a879..da26df5c 100755 --- a/mods/throwing/fire_arrow.lua +++ b/mods/throwing/fire_arrow.lua @@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_fire_box", { {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - + {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, diff --git a/mods/throwing/fireworks_arrows.lua b/mods/throwing/fireworks_arrows.lua index 4dd38fe8..b0895104 100755 --- a/mods/throwing/fireworks_arrows.lua +++ b/mods/throwing/fireworks_arrows.lua @@ -3,7 +3,7 @@ local function throwing_register_fireworks(color, desc) description = desc .. "fireworks arrow", inventory_image = "throwing_arrow_fireworks_" .. color .. ".png", }) - + minetest.register_node("throwing:arrow_fireworks_" .. color .. "_box", { drawtype = "nodebox", node_box = { @@ -19,7 +19,7 @@ local function throwing_register_fireworks(color, desc) {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - + {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, @@ -29,7 +29,7 @@ local function throwing_register_fireworks(color, desc) tiles = {"throwing_arrow_fireworks_" .. color .. ".png", "throwing_arrow_fireworks_" .. color .. ".png", "throwing_arrow_fireworks_" .. color .. "_back.png", "throwing_arrow_fireworks_" .. color .. "_front.png", "throwing_arrow_fireworks_" .. color .. "_2.png", "throwing_arrow_fireworks_" .. color .. ".png"}, groups = {not_in_creative_inventory=1}, }) - + local THROWING_ARROW_ENTITY={ physical = false, timer=0, @@ -39,9 +39,9 @@ local function throwing_register_fireworks(color, desc) lastpos={}, collisionbox = {0,0,0,0,0,0}, } - + local radius = 0.5 - + local function add_effects(pos, radius) minetest.add_particlespawner({ amount = 256, @@ -59,8 +59,8 @@ local function throwing_register_fireworks(color, desc) texture = "throwing_sparkle_" .. color .. ".png", }) end - - + + local function boom(pos) minetest.sound_play("throwing_firework_boom", {pos=pos, gain=1, max_hear_distance=2*64}) if minetest.get_node(pos).name == 'air' or minetest.get_node(pos).name == 'throwing:firework_trail' then @@ -69,9 +69,9 @@ local function throwing_register_fireworks(color, desc) end add_effects(pos, radius) end - + -- Back to the arrow - + THROWING_ARROW_ENTITY.on_step = function(self, dtime) self.timer=self.timer+dtime local pos = self.object:getpos() @@ -126,16 +126,16 @@ local function throwing_register_fireworks(color, desc) end self.lastpos={x=pos.x, y=pos.y, z=pos.z} end - + minetest.register_entity("throwing:arrow_fireworks_" .. color .. "_entity", THROWING_ARROW_ENTITY) - + minetest.register_craft({ output = 'throwing:arrow_fireworks_' .. color .. ' 8', recipe = { {'default:stick', 'tnt:gunpowder', 'dye:' .. color}, } }) - + minetest.register_craft({ output = 'throwing:arrow_fireworks_' .. color .. ' 8', recipe = { diff --git a/mods/throwing/functions.lua b/mods/throwing/functions.lua index 568ad6e6..e6d1c518 100755 --- a/mods/throwing/functions.lua +++ b/mods/throwing/functions.lua @@ -1,6 +1,6 @@ ---~ +--~ --~ Shot and reload system ---~ +--~ local players = {} @@ -80,7 +80,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough description = desc, inventory_image = "throwing_" .. name .. ".png", wield_scale = scale, - stack_max = 1, + stack_max = 1, on_use = function(itemstack, user, pointed_thing) local pos = user:getpos() local playerName = user:get_player_name() @@ -91,7 +91,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough return itemstack end, }) - + minetest.register_tool("throwing:" .. name .. "_loaded", { description = desc, inventory_image = "throwing_" .. name .. "_loaded.png", @@ -104,7 +104,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough end local unloaded = "throwing:" .. name throwing_shoot_arrow(itemstack, user, stiffness, is_cross) - minetest.after(0, throwing_unload, itemstack, user, unloaded, wear) + minetest.after(0, throwing_unload, itemstack, user, unloaded, wear) return itemstack end, on_drop = function(itemstack, dropper, pointed_thing) @@ -114,7 +114,7 @@ function throwing_register_bow (name, desc, scale, stiffness, reload_time, tough end, groups = {not_in_creative_inventory=1}, }) - + minetest.register_craft({ output = 'throwing:' .. name, recipe = craft diff --git a/mods/throwing/shell_arrow.lua b/mods/throwing/shell_arrow.lua index 76750e9f..77033ac1 100755 --- a/mods/throwing/shell_arrow.lua +++ b/mods/throwing/shell_arrow.lua @@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_shell_box", { {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - + {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, diff --git a/mods/throwing/standard_arrows.lua b/mods/throwing/standard_arrows.lua index 900b4b8d..72cb463a 100755 --- a/mods/throwing/standard_arrows.lua +++ b/mods/throwing/standard_arrows.lua @@ -3,7 +3,7 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft) description = desc .. " arrow", inventory_image = "throwing_arrow_" .. kind .. ".png", }) - + minetest.register_node("throwing:arrow_" .. kind .. "_box", { drawtype = "nodebox", node_box = { @@ -19,7 +19,7 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft) {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - + {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, @@ -29,7 +29,7 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft) tiles = {"throwing_arrow_" .. kind .. ".png", "throwing_arrow_" .. kind .. ".png", "throwing_arrow_" .. kind .. "_back.png", "throwing_arrow_" .. kind .. "_front.png", "throwing_arrow_" .. kind .. "_2.png", "throwing_arrow_" .. kind .. ".png"}, groups = {not_in_creative_inventory=1}, }) - + local THROWING_ARROW_ENTITY={ physical = false, timer=0, @@ -39,19 +39,19 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft) lastpos={}, collisionbox = {0,0,0,0,0,0}, } - + THROWING_ARROW_ENTITY.on_step = function(self, dtime) self.timer=self.timer+dtime local pos = self.object:getpos() local node = minetest.get_node(pos) - + if self.timer>0.2 then local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2) for k, obj in pairs(objs) do if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "throwing:arrow_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then local speed = vector.length(self.object:getvelocity()) - local damage = ((speed + eq)^1.2)/10 + local damage = ((speed + eq)^1.2)/10 obj:punch(self.object, 1.0, { full_punch_interval=1.0, damage_groups={fleshy=damage}, @@ -66,7 +66,7 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft) end end end - + if self.lastpos.x~=nil then if node.name ~= "air" and not string.find(node.name, 'default:grass') and not string.find(node.name, 'default:junglegrass') and not string.find(node.name, 'flowers:') and not string.find(node.name, 'farming:') then self.object:remove() @@ -79,16 +79,16 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft) end self.lastpos={x=pos.x, y=pos.y, z=pos.z} end - + minetest.register_entity("throwing:arrow_" .. kind .. "_entity", THROWING_ARROW_ENTITY) - + minetest.register_craft({ output = 'throwing:arrow_' .. kind .. ' 16', recipe = { {'default:stick', 'default:stick', craft}, } }) - + minetest.register_craft({ output = 'throwing:arrow_' .. kind .. ' 16', recipe = { diff --git a/mods/throwing/teleport_arrow.lua b/mods/throwing/teleport_arrow.lua index 0eadc6e3..6b5ba500 100755 --- a/mods/throwing/teleport_arrow.lua +++ b/mods/throwing/teleport_arrow.lua @@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_teleport_box", { {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - + {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, diff --git a/mods/throwing/tnt_arrow.lua b/mods/throwing/tnt_arrow.lua index d0a4f7dc..441b4f28 100755 --- a/mods/throwing/tnt_arrow.lua +++ b/mods/throwing/tnt_arrow.lua @@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_tnt_box", { {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - + {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, diff --git a/mods/throwing/torch_arrow.lua b/mods/throwing/torch_arrow.lua index 004b73d4..fee7038c 100755 --- a/mods/throwing/torch_arrow.lua +++ b/mods/throwing/torch_arrow.lua @@ -18,7 +18,7 @@ minetest.register_node("throwing:arrow_torch_box", { {7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17}, {7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17}, {6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17}, - + {7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17}, {8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17}, {8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17}, diff --git a/mods/treasurer/init.lua b/mods/treasurer/init.lua index 37b37b1f..908a9358 100755 --- a/mods/treasurer/init.lua +++ b/mods/treasurer/init.lua @@ -1,11 +1,11 @@ ---[==[ +--[==[ Treasurer - A mod for Minetest version 0.2.0 ]==] --[=[ - TABLE OF CONTENTS + TABLE OF CONTENTS part 1: Initialization part 2: Treasure API part 3: Treasure spawning mod handling @@ -60,7 +60,7 @@ format of prob_func function: --> returns a random or pseudorandom number between 0 (inclusive) and 1 (exclusive) prob_func is entirely optional, if it’s not used, treasurer will default to math.random. You can use prob_func to define your own random function, in case you don’t like an even - distribution + distribution format of treasurer_groups: This is just a table of strings, each string stands for a group name. @@ -105,7 +105,7 @@ function treasurer.register_treasure(name, rarity, preciousness, count, wear, tr return false end else - minetest.log("error","[treasurer] I rejected the treasure \""..tostring(name).."\" because it had an illegal type of rarity. Given type was \""..type(rarity).."\".") + minetest.log("error","[treasurer] I rejected the treasure \""..tostring(name).."\" because it had an illegal type of rarity. Given type was \""..type(rarity).."\".") return false end @@ -117,7 +117,7 @@ function treasurer.register_treasure(name, rarity, preciousness, count, wear, tr return false end else - minetest.log("error","[treasurer] I rejected the treasure \""..tostring(name).."\" because it had an illegal type of preciousness. Given type was \""..type(preciousness).."\".") + minetest.log("error","[treasurer] I rejected the treasure \""..tostring(name).."\" because it had an illegal type of preciousness. Given type was \""..type(preciousness).."\".") return false end @@ -184,7 +184,7 @@ function treasurer.register_treasure(name, rarity, preciousness, count, wear, tr treasurer.groups.treasurer[treasurer_groups] = {} end table.insert(treasurer.groups.treasurer[treasurer_groups], treasure) - elseif(type(treasurer_groups) == "table") then + elseif(type(treasurer_groups) == "table") then for i=1,#treasurer_groups do -- assign to Treasurer group (create table if it does not exist yet) if(treasurer.groups.treasurer[treasurer_groups[i]] == nil) then @@ -211,7 +211,7 @@ end min_preciousness: (optional) don’t consider treasures with a lower preciousness. nil = no lower limit max_preciousness: (optional) don’t consider treasures with a higher preciousness. nil = no lower limit treasurer_groups: (optional): Only consider treasures which are members of at least one of the members of the provided Treasurer group table. nil = consider all groups - returns: + returns: a table of ItemStacks (the requested treasures) - may be empty on error, it returns false ]] @@ -232,7 +232,7 @@ function treasurer.select_random_treasures(count, min_preciousness, max_precious for i=1,#treasurer.treasures do table.insert(p_treasures, treasurer.treasures[i]) end - + -- if the group filter IS used, copy only the treasures from the said groups elseif(type(treasurer_groups) == "string") then if(treasurer.groups.treasurer[treasurer_groups] ~= nil) then diff --git a/mods/trm_pyramids/more_trms.lua b/mods/trm_pyramids/more_trms.lua index 680d7619..9855d4f7 100755 --- a/mods/trm_pyramids/more_trms.lua +++ b/mods/trm_pyramids/more_trms.lua @@ -172,11 +172,11 @@ treasurer.register_treasure("moreblocks:iron_check", 0.05, 5, {1,2}, nil, deco) treasurer.register_treasure("stained_glass:2_9", 0.05, 6, {2,4}, nil, deco) --common treasurer.register_treasure("stained_glass:7_5_6", 0.05, 6, {2,4}, nil, deco) --common --- "light" group -- +-- "light" group -- -- preciousness = material/craft cost and light value -- total loot chance = 0.85 treasurer.register_treasure("moreblocks:super_glow_glass", 0.005, 10, {1,2}, nil, light) --rare -treasurer.register_treasure("moreblocks:glow_glass", 0.005, 9, {3,5}, nil, light) --rare +treasurer.register_treasure("moreblocks:glow_glass", 0.005, 9, {3,5}, nil, light) --rare treasurer.register_treasure("glow:lamp", 0.01, 7, {1,3}, nil, light) --uncommun treasurer.register_treasure("glow:stone", 0.01, 7, {1,3}, nil, light) --uncommun treasurer.register_treasure("bobblocks:blueblock", 0.02, 6, {1,3}, nil, light) --uncommun @@ -226,7 +226,7 @@ treasurer.register_treasure("homedecor:candle", 0.02, 3, {1,5}, nil, light) treasurer.register_treasure("lantern:candle", 0.02, 3, {1,5}, nil, light) --commun treasurer.register_treasure("christmas_craft:christmas_lights", 0.02, 2, {4,8}, nil, light) --commun --- "building_block" group -- +-- "building_block" group -- -- preciousness = material/craft cost -- total loot chance = 0.7525 treasurer.register_treasure("nether:white", 0.0025, 10, 1, nil, building_block) --rare --siwtonic bloc diff --git a/mods/tsm_pyramids/init.lua b/mods/tsm_pyramids/init.lua index e25b322d..2634854b 100755 --- a/mods/tsm_pyramids/init.lua +++ b/mods/tsm_pyramids/init.lua @@ -104,7 +104,7 @@ local function make(pos) local n = minetest.get_node({x=pos.x+ix,y=pos.y+iy+yy,z=pos.z+iz}) if n and n.name and n.name == "default:desert_stone" then minetest.set_node({x=pos.x+ix,y=pos.y+iy+yy,z=pos.z+iz},{name="default:desert_sand"}) end end - end + end end end @@ -144,7 +144,7 @@ minetest.register_on_generated(function(minp, maxp, seed) local perlin1 = minetest.env:get_perlin(perl1.SEED1, perl1.OCTA1, perl1.PERS1, perl1.SCAL1) local noise1 = perlin1:get2d({x=minp.x,y=minp.y})--,z=minp.z}) - + if noise1 > 0.25 or noise1 < -0.26 then local mpos = {x=math.random(minp.x,maxp.x), y=math.random(minp.y,maxp.y), z=math.random(minp.z,maxp.z)} @@ -152,7 +152,7 @@ minetest.register_on_generated(function(minp, maxp, seed) while p2 == nil and cnt < 5 do cnt = cnt+1 mpos = {x=math.random(minp.x,maxp.x), y=math.random(minp.y,maxp.y), z=math.random(minp.z,maxp.z)} - p2 = minetest.find_node_near(mpos, 25, {"default:desert_sand"}) + p2 = minetest.find_node_near(mpos, 25, {"default:desert_sand"}) end if p2 == nil then return end if p2.y < 0 then return end @@ -176,8 +176,8 @@ minetest.register_on_generated(function(minp, maxp, seed) p2.y = p2.y - 3 if p2.y < 0 then p2.y = 0 end if minetest.find_node_near(p2, 25, {"default:water_source"}) ~= nil or minetest.find_node_near(p2, 22, {"default:dirt_with_grass"}) ~= nil or minetest.find_node_near(p2, 52, {"maptools:sandstone_brick"}) ~= nil then return end - - if math.random(0,10) > 7 then return end + + if math.random(0,10) > 7 then return end minetest.after(0.8,make,p2) end end) diff --git a/mods/tsm_pyramids/mummy.lua b/mods/tsm_pyramids/mummy.lua index 0ca41a66..a6367a66 100755 --- a/mods/tsm_pyramids/mummy.lua +++ b/mods/tsm_pyramids/mummy.lua @@ -76,7 +76,7 @@ if not minetest.setting_getbool("only_peaceful_mobs") then if player_near then if mobs < 6 then pos.x = pos.x+1 - local p = minetest.find_node_near(pos, 5, {"air"}) + local p = minetest.find_node_near(pos, 5, {"air"}) minetest.add_entity(p,"tsm_pyramids:mummy") end end @@ -104,9 +104,9 @@ minetest.register_node("tsm_pyramids:spawner_mummy", { end, on_destruct = function(pos) for _,obj in ipairs(minetest.env:get_objects_inside_radius(pos, 1)) do - if not obj:is_player() then + if not obj:is_player() then if obj ~= nil and obj:get_luaentity().m_name == "dummy" then - obj:remove() + obj:remove() end end end diff --git a/mods/unified_inventory/internal.lua b/mods/unified_inventory/internal.lua index ae6aa32f..713b983d 100755 --- a/mods/unified_inventory/internal.lua +++ b/mods/unified_inventory/internal.lua @@ -67,7 +67,7 @@ function unified_inventory.get_formspec(player, page) -- Controls to flip items pages local start_x = 9.2 - formspec = formspec + formspec = formspec .. "image_button[" .. (start_x + 0.6 * 0) .. ",9;.8,.8;ui_skip_backward_icon.png;start_list;]" .. "tooltip[start_list;" .. minetest.formspec_escape(S("First page")) .. "]" diff --git a/mods/unified_inventory/item_names.lua b/mods/unified_inventory/item_names.lua index 2c92d65c..31af81bc 100755 --- a/mods/unified_inventory/item_names.lua +++ b/mods/unified_inventory/item_names.lua @@ -8,7 +8,7 @@ local air_hud_mod = minetest.get_modpath("4air") local hud_mod = minetest.get_modpath("hud") local function set_hud(player) - local player_name = player:get_player_name() + local player_name = player:get_player_name() local off = {x=0, y=-70} if air_hud_mod or hud_mod then off.y = off.y - 20 @@ -42,7 +42,7 @@ minetest.register_globalstep(function(dtime) if wstack ~= wield[player_name] then wield[player_name] = wstack dtimes[player_name] = 0 - if huds[player_name] then + if huds[player_name] then local def = minetest.registered_items[wstack] local desc = def and def.description or "" player:hud_change(huds[player_name], 'text', desc) diff --git a/mods/vector_extras/init.lua b/mods/vector_extras/init.lua index 86a6b729..03b11756 100755 --- a/mods/vector_extras/init.lua +++ b/mods/vector_extras/init.lua @@ -290,7 +290,7 @@ function vector.explosion_table(r) for x=-r,r do for y=-r,r do for z=-r,r do - local rc = x*x+y*y+z*z + local rc = x*x+y*y+z*z if rc <= tmp then local np={x=x, y=y, z=z} if math.floor(math.sqrt(rc) +0.5) > r-1 then diff --git a/mods/vector_extras/vector_meta.lua b/mods/vector_extras/vector_meta.lua index d9606cd1..b4ed291e 100755 --- a/mods/vector_extras/vector_meta.lua +++ b/mods/vector_extras/vector_meta.lua @@ -3,12 +3,12 @@ vector.meta.nodes = {} vector.meta.nodes_file = { load = function() - local nodesfile = io.open(minetest.get_worldpath()..'/vector_nodes.txt', "r") + local nodesfile = io.open(minetest.get_worldpath()..'/vector_nodes.txt', "r") if nodesfile then local contents = nodesfile:read('*all') io.close(nodesfile) - if contents ~= nil then - local lines = string.split(contents, "\n") + if contents ~= nil then + local lines = string.split(contents, "\n") for _,entry in ipairs(lines) do local name, px, py, pz, meta = unpack(string.split(entry, "°")) vector.meta.set_node({x=px, y=py, z=pz}, name, meta) diff --git a/other_things/irc-old-save/botcmds.lua b/other_things/irc-old-save/botcmds.lua index 34978a87..44077407 100755 --- a/other_things/irc-old-save/botcmds.lua +++ b/other_things/irc-old-save/botcmds.lua @@ -46,13 +46,13 @@ function irc:bot_command(msg, text) cmd = text args = "" end - + if not self.bot_commands[cmd] then self:reply("Unknown command '"..cmd.."'. Try 'list'." .." Or use @playername to send a private message") return end - + local success, message = self.bot_commands[cmd].func(msg.user, args) if message then self:reply(message) diff --git a/other_things/irc-old-save/player_part.lua b/other_things/irc-old-save/player_part.lua index d39d2abd..c9916c40 100755 --- a/other_things/irc-old-save/player_part.lua +++ b/other_things/irc-old-save/player_part.lua @@ -10,7 +10,7 @@ function irc:player_part(name) self.joined_players[name] = nil minetest.chat_send_player(name, "IRC: You are now out of the channel.") end - + function irc:player_join(name) if self.joined_players[name] then minetest.chat_send_player(name, "IRC: You are already in the channel.") @@ -28,7 +28,7 @@ minetest.register_chatcommand("join", { irc:player_join(name) end }) - + minetest.register_chatcommand("part", { description = "Part the IRC channel", privs = {shout=true}, @@ -36,7 +36,7 @@ minetest.register_chatcommand("part", { irc:player_part(name) end }) - + minetest.register_chatcommand("who", { description = "Tell who is currently on the channel", privs = {}, @@ -49,13 +49,13 @@ minetest.register_chatcommand("who", { end }) - + minetest.register_on_joinplayer(function(player) local name = player:get_player_name() irc.joined_players[name] = irc.config.auto_join end) - - + + minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() irc.joined_players[name] = nil