From 677d6af5728b5e0e76f4497aa294dca50e1262d3 Mon Sep 17 00:00:00 2001 From: DonBatman Date: Mon, 4 Apr 2016 15:08:37 -0700 Subject: [PATCH] Changed to modpack --- guest.lua | 16 -- init.lua | 37 ---- mod.conf | 1 - modpack.txt | 0 tools.lua => myadmintools/init.lua | 14 +- myadmintools/mod.conf | 1 + .../textures}/ultimate_tool.png | Bin .../textures}/ultimate_tool2.png | Bin mybadnames/init.lua | 25 +++ mybadnames/mod.conf | 1 + chat.lua => mychats/init.lua | 14 ++ mychats/mod.conf | 1 + curse.lua => mycursing/init.lua | 40 ++-- mycursing/mod.conf | 1 + extras.lua => myextras/init.lua | 2 +- myextras/mod.conf | 1 + privs.lua => myprivs/init.lua | 24 +-- myprivs/mod.conf | 1 + spawn.lua => myspawn/init.lua | 51 ++--- myspawn/mod.conf | 1 + start.lua => mystart/init.lua | 7 +- mystart/mod.conf | 1 + rules.txt => mystart/rules.txt | 0 .../rules.txt.example | 0 npip.lua | 116 ----------- settings.txt.example | 52 ----- underworld.lua | 196 ------------------ 27 files changed, 110 insertions(+), 493 deletions(-) delete mode 100644 guest.lua delete mode 100644 init.lua delete mode 100644 mod.conf create mode 100644 modpack.txt rename tools.lua => myadmintools/init.lua (81%) create mode 100644 myadmintools/mod.conf rename {textures => myadmintools/textures}/ultimate_tool.png (100%) rename {textures => myadmintools/textures}/ultimate_tool2.png (100%) create mode 100644 mybadnames/init.lua create mode 100644 mybadnames/mod.conf rename chat.lua => mychats/init.lua (99%) create mode 100644 mychats/mod.conf rename curse.lua => mycursing/init.lua (53%) create mode 100644 mycursing/mod.conf rename extras.lua => myextras/init.lua (90%) create mode 100644 myextras/mod.conf rename privs.lua => myprivs/init.lua (92%) create mode 100644 myprivs/mod.conf rename spawn.lua => myspawn/init.lua (70%) create mode 100644 myspawn/mod.conf rename start.lua => mystart/init.lua (86%) create mode 100644 mystart/mod.conf rename rules.txt => mystart/rules.txt (100%) rename rules.txt.example => mystart/rules.txt.example (100%) delete mode 100644 npip.lua delete mode 100644 settings.txt.example delete mode 100644 underworld.lua diff --git a/guest.lua b/guest.lua deleted file mode 100644 index c4e07e8..0000000 --- a/guest.lua +++ /dev/null @@ -1,16 +0,0 @@ -if myadmin.guest == true then -minetest.register_on_prejoinplayer(function(name, ip) - local n = string.find(string.lower(name),"guest") - if n ~= nil then - return "\nThe name Guest is not allowed\n\nPlease pick a Name." - end -end) -end - -if minetest.setting_getbool("disallow_empty_password") == false or nil and - myadmin.require_password == true then - minetest.setting_setbool("disallow_empty_password", true) -elseif minetest.setting_getbool("disallow_empty_password") == true or nil and - myadmin.require_password == false then - minetest.setting_setbool("disallow_empty_password", false) -end diff --git a/init.lua b/init.lua deleted file mode 100644 index 6d71532..0000000 --- a/init.lua +++ /dev/null @@ -1,37 +0,0 @@ -local modpath = minetest.get_modpath("myadmin") -local input = io.open(modpath.."/settings.txt", "r") - -myadmin = {} - -if input then - - dofile(modpath.."/settings.txt") - input:close() - - -end - - -dofile(minetest.get_modpath("myadmin").."/tools.lua") -dofile(minetest.get_modpath("myadmin").."/spawn.lua") -dofile(minetest.get_modpath("myadmin").."/chat.lua") -dofile(minetest.get_modpath("myadmin").."/privs.lua") -dofile(minetest.get_modpath("myadmin").."/curse.lua") -dofile(minetest.get_modpath("myadmin").."/extras.lua") -dofile(minetest.get_modpath("myadmin").."/start.lua") -dofile(minetest.get_modpath("myadmin").."/underworld.lua") - -if myadmin.guest then - dofile(minetest.get_modpath("myadmin").."/guest.lua") -end - -if myadmin.names_per_ip then - dofile(minetest.get_modpath("myadmin").."/npip.lua") -end - -minetest.register_on_joinplayer(function(player) - minetest.after(5,function() - minetest.chat_send_player(player:get_player_name(), "Welcome "..player:get_player_name().."!") - end) -end) - diff --git a/mod.conf b/mod.conf deleted file mode 100644 index af8686d..0000000 --- a/mod.conf +++ /dev/null @@ -1 +0,0 @@ -name = myadmin diff --git a/modpack.txt b/modpack.txt new file mode 100644 index 0000000..e69de29 diff --git a/tools.lua b/myadmintools/init.lua similarity index 81% rename from tools.lua rename to myadmintools/init.lua index ad6d7cf..886a5d6 100644 --- a/tools.lua +++ b/myadmintools/init.lua @@ -1,8 +1,8 @@ -minetest.register_alias("ut", "myadmin:ultimate_tool") -minetest.register_alias("utd", "myadmin:ultimate_tool_drop") +minetest.register_alias("ut", "myadmintools:ultimate_tool") +minetest.register_alias("utd", "myadmintools:ultimate_tool_drop") -minetest.register_tool("myadmin:ultimate_tool", { +minetest.register_tool("myadmintools:ultimate_tool", { description = "Ultimate Tool", inventory_image = "ultimate_tool.png", groups = {not_in_creative_inventory=1}, @@ -22,7 +22,7 @@ minetest.register_tool("myadmin:ultimate_tool", { on_drop = function(itemstack, dropper, pos) end }) -minetest.register_tool("myadmin:ultimate_tool_drop", { +minetest.register_tool("myadmintools:ultimate_tool_drop", { description = "Ultimate Tool With Drops", inventory_image = "ultimate_tool2.png", groups = {not_in_creative_inventory=1}, @@ -45,14 +45,14 @@ minetest.register_tool("myadmin:ultimate_tool_drop", { minetest.register_on_punchnode(function(pos, node, puncher) local n = node - if puncher:get_wielded_item():get_name() == "myadmin:ultimate_tool" + if puncher:get_wielded_item():get_name() == "myadmintools:ultimate_tool" and minetest.get_node(pos).name ~= "air" and minetest.get_player_privs(puncher:get_player_name()).myadmin_levels_super == true then minetest.remove_node(pos) end - if puncher:get_wielded_item():get_name() == "myadmin:ultimate_tool" - or puncher:get_wielded_item():get_name() == "myadmin:ultimate_tool_drop" + if puncher:get_wielded_item():get_name() == "myadmintools:ultimate_tool" + or puncher:get_wielded_item():get_name() == "myadmintools:ultimate_tool_drop" and minetest.get_node(pos).name ~= "air" then if minetest.get_player_privs(puncher:get_player_name()).myadmin_levels_super ~= true then minetest.chat_send_player(puncher:get_player_name(), "You don't have the priv for this tool") diff --git a/myadmintools/mod.conf b/myadmintools/mod.conf new file mode 100644 index 0000000..8c17a51 --- /dev/null +++ b/myadmintools/mod.conf @@ -0,0 +1 @@ +name = myadmintools diff --git a/textures/ultimate_tool.png b/myadmintools/textures/ultimate_tool.png similarity index 100% rename from textures/ultimate_tool.png rename to myadmintools/textures/ultimate_tool.png diff --git a/textures/ultimate_tool2.png b/myadmintools/textures/ultimate_tool2.png similarity index 100% rename from textures/ultimate_tool2.png rename to myadmintools/textures/ultimate_tool2.png diff --git a/mybadnames/init.lua b/mybadnames/init.lua new file mode 100644 index 0000000..61560ca --- /dev/null +++ b/mybadnames/init.lua @@ -0,0 +1,25 @@ +local bad_names = { + "fuck", + "faggot", + "asshole", + "arsehole", + "cunt", + "retard", + "bitch", + "shit", + "bastard", + "nigger", + "nigga", + "guest" + } + +for _, nm in pairs(bad_names) do + +minetest.register_on_prejoinplayer(function(name, ip) + local n = string.find(string.lower(name),nm) + if n ~= nil then + return "\nThe name .."..name.." is not allowed\n\nPlease pick a different Name." + end +end) + +end diff --git a/mybadnames/mod.conf b/mybadnames/mod.conf new file mode 100644 index 0000000..3e39175 --- /dev/null +++ b/mybadnames/mod.conf @@ -0,0 +1 @@ +name = mybadnames diff --git a/chat.lua b/mychats/init.lua similarity index 99% rename from chat.lua rename to mychats/init.lua index 5194d93..bf03456 100644 --- a/chat.lua +++ b/mychats/init.lua @@ -6,6 +6,7 @@ minetest.register_chatcommand("chats", { return true end, }) + minetest.register_chatcommand("afk", { privs = {shout = true}, func = function(name, param) @@ -13,6 +14,7 @@ minetest.register_chatcommand("afk", { return true end, }) + minetest.register_chatcommand("back", { privs = {shout = true}, func = function(name, param) @@ -20,6 +22,7 @@ minetest.register_chatcommand("back", { return true end, }) + minetest.register_chatcommand("gtg", { privs = {shout = true}, func = function(name, param) @@ -27,6 +30,7 @@ minetest.register_chatcommand("gtg", { return true end, }) + minetest.register_chatcommand("bbl", { privs = {shout = true}, func = function(name, param) @@ -34,6 +38,7 @@ minetest.register_chatcommand("bbl", { return true end, }) + minetest.register_chatcommand("lol", { privs = {shout = true}, func = function(name, param) @@ -41,6 +46,7 @@ minetest.register_chatcommand("lol", { return true end, }) + minetest.register_chatcommand("happy", { privs = {shout = true}, func = function(name, param) @@ -48,6 +54,7 @@ minetest.register_chatcommand("happy", { return true end, }) + minetest.register_chatcommand("sad", { privs = {shout = true}, func = function(name, param) @@ -55,6 +62,7 @@ minetest.register_chatcommand("sad", { return true end, }) + minetest.register_chatcommand("surprised", { privs = {shout = true}, func = function(name, param) @@ -62,6 +70,7 @@ minetest.register_chatcommand("surprised", { return true end, }) + minetest.register_chatcommand("mad", { privs = {shout = true}, func = function(name, param) @@ -77,6 +86,7 @@ minetest.register_chatcommand("here", { return true end, }) + minetest.register_chatcommand("there", { privs = {shout = true}, func = function(name, param) @@ -84,6 +94,7 @@ minetest.register_chatcommand("there", { return true end, }) + minetest.register_chatcommand("funny", { privs = {shout = true}, func = function(name, param) @@ -91,6 +102,7 @@ minetest.register_chatcommand("funny", { return true end, }) + minetest.register_chatcommand("crazy", { privs = {shout = true}, func = function(name, param) @@ -98,6 +110,7 @@ minetest.register_chatcommand("crazy", { return true end, }) + minetest.register_chatcommand("hurt", { privs = {shout = true}, func = function(name, param) @@ -105,6 +118,7 @@ minetest.register_chatcommand("hurt", { return true end, }) + minetest.register_chatcommand("mining", { privs = {shout = true}, func = function(name, param) diff --git a/mychats/mod.conf b/mychats/mod.conf new file mode 100644 index 0000000..ab0cf9f --- /dev/null +++ b/mychats/mod.conf @@ -0,0 +1 @@ +name = mychats diff --git a/curse.lua b/mycursing/init.lua similarity index 53% rename from curse.lua rename to mycursing/init.lua index 5801526..359cda4 100644 --- a/curse.lua +++ b/mycursing/init.lua @@ -1,30 +1,28 @@ - local bad_words = myadmin.bad_words - if bad_words == nil then - bad_words = { -"fuck", -"faggot", -"fag", -"gay", -"asshole", -"arsehole", -"dick", -"cunt", -"wtf", -"retard", -"bitch", -"shit", -"bastard", -"nigger", -"nigga" -} -end +local bad_words = { + "fuck", + "faggot", + "fag", + "gay", + "asshole", + "arsehole", + "dick", + "cunt", + "wtf", + "retard", + "bitch", + "shit", + "bastard", + "nigger", + "nigga" + } + minetest.register_on_chat_message(function(name, message) if not message then return end local msg = message:lower() for _, word in pairs(bad_words) do if msg:find(word) then minetest.kick_player(name, "( ** WATCH YOUR LANGUAGE ** )") - return + return message end end end) diff --git a/mycursing/mod.conf b/mycursing/mod.conf new file mode 100644 index 0000000..073e407 --- /dev/null +++ b/mycursing/mod.conf @@ -0,0 +1 @@ +name = mycursing diff --git a/extras.lua b/myextras/init.lua similarity index 90% rename from extras.lua rename to myextras/init.lua index f894aa8..927205c 100644 --- a/extras.lua +++ b/myextras/init.lua @@ -1,4 +1,4 @@ -minetest.register_privilege("myadmin_extras", "Need to use the extras") +minetest.register_privilege("myextras", "Need to use the extras") minetest.register_chatcommand("setbar", { params = "", diff --git a/myextras/mod.conf b/myextras/mod.conf new file mode 100644 index 0000000..26db0e0 --- /dev/null +++ b/myextras/mod.conf @@ -0,0 +1 @@ +name = myextras diff --git a/privs.lua b/myprivs/init.lua similarity index 92% rename from privs.lua rename to myprivs/init.lua index 3d24c41..80daace 100644 --- a/privs.lua +++ b/myprivs/init.lua @@ -1,8 +1,8 @@ -minetest.register_privilege("myadmin_levels", "Lets person set level of privlege people have") -minetest.register_privilege("myadmin_levels_super", "Lets person set level of privlege people have plus the super level") +minetest.register_privilege("myprivs_levels", "Lets person set level of privlege people have") +minetest.register_privilege("myprivs_levels_super", "Lets person set level of privlege people have plus the super level") -minetest.register_chatcommand("myadmin_commands", { +minetest.register_chatcommand("myprivs_commands", { privs = {myadmin_levels = true}, func = function(name, param) minetest.chat_send_player(name,"Available commands - /admin, /mod, /helper, /norm, /punish, /unpunish, silence, /ghost") @@ -13,7 +13,7 @@ minetest.register_chatcommand("myadmin_commands", { minetest.register_chatcommand("super_admin", { params = "", description = "Super Administrator", - privs={myadmin_levels_super=true}, + privs={myprivs_levels_super=true}, func = function(name, param) if minetest.get_player_by_name(param) then minetest.set_player_privs(param, {}) @@ -43,7 +43,7 @@ end}) minetest.register_chatcommand("admin", { params = "", description = "Administrator", - privs={myadmin_levels=true}, + privs={myprivs_levels=true}, func = function(name, param) if minetest.get_player_by_name(param) then minetest.set_player_privs(param, {}) @@ -71,7 +71,7 @@ end}) minetest.register_chatcommand("mod", { params = "", description = "Moderator", - privs={myadmin_levels=true}, + privs={myprivs_levels=true}, func = function(name, param) if minetest.get_player_by_name(param) then minetest.set_player_privs(param, {}) @@ -94,7 +94,7 @@ end}) minetest.register_chatcommand("helper", { params = "", description = "Helper", - privs={myadmin_levels=true}, + privs={myprivs_levels=true}, func = function(name, param) if minetest.get_player_by_name(param) then minetest.set_player_privs(param, {}) @@ -115,7 +115,7 @@ end}) minetest.register_chatcommand("norm", { params = "", description = "Normal Player", - privs={myadmin_levels=true}, + privs={myprivs_levels=true}, func = function(name, param) if minetest.get_player_by_name(param) then minetest.set_player_privs(param, {}) @@ -134,7 +134,7 @@ end}) minetest.register_chatcommand("unpunish", { params = "", description = "Unpunish Player", - privs={myadmin_levels=true}, + privs={myprivs_levels=true}, func = function(name, param) if minetest.get_player_by_name(param) then minetest.set_player_privs(param, {}) @@ -153,7 +153,7 @@ end}) minetest.register_chatcommand("punish", { params = "", description = "Punish Player", - privs={myadmin_levels=true}, + privs={myprivs_levels=true}, func = function(name, param) if minetest.get_player_by_name(param) then minetest.set_player_privs(param, {}) @@ -169,7 +169,7 @@ end}) minetest.register_chatcommand("silence", { params = "", description = "Silence Player", - privs={myadmin_levels=true}, + privs={myprivs_levels=true}, func = function(name, param) if minetest.get_player_by_name(param) then minetest.set_player_privs(param, {}) @@ -187,7 +187,7 @@ end}) minetest.register_chatcommand("ghost", { params = "", description = "Remove all privs", - privs={myadmin_levels=true}, + privs={myprivs_levels=true}, func = function(name, param) if minetest.get_player_by_name(param) then minetest.set_player_privs(param, {}) diff --git a/myprivs/mod.conf b/myprivs/mod.conf new file mode 100644 index 0000000..e4652f9 --- /dev/null +++ b/myprivs/mod.conf @@ -0,0 +1 @@ +name = myprivs diff --git a/spawn.lua b/myspawn/init.lua similarity index 70% rename from spawn.lua rename to myspawn/init.lua index fe06932..2b7e232 100644 --- a/spawn.lua +++ b/myspawn/init.lua @@ -1,35 +1,28 @@ -if myadmin.spawn1_name then - if myadmin.spawn1_name ~= false then - s1n = myadmin.spawn1_name - s1 = myadmin.spawn1 - end +-- If not using then set the name to nil - if myadmin.spawn2_name ~= false then - s2n = myadmin.spawn2_name - s2 = myadmin.spawn2 - end +-- Spawn 1 +local s1n = "spawn1" +local s1 = {x = 0, y = 0, z = 0} - if myadmin.spawn3_name ~= false then - s3n = myadmin.spawn3_name - s3 = myadmin.spawn3 - end +-- Spawn 2 +local s2n = "spawn2" +local s2 = {x = 0, y = 0, z = 0} - if myadmin.spawn4_name ~= false then - s4n = myadmin.spawn4_name - s4 = myadmin.spawn4 - end +--Spawn 3 +local s3n = "spawn3" +local s3 = {x = 0, y = 0, z = 0} - if myadmin.spawn5_name ~= false then - s5n = myadmin.spawn5_name - s5 = myadmin.spawn5 - end -else - return -end +-- Spawn 4 +local s4n = nil +local s4 = {x = 0, y = 0, z = 0} +-- Spawn 5 +local s5n = nil +local s5 = {x = 0, y = 0, z = 0} +-- Nothing to change past here minetest.register_on_chat_message(function(name, message, playername, player) - if s1n ~= false then + if s1n ~= nil then local cmd = "/"..s1n if message:sub(0, #cmd) == cmd then if message == '/'..s1n then @@ -41,7 +34,7 @@ minetest.register_on_chat_message(function(name, message, playername, player) end end - if s2n ~= false then + if s2n ~= nil then local cmd = "/"..s2n if message:sub(0, #cmd) == cmd then if message == '/'..s2n then @@ -53,7 +46,7 @@ minetest.register_on_chat_message(function(name, message, playername, player) end end - if s3n ~= false then + if s3n ~= nil then local cmd = "/"..s3n if message:sub(0, #cmd) == cmd then if message == '/'..s3n then @@ -65,7 +58,7 @@ minetest.register_on_chat_message(function(name, message, playername, player) end end - if s4n ~= false then + if s4n ~= nil then local cmd = "/"..s4n if message:sub(0, #cmd) == cmd then if message == '/'..s4n then @@ -77,7 +70,7 @@ minetest.register_on_chat_message(function(name, message, playername, player) end end - if s5n ~= false then + if s5n ~= nil then local cmd = "/"..s5n if message:sub(0, #cmd) == cmd then if message == '/'..s5n then diff --git a/myspawn/mod.conf b/myspawn/mod.conf new file mode 100644 index 0000000..81ec175 --- /dev/null +++ b/myspawn/mod.conf @@ -0,0 +1 @@ +name = myspawn diff --git a/start.lua b/mystart/init.lua similarity index 86% rename from start.lua rename to mystart/init.lua index dca4208..f68250e 100644 --- a/start.lua +++ b/mystart/init.lua @@ -1,11 +1,8 @@ -local servername = myadmin.server_name - if servername == nil then -local servername = "Our Server" - end +local servername = "Our Server" -local f = assert(io.open(minetest.get_modpath("myadmin").."/rules.txt", "r")) +local f = assert(io.open(minetest.get_modpath("mystart").."/rules.txt", "r")) local the_text = f:read("*all") f:close() diff --git a/mystart/mod.conf b/mystart/mod.conf new file mode 100644 index 0000000..80ccbdf --- /dev/null +++ b/mystart/mod.conf @@ -0,0 +1 @@ +name = mystart diff --git a/rules.txt b/mystart/rules.txt similarity index 100% rename from rules.txt rename to mystart/rules.txt diff --git a/rules.txt.example b/mystart/rules.txt.example similarity index 100% rename from rules.txt.example rename to mystart/rules.txt.example diff --git a/npip.lua b/npip.lua deleted file mode 100644 index 21e8b59..0000000 --- a/npip.lua +++ /dev/null @@ -1,116 +0,0 @@ --- Created by Krock to stop mass-account-creators --- License: DWYWPL - -ipnames = {} -ipnames.data = {} -ipnames.tmp_data = {} -ipnames.changes = false -ipnames.save_interval = 120 -ipnames.save_time = 0 -ipnames.file = minetest.get_worldpath().."/ipnames.txt" - -ipnames.name_per_ip_limit = myadmin.names_per_ip - --- Get accounts self: -minetest.register_chatcommand("whois", { - description = "Gets all players who have the same IP as the specified player", - privs = {kick = true}, - func = function(name, param) - if not ipnames.data[param] then - 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 - if v == ip then - if names ~= "" then - names = names .. ", " .. k - else - names = names .. " " .. k - end - end - end - minetest.chat_send_player(name, "Players for IP address " .. ip .. ": " .. names) - end, -}) - --- Get IP if player tries to join, ban if there are too much names per IP: -minetest.register_on_prejoinplayer(function(name, ip) - -- Only stop new accounts: - ipnames.tmp_data[name] = ip - if not ipnames.data[name] then - local count = 1 - local names = "" - for k, v in pairs(ipnames.data) do - if v == ip then - count = count + 1 - 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 - return ("\nYou exceeded the limit of accounts (" .. ipnames.name_per_ip_limit .. - ").\nYou already have the following accounts:\n" .. names) - end - end - end -end) - --- Save IP if player joined: -minetest.register_on_joinplayer(function(player) - local name = player:get_player_name() - ipnames.data[name] = ipnames.tmp_data[name] - ipnames.tmp_data[name] = nil - ipnames.changes = true -end) - -function ipnames.load_data() - local file = io.open(ipnames.file, "r") - if not file then - return - end - for line in file:lines() do - if line ~= "" then - local data = line:split("|") - if #data >= 2 then - ipnames.data[data[1]] = data[2] - end - end - end - io.close(file) -end - -function ipnames.save_data() - if not ipnames.changes then - return - end - ipnames.changes = false - local file = io.open(ipnames.file, "w") - for i, v in pairs(ipnames.data) do - if v ~= nil then - file:write(i .. "|" .. v .. "\n") - end - end - io.close(file) -end - -minetest.register_globalstep(function(t) - ipnames.save_time = ipnames.save_time + t - if ipnames.save_time < ipnames.save_interval then - return - end - ipnames.save_time = 0 - ipnames.save_data() -end) - -minetest.register_on_shutdown(function() ipnames.save_data() end) - -minetest.after(3, function() ipnames.load_data() end) diff --git a/settings.txt.example b/settings.txt.example deleted file mode 100644 index 1e2bf10..0000000 --- a/settings.txt.example +++ /dev/null @@ -1,52 +0,0 @@ - -myadmin.server_name = "My Server" - -myadmin.server_message = "Welcome to our server" - -myadmin.guest = true - -myadmin.names_per_ip = 5 - - --- spawn_name is the name you use in the chat commant --- If you are not using the spawn_name then set it to false - -myadmin.spawn1_name = "spawn" -myadmin.spawn1 = {x = 0, y = 0, z = 0} - -myadmin.spawn2_name = "spawn2" -myadmin.spawn2 = {x = 0, y = 0, z = 0} - -myadmin.spawn3_name = "spawn3" -myadmin.spawn3 = {x = 0, y = 0, z = 0} - -myadmin.spawn4_name = "spawn4" -myadmin.spawn4 = {x = 0, y = 0, z = 0} - -myadmin.spawn5_name = "spawn5" -myadmin.spawn5 = {x = 0, y = 0, z = 0} - - --- If the myadmin_extras priv setting is true then only people with the priv can use the extras - -myadmin.extras_priv = true - - - --- These are the curse words that are not allowed on the server - -myadmin.bad_words = { -"fuck", -"faggot", -"asshole", -"arsehole", -"dick", -"cunt", -"wtf", -"retard", -"bitch", -"shit", -"bastard", -"nigger", -"nigga" -} diff --git a/underworld.lua b/underworld.lua deleted file mode 100644 index 91f615e..0000000 --- a/underworld.lua +++ /dev/null @@ -1,196 +0,0 @@ ---[[ - -check for stone when placing underworld? - -set underworld teleporter and set meta - -make a schematic for underworld - -make lvm for schematic placement - -decide if this should be a seperate mod - - - ---]] -local tp = {} - -minetest.register_node("myadmin:underworld", { - description = "Underworld", - tiles = { - "default_sand.png^[colorize:#000000:255" - }, - drawtype = "nodebox", - paramtype = "light", - groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory = 1}, - node_box = { - type = "fixed", - fixed = { - {-0.5625, -0.5, 0.4375, -0.4375, 1.5, 0.5625}, - {0.4375, -0.5, 0.4375, 0.5625, 1.5, 0.5625}, - {0.4375, -0.5, -0.5625, 0.5625, 1.5, -0.4375}, - {-0.5625, -0.5, -0.5625, -0.4375, 1.5, -0.4375}, - {-0.5625, -0.5, -0.5625, 0.5625, -0.4375, 0.5625}, - {-0.5625, 1.4375, -0.5625, 0.5625, 1.5, 0.5625}, - } - }, - selection_box = { - type = "fixed", - fixed = { - {-0.5625, -0.5, 0.4375, -0.4375, 1.5, 0.5625}, - {0.4375, -0.5, 0.4375, 0.5625, 1.5, 0.5625}, - {0.4375, -0.5, -0.5625, 0.5625, 1.5, -0.4375}, - {-0.5625, -0.5, -0.5625, -0.4375, 1.5, -0.4375}, - {-0.5625, -0.5, -0.5625, 0.5625, -0.4375, 0.5625}, - {-0.5625, 1.4375, -0.5625, 0.5625, 1.5, 0.5625}, - } - }, - on_place = function(itemstack, placer, pointed_thing) - - if minetest.get_player_privs(placer:get_player_name()).myadmin_levels_super == true then - - local pos = pointed_thing.above - local top = { x = pos.x, y = pos.y + 1, z = pos.z } - - if top.name ~= air then - minetest.chat_send_player(placer, "Not enough room!") - return - end - - minetest.set_node(pos, {name = "myadmin:underworld"}) - minetest.set_node(top, {name = "myadmin:underworld_block"}) - - minetest.show_formspec(placer:get_player_name(),"fs", - "size[6,5;]".. - "field[1,1;4.5,1;name;Name;]".. - "field[2,2.5;2,1;depth;Depth;]".. - "button_exit[2,4;2,1;set;set]") - - minetest.register_on_player_receive_fields(function(player, fs, fields) - local meta = minetest.get_meta(pos) - local n = fields["name"] - local d = fields["depth"] - if tonumber(d) + pos.y > 15000 then - d = 15000 + pos.y - end - if tonumber(d) + pos.y < 3000 then - d = 3000 + pos.y - end - - if d == "" or - d == nil then - d = 5000 - end - - if fields["name"] or - fields["depth"] or - fields["set"] then - - if fields["name"] ~= "" and - fields["depth"] ~= "" then - - meta:set_string("name",n) - meta:set_string("infotext",n.." Top at "..d) - meta:set_string("depth",d) - meta:set_string("torb","top") - - minetest.forceload_block({x = pos.x, y = pos.y - tonumber(d), z = pos.z}) - - minetest.set_node({x = pos.x, y = pos.y - tonumber(d), z = pos.z}, {name = "myadmin:underworld"}) - minetest.set_node({x = pos.x, y = pos.y - tonumber(d) + 1, z = pos.z}, {name = "myadmin:underworld_block"}) - local dmeta = minetest.get_meta({x = pos.x, y = pos.y - tonumber(d), z = pos.z}) - dmeta:set_string("name",n.." Underworld") - dmeta:set_string("infotext",n.." Underworld at "..d) - dmeta:set_string("depth",d) - dmeta:set_string("torb","bottom") - end - end - end) - end - end, - on_dig = function(pos, node, player) - - if minetest.get_player_privs(player:get_player_name()).myadmin_levels_super == true then - - local meta = minetest.get_meta(pos) - local n = meta:get_string("torb") - local below = tonumber(meta:get_string("depth")) - --if below == nil then below = 1 end - local b = { x = pos.x, y = pos.y - below, z = pos.z } - local btop = { x = pos.x, y = pos.y - (below - 1), z = pos.z } - - local t = { x = pos.x, y = pos.y + below, z = pos.z } - local ttop = { x = pos.x, y = pos.y + (below + 1), z = pos.z } - - local top = { x = pos.x, y = pos.y + 1, z = pos.z } - - if n == "top" then - minetest.remove_node(pos) - minetest.remove_node(top) - minetest.remove_node(b) - minetest.remove_node(btop) - elseif n == "bottom" then - minetest.remove_node(pos) - minetest.remove_node(top) - minetest.remove_node(t) - minetest.remove_node(ttop) - end - end - end, -}) - -minetest.register_node("myadmin:underworld_block", { - tiles = { - {name="myadmin_underworld_ani_blue.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.5}} - }, - drawtype = "nodebox", - paramtype = "light", - walkable = false, - pointable = false, - light_source = 12, - node_box = { - type = "fixed", - fixed = { - {-0.4375, -1.4375, -0.4375, 0.4375, 0.4375, 0.4375}, - } - } -}) -minetest.register_abm({ - nodenames = {"myadmin:underworld"}, - interval = 1, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - - local meta = minetest.get_meta(pos) - local t = meta:get_string("name") - local depth = tonumber(meta:get_string("depth")) - - if depth == nil then return end - - local up = meta:get_string("torb") - - local objs = minetest.env:get_objects_inside_radius(pos, 1) - for k, player in pairs(objs) do - local p = player:get_player_name() - if tp[p] == false then - return - end - - tp[p] = true - - if up == "top" and p then - tp[p] = false - player:setpos({x = pos.x, y = pos.y - depth, z = pos.z}) - minetest.after(10, function() - tp[p] = true - end) - else - tp[p] = false - player:setpos({x = pos.x, y = pos.y + depth, z = pos.z}) - minetest.after(10, function() - tp[p] = true - end) - end - end - end -})