Commit d720fd3d authored by Peter Nerlich's avatar Peter Nerlich
Browse files

rename stuff to fsr

parent 4e44bbe5
minetest.register_tool("kif_custom:pick_salad", {
minetest.register_tool("fsr_custom:pick_salad", {
description = "Pickaxe of questionable quality",
inventory_image = "kif_custom_tool_picksalad.png",
inventory_image = "fsr_custom_tool_picksalad.png",
stack_max = 1,
sound = {breaks = "kif_custom_salad_splotch"},
sound = {breaks = "fsr_custom_salad_splotch"},
on_use = function(itemstack, user, pointed_thing)
if user ~= nil then
minetest.sound_play({
name = "kif_custom_salad_splotch",
name = "fsr_custom_salad_splotch",
}, {
object = user
})
......@@ -16,8 +16,8 @@ minetest.register_tool("kif_custom:pick_salad", {
end
})
kif.register_craft_if_items_exist({
output = "kif_custom:pick_salad",
fsr.register_craft_if_items_exist({
output = "fsr_custom:pick_salad",
recipe = {
{"farming:potato_salad", "farming:potato_salad", "farming:potato_salad"},
{"", "default:stick", ""},
......
local DISABLE_TIMEOUT = tonumber(minetest.settings:get("kif_custom.advtrains.disable_timeout")) or 60 * 60
local DISABLE_TIMEOUT = tonumber(minetest.settings:get("fsr_custom.advtrains.disable_timeout")) or 60 * 60
local trains_disabled = #minetest.get_connected_players() == 0
local disable_job = nil
......@@ -11,7 +11,7 @@ minetest.register_on_joinplayer(function(player, last_login)
disable_job = nil
end
if trains_disabled then
minetest.log("action", "[kif_custom] Enabling trains.")
minetest.log("action", "[fsr_custom] Enabling trains.")
trains_disabled = false
end
end)
......@@ -21,7 +21,7 @@ minetest.register_on_leaveplayer(function(player, timed_out)
-- deactivate trains
if disable_job == nil then
disable_job = minetest.after(DISABLE_TIMEOUT, function()
minetest.log("action", "[kif_custom] No player logged in for a time. Disabling trains.")
minetest.log("action", "[fsr_custom] No player logged in for a time. Disabling trains.")
trains_disabled = true
disable_job = nil
end)
......
......@@ -3,35 +3,35 @@ local greens = {"dye:green", "dye:light_green", "dye:medium_green", "dye:dark_gr
-- track stuff
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_interlocking:tcb_node",
recipe = {{"default:mese_crystal_fragment"},
{"default:steel_ingot"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_interlocking:tcb_node 9",
recipe = {{"default:mese_crystal"},
{"default:steelblock"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_line_automation:dtrack_stop_placer",
recipe = {{"dye:black"},
{"default:mese_crystal_fragment"},
{"advtrains:dtrack_placer"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_interlocking:dtrack_npr_placer",
recipe = {{"advtrains_line_automation:dtrack_stop_placer"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_interlocking:dtrack_npr_placer",
recipe = {{"advtrains_line_automation:dtrack_stop_placer"}}
})
--[[
-- TODO: fix crash in advtrains before adding recipe
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:dtrack_atc_placer",
recipe = {{"dye:blue"},
{"default:mese_crystal_fragment"},
......@@ -39,35 +39,35 @@ kif.register_craft_if_items_exist({
})
]]--
for i,color in ipairs(greens) do
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:dtrack_unload_placer",
recipe = {{color},
{"default:mese_crystal_fragment"},
{"advtrains:dtrack_placer"}}
})
end
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:dtrack_load_placer",
recipe = {{"dye:red"},
{"default:mese_crystal_fragment"},
{"advtrains:dtrack_placer"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:dtrack_load_placer",
recipe = {{"advtrains:dtrack_unload_placer"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:dtrack_unload_placer",
recipe = {{"advtrains:dtrack_load_placer"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_luaautomation:dtrack_placer",
recipe = {{"dye:blue"},
{"mesecons_microcontroller:microcontroller0000"},
{"advtrains:dtrack_placer"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_luaautomation:oppanel",
recipe = {
{"default:steel_ingot","dye:blue","default:steel_ingot"},
......@@ -77,12 +77,12 @@ kif.register_craft_if_items_exist({
-- train stuff
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:engine_japan",
recipe = {{"advtrains:wagon_japan"},
{"default:mese"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:wagon_japan",
recipe = {
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
......@@ -90,14 +90,14 @@ kif.register_craft_if_items_exist({
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:engine_industrial",
recipe = {
{"dye:red", "advtrains:driver_cab"},
{"default:steelblock", "default:mese_crystal"},
{"advtrains:wheel", "advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:engine_industrial_big",
recipe = {
{"dye:red", "advtrains:driver_cab", "default:steelblock"},
......@@ -105,14 +105,14 @@ kif.register_craft_if_items_exist({
{"advtrains:wheel", "advtrains:wheel", "advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:wagon_wood",
recipe = {
{"default:steel_ingot","","default:steel_ingot"},
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
{"advtrains:wheel","advtrains:wheel","advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:wagon_tank",
recipe = {
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
......@@ -120,42 +120,42 @@ kif.register_craft_if_items_exist({
{"advtrains:wheel","advtrains:wheel","advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:engine_railbus",
recipe = {
{"","basic_materials:steel_bar"},
{"dye:red","advtrains:subway_wagon"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:diesel_lokomotive",
recipe = {
{"dye:cyan", "advtrains:driver_cab"},
{"default:steelblock", "default:mese_crystal"},
{"advtrains:wheel", "advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:wagon_track",
recipe = {
{"advtrains:dtrack_placer", "advtrains:dtrack_placer", "advtrains:dtrack_placer"},
{"default:stick", "default:stick", "default:stick"},
{"advtrains:wheel", "", "advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:wagon_gravel",
recipe = {
{"group:wood", "default:gravel", "group:wood"},
{"group:wood", "group:wood", "group:wood"},
{"advtrains:wheel", "", "advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:wagon_tree",
recipe = {
{"", "group:tree", ""},
{"default:stick", "default:stick", "default:stick"},
{"advtrains:wheel", "", "advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:wagon_lava",
recipe = {
{"default:stick", "bucket:bucket_lava", "default:stick"},
......@@ -163,27 +163,27 @@ kif.register_craft_if_items_exist({
{"advtrains:wheel", "", "advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:SaHa_E231",
recipe = {
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
{"default:steel_ingot","dye:green","default:steel_ingot"},
{"advtrains:wheel","","advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:MoHa_E230",
recipe = {
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
{"default:steel_ingot","dye:green","default:steel_ingot"},
{"advtrains:wheel","default:mese","advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:MoHa_E231",
recipe = {
{"basic_materials:steel_bar"},
{"advtrains:MoHa_E230"}},
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:KuHa_E231",
recipe = {
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
......@@ -191,14 +191,14 @@ kif.register_craft_if_items_exist({
{"advtrains:wheel","default:mese","advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:under_s7dm",
recipe = {
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
{"default:steel_ingot","dye:red","default:steel_ingot"},
{"advtrains:wheel","dye:blue","advtrains:wheel"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:under_s7ndm",
recipe = {
{"default:steel_ingot","default:steel_ingot","default:steel_ingot"},
......@@ -209,73 +209,73 @@ kif.register_craft_if_items_exist({
-- signal stuff
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_signals_ks:mast_mast_0",
recipe = {{"default:steel_ingot"},
{"default:steel_ingot"},
{"default:steel_ingot"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_signals_ks:hs_danger_0 2",
type = "shapeless",
recipe = {"advtrains:signal_off", "advtrains:signal_off", "dye:white", "dye:yellow"}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_signals_ks:ra_danger_0 2",
type = "shapeless",
recipe = {"advtrains:signal_off", "advtrains:signal_off", "dye:white"}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:signal_wall_l_off",
recipe = {{"advtrains:signal_wall_t_off"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:signal_wall_r_off",
recipe = {{"advtrains:signal_wall_l_off"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:signal_wall_t_off",
recipe = {{"advtrains:signal_wall_r_off"}}
})
for i,color in ipairs(greens) do
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:signal_wall_l_off 2",
recipe = {{"default:steel_ingot", "dye:red"},
{"", color},
{"default:steel_ingot", "default:steel_ingot"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:signal_wall_r_off 2",
recipe = {{"dye:red", "default:steel_ingot"},
{color, ""},
{"default:steel_ingot", "default:steel_ingot"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:signal_wall_t_off 2",
recipe = {{"default:steel_ingot", "", "default:steel_ingot"},
{"default:steel_ingot", color, "dye:red"}}
})
end
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_signals_ks:sign_8_0 2",
type = "shapeless",
recipe = {"default:sign_wall_steel", "default:sign_wall_steel", "default:steel_ingot", "dye:white", "dye:black"}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_signals_ks:sign_8_0 2",
type = "shapeless",
recipe = {"basic_signs:sign_wall_steel_white_black", "default:steel_ingot"}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_signals_ks:sign_8_0 2",
recipe = {{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"dye:black", "default:steel_ingot", "dye:white"}}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains_signals_ks:sign_8_0 2",
recipe = {{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
......@@ -292,7 +292,7 @@ for rot = 0, 3 do
return "dye:red"
end
end
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:across_off 2",
recipe = {
{pos(3), "", pos(2)},
......@@ -303,7 +303,7 @@ end
-- add recipe with normal green for signal
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "advtrains:signal_off 2",
recipe = {
{"", "dye:red", "default:steel_ingot"},
......
kif = {}
fsr = {}
local MP = minetest.get_modpath("kif_custom")
local MP = minetest.get_modpath("fsr_custom")
-- utilities
dofile(MP.."/util.lua")
......
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "digilines:lightsensor",
recipe = {
{"basic_materials:plastic_sheet", "xpanes:pane_flat", "basic_materials:plastic_sheet"},
{"default:steel_ingot", "mesecons_luacontroller:luacontroller0000", "digilines:wire_std_00000000"}
}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "digilines:rtc",
recipe = {
{"basic_materials:plastic_sheet", "basic_materials:energy_crystal_simple", "basic_materials:plastic_sheet"},
......@@ -14,7 +14,7 @@ kif.register_craft_if_items_exist({
}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "computer:tetris_arcade",
recipe = {
{"basic_materials:plastic_sheet", "basic_materials:energy_crystal_simple", "basic_materials:plastic_sheet"},
......@@ -22,7 +22,7 @@ kif.register_craft_if_items_exist({
{"basic_materials:plastic_sheet", "basic_materials:energy_crystal_simple", "basic_materials:plastic_sheet"}
}
})
kif.register_craft_if_items_exist({
fsr.register_craft_if_items_exist({
output = "computer:3dprinter_bedflinger",
recipe = {
{"basic_materials:plastic_sheet", "basic_materials:empty_spool", "default:mese_crystal_fragment"},
......
name = kif_custom
name = fsr_custom
depends = default
optional_depends = """
advtrains_interlocking,
......
[Death Markers]
# Interval at which death markers are updated in seconds
kif_custom.death.update_interval (Update interval) int 5
fsr_custom.death.update_interval (Update interval) int 5
# The amount of seconds in which waypoints to bones expire.
kif_custom.death.waypoint_expires_seconds (Seconds in which waypoints expire) int 3600
fsr_custom.death.waypoint_expires_seconds (Seconds in which waypoints expire) int 3600
# The amount of seconds in which waypoints for deaths in creative mode expire.
kif_custom.death.waypoint_expires_seconds_creative (Seconds in which waypoints expire, creative) int 600
fsr_custom.death.waypoint_expires_seconds_creative (Seconds in which waypoints expire, creative) int 600
# The saturation of the waypoint text color. The text fades not only from white to black
# until it disappears, but also changes to a blue, green and finally red tint before disappearing.
# The saturation interpolates between the color and the grey shade of the same value.
kif_custom.death.waypoint_saturation (Color saturation) float 1 0 2
fsr_custom.death.waypoint_saturation (Color saturation) float 1 0 2
[advtrains]
# The amount of seconds until all trains are stopped after the last player has left.
kif_custom.advtrains.disable_timeout (Disable timeout) int 3600 0 604800
fsr_custom.advtrains.disable_timeout (Disable timeout) int 3600 0 604800
kif.get_item_name_from_string = function(str)
fsr.get_item_name_from_string = function(str)
local space = string.find(str, ' ')
if space == nil then
return str
......@@ -8,7 +8,7 @@ kif.get_item_name_from_string = function(str)
end
end
kif.is_group_string = function(str)
fsr.is_group_string = function(str)
local group = 'group:'
if string.sub(str, 1, #group) == group then
return string.sub(str, #group+1)
......@@ -22,30 +22,30 @@ local debug = function(msg, item)
if item == nil then
item = ''
else
item = " " .. kif.get_item_name_from_string(tostring(item))
item = " " .. fsr.get_item_name_from_string(tostring(item))
end
print("kif.register_craft_if_items_exist() "..msg..item)
print("fsr.register_craft_if_items_exist() "..msg..item)
end
kif.discovered_item_groups = {}
fsr.discovered_item_groups = {}
kif.group_exists = function(group)
fsr.group_exists = function(group)
-- all desired items have to have been registered already to discover their groups (obviously)
-- you might need to include these mods as optional dependencies
if kif.discovered_item_groups[group] == group then
if fsr.discovered_item_groups[group] == group then
return true
end
for name, item in pairs(minetest.registered_items) do
if type(item.groups) == "table" then
for group, rating in pairs(item.groups) do
kif.discovered_item_groups[group] = group
fsr.discovered_item_groups[group] = group
end
end
if kif.discovered_item_groups[group] == group then
if fsr.discovered_item_groups[group] == group then
local n = 0
for k,v in pairs(kif.discovered_item_groups) do
for k,v in pairs(fsr.discovered_item_groups) do
n = n+1
end
return true
......@@ -55,17 +55,17 @@ kif.group_exists = function(group)
end
kif.register_craft_if_items_exist = function(def)
if def.output and minetest.registered_items[kif.get_item_name_from_string(def.output)] == nil then
fsr.register_craft_if_items_exist = function(def)
if def.output and minetest.registered_items[fsr.get_item_name_from_string(def.output)] == nil then
debug("[FAIL] unknown output", def.output)
return false
end
if def.recipe then
if type(def.recipe) ~= "table" then
local recipe_item = kif.get_item_name_from_string(def.recipe)
local recipe_item = fsr.get_item_name_from_string(def.recipe)
if minetest.registered_items[recipe_item] == nil then
local group = kif.is_group_string(recipe_item)
if not (group and kif.group_exists(group)) then
local group = fsr.is_group_string(recipe_item)
if not (group and fsr.group_exists(group)) then
debug("[FAIL] unknown recipe", recipe_item)
return false
end
......@@ -73,20 +73,20 @@ kif.register_craft_if_items_exist = function(def)
else
for y, row in ipairs(def.recipe) do
if type(row) ~= "table" then
local row_item = kif.get_item_name_from_string(row)
local row_item = fsr.get_item_name_from_string(row)
if minetest.registered_items[row_item] == nil then
local group = kif.is_group_string(row_item)
if not (group and kif.group_exists(group)) then
local group = fsr.is_group_string(row_item)
if not (group and fsr.group_exists(group)) then
debug("[FAIL] unknown row item", row_item)
return false
end
end
else
for x, col in ipairs(row) do
local col_item = kif.get_item_name_from_string(col)
local col_item = fsr.get_item_name_from_string(col)
if col ~= "" and minetest.registered_items[col_item] == nil then
local group = kif.is_group_string(col_item)
if not (group and kif.group_exists(group)) then
local group = fsr.is_group_string(col_item)
if not (group and fsr.group_exists(group)) then
debug("[FAIL] unknown item", col)
return false
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment