Removes all unneccessary files

This commit is contained in:
AliasAlreadyTaken 2024-06-12 17:59:01 +02:00
parent df50af0a8c
commit e419dba60f
10 changed files with 5 additions and 162 deletions

View File

@ -2,14 +2,17 @@ unused_args = false
allow_defined_top = true
globals = {
"minetest",
"core"
"yl_api_food"
}
read_globals = {
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},
-- Core
"minetest",
"core",
-- Builtin
"vector", "ItemStack",
"dump", "DIR_DELIM", "VoxelArea", "Settings",

View File

@ -1,19 +0,0 @@
local chatcommand_cmd = "admin_example"
local chatcommand_definition = {
params = yl_api_food.t("chatcommand_admin_parameters"), -- Short parameter description
description = yl_api_food.t("chatcommand_admin_description"), -- Full description
privs = {[yl_api_food.settings.admin_priv] = true}, -- Require the "privs" privilege to run
func = function(name, param)
local success = true
if success then
return true, yl_api_food.t("chatcommand_admin_success_message")
else
return false, yl_api_food.t("chatcommand_admin_fail_message")
end
end
-- Called when command is run. Returns boolean success and text output.
-- Special case: The help message is shown to the player if `func`
-- returns false without a text output.
}
minetest.register_chatcommand(chatcommand_cmd, chatcommand_definition)

View File

@ -1,19 +0,0 @@
local chatcommand_cmd = "player_example"
local chatcommand_definition = {
params = yl_api_food.t("chatcommand_player_parameters"), -- Short parameter description
description = yl_api_food.t("chatcommand_player_parameters"), -- Full description
privs = {privs = true}, -- Require the "privs" privilege to run
func = function(name, param)
local success = true
if success then
return true, yl_api_food.t("chatcommand_player_parameters")
else
return false, yl_api_food.t("chatcommand_player_parameters")
end
end
-- Called when command is run. Returns boolean success and text output.
-- Special case: The help message is shown to the player if `func`
-- returns false without a text output.
}
minetest.register_chatcommand(chatcommand_cmd, chatcommand_definition)

View File

@ -1,2 +0,0 @@
dofile(yl_api_food.modpath .. "chatcommand_admin.lua")
dofile(yl_api_food.modpath .. "chatcommand_player.lua")

View File

@ -1,13 +0,0 @@
local timer = 0
local gs = function(dtime)
timer = timer + dtime
if timer <= yl_api_food.config.interval then
return
end
timer = 0
-- do stuff
end
minetest.register_globalstep(gs)

View File

@ -17,10 +17,8 @@ yl_api_food.worldpath = minetest.get_worldpath() .. DIR_DELIM
dofile(yl_api_food.modpath .. "texts.lua")
dofile(yl_api_food.modpath .. "information.lua")
dofile(yl_api_food.modpath .. "config.lua")
dofile(yl_api_food.modpath .. "internal.lua")
dofile(yl_api_food.modpath .. "api.lua")
dofile(yl_api_food.modpath .. "initialize.lua")
local mod_end_time = (minetest.get_us_time() - mod_start_time) / 1000000
minetest.log("action", "[MOD] yl_api_food loaded in [" .. mod_end_time .. "s]")

View File

@ -1,9 +0,0 @@
-- Use this file to initialize variables once after server start and check everything is in place
local function run_each_serverstart()
yl_api_food.data = {}
--minetest.on_mods_loaded(0.0, yl_api_food.on_mods_loaded)
--minetest.after(0.0, yl_api_food.after)
end
run_each_serverstart()

View File

@ -1,76 +0,0 @@
local priv_name = "example"
local priv_definition = {
description = yl_api_food.t("privs_example_description"),
-- Privilege description
give_to_singleplayer = false,
-- Whether to grant the privilege to singleplayer.
give_to_admin = true,
-- Whether to grant the privilege to the server admin.
-- Uses value of 'give_to_singleplayer' by default.
on_grant = function(name, granter_name)
-- logging
if (type(granter_name) ~= "string") then
local errormessage = yl_api_food.t("error_name_not_found",
dump(granter_name))
yl_api_food.log(errormessage)
return false, errormessage
end
if not name then
local errormessage = yl_api_food.t("error_name_not_found",
dump(name))
yl_api_food.log(errormessage)
return false, errormessage
end
if not priv_name then
local errormessage = yl_api_food.t("error_priv_not_found",
dump(priv_name))
yl_api_food.log(errormessage)
return false, errormessage
end
local text = yl_api_food.t("privs_example_grant_logmessage",
dump(granter_name), dump(priv_name),
dump(name))
yl_api_food.log(text)
end,
-- Called when given to player 'name' by 'granter_name'.
-- 'granter_name' will be nil if the priv was granted by a mod.
on_revoke = function(name, revoker_name)
-- logging
if (type(revoker_name) ~= "string") then
local errormessage = yl_api_food.t("error_name_not_found",
dump(revoker_name))
yl_api_food.log(errormessage)
return false, errormessage
end
if not name then
local errormessage = yl_api_food.t("error_name_not_found",
dump(name))
yl_api_food.log(errormessage)
return false, errormessage
end
if not priv_name then
local errormessage = yl_api_food.t("error_priv_not_found",
dump(priv_name))
yl_api_food.log(errormessage)
return false, errormessage
end
local text = yl_api_food.t("privs_example_revoke_logmessage",
dump(revoker_name), dump(priv_name),
dump(name))
yl_api_food.log(text)
end
-- Called when taken from player 'name' by 'revoker_name'.
-- 'revoker_name' will be nil if the priv was revoked by a mod.
-- Note that the above two callbacks will be called twice if a player is
-- responsible, once with the player name, and then with a nil player
-- name.
-- Return true in the above callbacks to stop register_on_priv_grant or
-- revoke being called.
}
minetest.register_privilege(priv_name, priv_definition)

View File

@ -1 +0,0 @@
dofile(yl_api_food.modpath .. "priv_example.lua")

View File

@ -1,19 +0,0 @@
-- Use this file to set up folder and variables once after installation of the mod
-- Afterwards you could disable this part of the code or set a variable that tells
-- this code not to run again
local mkdir = minetest.mkdir
local save_path = yl_api_food.settings.save_path
local function run_once()
local path = yl_api_food.worldpath .. DIR_DELIM .. save_path
local file = io.open(path, "r")
if not file then
mkdir(path)
else
file:close()
end
end
run_once()