From a4a43aef2d8276a9597b00ba34f216d06790dc44 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Fri, 28 Jun 2019 09:33:39 -0500 Subject: [PATCH] Remove: converter code --- convert.lua | 45 --------------------------------------------- init.lua | 1 - nodes.lua | 17 ----------------- 3 files changed, 63 deletions(-) delete mode 100644 convert.lua diff --git a/convert.lua b/convert.lua deleted file mode 100644 index 25f53f2..0000000 --- a/convert.lua +++ /dev/null @@ -1,45 +0,0 @@ -function ip_convert() - local path = minetest.get_worldpath() .. "/factions_iplist.txt" - local file, error = io.open(path, "r") - - if file ~= nil then - local raw_data = file:read("*a") - local ips = minetest.deserialize(raw_data) - file:close() - - for i, k in pairs(ips) do - factions.player_ips.set(i, k) - end - - os.rename(path, minetest.get_worldpath() .. "/factions_iplist_old.txt") - end -end - -function faction_convert() - local path = minetest.get_worldpath() .. "/factions.conf" - local file, error = io.open(path, "r") - - if file ~= nil then - local raw_data = file:read("*a") - local tabledata = minetest.deserialize(raw_data) - file:close() - - if tabledata then - for facname, faction in pairs(tabledata) do - factions.factions.set(facname, faction) - - for player, rank in pairs(faction.players) do - factions.players.set(player, facname) - end - - for parcelpos, val in pairs(faction.land) do - factions.parcels.set(parcelpos, facname) - end - end - os.rename(path, minetest.get_worldpath() .. "/factions_old.conf") - end - end -end - -ip_convert() -faction_convert() diff --git a/init.lua b/init.lua index 4d38ca5..3ff166b 100644 --- a/init.lua +++ b/init.lua @@ -15,7 +15,6 @@ dofile (factions_modpath .. "/claim_events.lua") dofile (factions_modpath .. "/factions.lua") dofile (factions_modpath .. "/chatcommands.lua") dofile (factions_modpath .. "/nodes.lua") -dofile (factions_modpath .. "/convert.lua") minetest.after(1, hudUpdateClaimInfo) minetest.after(factions_config.tick_time, factionUpdate) diff --git a/nodes.lua b/nodes.lua index b31ec20..048f96c 100644 --- a/nodes.lua +++ b/nodes.lua @@ -14,23 +14,6 @@ end -- Make default chest the faction chest. if minetest.registered_nodes["default:chest"] then - minetest.register_lbm({ - label = "Replace faction chest with default one.", - name = "factions:replace_factions_chest", - nodenames = {"factions:chest"}, - action = function(pos, node) - minetest.swap_node(pos, {name = "default:chest"}) - local parcel_faction = factions.get_faction_at(pos) - if parcel_faction then - local meta = minetest.get_meta(pos) - local name = parcel_faction.name - meta:set_string("faction", name) - meta:set_string("infotext", "Faction Chest (owned by faction " .. - name .. ")") - end - end - }) - local dc = minetest.registered_nodes["default:chest"] local def_on_rightclick = dc.on_rightclick