From 26cb4ff6ae407aa6c21f0e46b59694d88af6f68f Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Sun, 9 Nov 2014 21:28:11 +0100 Subject: [PATCH] Reverting minetest.env: calls - Last minetest.env: calls removed - IRC rules' table moves into a list --- mods/_misc/chatcommands.lua | 8 +++--- mods/_misc/irc.lua | 39 ++++++++++++++++-------------- mods/builtin_falling/func.lua | 12 ++++----- mods/builtin_falling/rewirting.lua | 12 ++++----- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/mods/_misc/chatcommands.lua b/mods/_misc/chatcommands.lua index e0437838..33847095 100644 --- a/mods/_misc/chatcommands.lua +++ b/mods/_misc/chatcommands.lua @@ -84,7 +84,7 @@ minetest.register_chatcommand("ban", { -- description = "Teleport to the spawn location.", -- privs = {shout=true}, -- func = function(name, param) --- local player = minetest.env:get_player_by_name(name) +-- local player = minetest.get_player_by_name(name) -- minetest.chat_send_player(name, "Teleported to spawn!") -- player:setpos({x=0.0, y=5.0, z=0.0}) -- return true @@ -97,7 +97,7 @@ minetest.register_chatcommand("sethome", { description = "Set your home location.", privs = {shout=true}, func = function(name, param) - player = minetest.env:get_player_by_name(name) + player = minetest.get_player_by_name(name) test = player:getpos() local file = io.open(minetest.get_worldpath().."/home/"..player:get_player_name().."_home", "w") if not file then @@ -116,7 +116,7 @@ minetest.register_chatcommand("home", { description = "Vous teleporte a l'emplacement de votre 'home'.", privs = {shout=true}, func = function(name, param) - player = minetest.env:get_player_by_name(name) + player = minetest.get_player_by_name(name) local file = io.open(minetest.get_worldpath().."/home/"..player:get_player_name().."_home", "r") if not file then minetest.chat_send_player(name, "Vous devez definir votre emplacement 'home' ! Pour ce faire, utilisez la commande /sethome.") @@ -129,7 +129,7 @@ minetest.register_chatcommand("home", { minetest.chat_send_player(name, "Il y a eut une erreur, s'il vous plait contactez le detenteur du serveur.") return end - minetest.env:get_player_by_name(name):setpos(pos) + minetest.get_player_by_name(name):setpos(pos) minetest.chat_send_player(name, "Vous voilŕ chez vous.") end }) diff --git a/mods/_misc/irc.lua b/mods/_misc/irc.lua index 37c994e3..cec3bd99 100644 --- a/mods/_misc/irc.lua +++ b/mods/_misc/irc.lua @@ -15,24 +15,27 @@ local IRC = [[ 7) Il ne sera tolĂ©rĂ© aucun type de discrimination contre quelque participant que ce soit, ni aucune forme d'insulte envers les opĂ©rateurs, semi-opĂ©rateurs et administrateurs d'InchraNet. Voici les sanctions prĂ©vues pour les infractions aux règles ci-dessus. -+-----------------------+-----------------------------------+---------------------------------------+ -| Niveau d'infraction : | Infraction(s) commise(s) : | Sanctions appliquĂ©es : | -| | Manque de respect enver autrui | Devoice une demi-journĂ©e | -| Niveau DIRT | Provocation envers autrui | Devoie une journĂ©e | -| | Insultes envers autrui | Kick + devoice une journĂ©e | -+-----------------------+-----------------------------------+---------------------------------------+ -| | RĂ©cidive d'infraction niveau dirt | Kick + Ban 1/2 journĂ©e | -| Niveau STONE | Flood, Discrimination | Kick + devoice deux heures | -| | Spam | Kick + devoice 1 jour + ban 1/2 journĂ©e | -+-----------------------+-----------------------------------+---------------------------------------+ -| | RĂ©cidive d'infraction niveau stone | Kick + Ban 4 jours + devoice 5 jours | -| Niveau MESE | Contenu Ă  caractère sexuel | Kick + Ban 1 semaine + devoice 5 jours | -| | Irrespect envers l'Ă©quipe | Kick + Ban 10 jours + devoice 8 jours | -+-----------------------+-----------------------------------+---------------------------------------+ -| | RĂ©cidive d'infraction niveau mese | Kick + Ban 1 mois + devoice 2 semaines | -| Niveau OBSIDIAN | Violation des lois en vigueur | Kick + Ban dĂ©finitif + Gline | -| | Violation des règles d'InchraNet | Kick + Ban dĂ©finitif + Gline | -+-----------------------+-----------------------------------+---------------------------------------+ + +- 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 : + - 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 + +- Infraction niveau OBSIDIAN : + - 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/builtin_falling/func.lua b/mods/builtin_falling/func.lua index 7a9944cc..478d2745 100644 --- a/mods/builtin_falling/func.lua +++ b/mods/builtin_falling/func.lua @@ -127,8 +127,8 @@ function add_falling_protect_item(named) if minetest.is_protected(pointed_thing.above, pn) then return itemstack end - minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()}) - local meta = minetest.env:get_meta(pointed_thing.above) + minetest.add_node(pointed_thing.above, {name=itemstack:get_name()}) + local meta = minetest.get_meta(pointed_thing.above) meta:set_string("owner", pn) nodeupdate(pointed_thing.above) if not minetest.setting_getbool("creative_mode") then @@ -169,7 +169,7 @@ function add_protected_bukket_liquid(nameofbukket,liquidsourcename) return end -- Check if pointing to a buildable node - n = minetest.env:get_node(pointed_thing.under) + n = minetest.get_node(pointed_thing.under) if is_protected_area(pointed_thing.under, 7 ,user:get_player_name()) then minetest.chat_send_player(user:get_player_name(),"You cant place here - Too short of a protected area.") @@ -182,14 +182,14 @@ function add_protected_bukket_liquid(nameofbukket,liquidsourcename) 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)) - minetest.env:add_node(pointed_thing.under, {name=liquidsourcename}) + minetest.add_node(pointed_thing.under, {name=liquidsourcename}) else -- not buildable to; place the liquid above -- check if the node above can be replaced - n = minetest.env:get_node(pointed_thing.above) + n = minetest.get_node(pointed_thing.above) if minetest.registered_nodes[n.name].buildable_to then minetest.log("action", user:get_player_name().. " use "..nameofbukket.." at ".. minetest.pos_to_string(pointed_thing.above)) - minetest.env:add_node(pointed_thing.above, {name=liquidsourcename}) + minetest.add_node(pointed_thing.above, {name=liquidsourcename}) else -- do not remove the bucket with the liquid return diff --git a/mods/builtin_falling/rewirting.lua b/mods/builtin_falling/rewirting.lua index 730bb86f..5033c1e4 100644 --- a/mods/builtin_falling/rewirting.lua +++ b/mods/builtin_falling/rewirting.lua @@ -143,8 +143,8 @@ minetest.override_item("default:lava_source", { if minetest.is_protected(pointed_thing.above, pn) then return itemstack end - minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()}) - local meta = minetest.env:get_meta(pointed_thing.above) + minetest.add_node(pointed_thing.above, {name=itemstack:get_name()}) + local meta = minetest.get_meta(pointed_thing.above) meta:set_string("owner", pn) nodeupdate(pointed_thing.above) if not minetest.setting_getbool("creative_mode") then @@ -163,8 +163,8 @@ minetest.override_item("default:lava_flowing", { if minetest.is_protected(pointed_thing.above, pn) then return itemstack end - minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()}) - local meta = minetest.env:get_meta(pointed_thing.above) + minetest.add_node(pointed_thing.above, {name=itemstack:get_name()}) + local meta = minetest.get_meta(pointed_thing.above) meta:set_string("owner", pn) nodeupdate(pointed_thing.above) if not minetest.setting_getbool("creative_mode") then @@ -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.env: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.env: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