mirror of
https://codeberg.org/usrib/emeraldbank.git
synced 2024-11-19 22:23:50 +01:00
Added .luacheckrc and addec logging to command: emeralds
This commit is contained in:
parent
c33c4be134
commit
0bf4d57b2f
48
.luacheckrc
Normal file
48
.luacheckrc
Normal file
@ -0,0 +1,48 @@
|
||||
unused_args = false
|
||||
allow_defined_top = true
|
||||
|
||||
globals = {
|
||||
"minetest","atm","emeraldbank",
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
string = {fields = {"split"}},
|
||||
table = {fields = {"copy", "getn"}},
|
||||
|
||||
-- Builtin
|
||||
"vector", "ItemStack",
|
||||
"dump", "DIR_DELIM", "VoxelArea", "Settings","core",
|
||||
|
||||
-- MTG
|
||||
"default", "sfinv", "creative",
|
||||
|
||||
-- Mineclone
|
||||
"mcl_loot", "tga_encoder", "mcl_util", "flowlib", "mcl_sounds", "mcl_autogroup",
|
||||
"mcl_events", "biomeinfo", "mcl_damage", "mcl_particles", "mcl_worlds", "mcl_colors",
|
||||
"mcl_explosions", "mcl_vars", "controls", "walkover", "mcl_meshhand", "mcl_fovapi",
|
||||
"playerphysics", "mcl_hunger", "mcl_death_drop", "mcl_player", "mcl_playerplus",
|
||||
"mcl_gamemode", "mcl_spawn", "mcl_skins", "mcl_sprint", "mcl_playerinfo",
|
||||
"mcl_item_id", "tt", "mcl_craftguide", "doc", "mcl_dripping",
|
||||
"mcl_entity_invs", "mcl_item_entity", "mcl_burning",
|
||||
"mcl_minecarts", "pillager", "mobs_mc", "sounds",
|
||||
"textures", "mcl_mobs", "mcl_paintings",
|
||||
"mcl_grindstone", "mcl_walls", "mcl_bamboo",
|
||||
"mcl_maps", "mcl_clock", "mcl_end", "mcl_starting_inventory",
|
||||
"mcl_bows", "mcl_bows_s", "mcl_dye", "mcl_copper",
|
||||
"mcl_flowerpots", "mcl_furnaces", "mcl_farming",
|
||||
"mcl_campfires", "mcl_crafting_table", "mcl_doors",
|
||||
"mcl_jukebox", "screwdriver", "mcl_itemframes",
|
||||
"mcl_heads", "mcl_beacons", "xpanes", "mcl_enchanting",
|
||||
"mcl_beds", "mcl_throwing", "mcl_banners", "mcl_mobspawners",
|
||||
"mcl_cocoas", "mcl_smithing_table", "mcl_flowers",
|
||||
"mcl_core", "mcl_torches", "mcl_target", "mesecon", "mcl_observers",
|
||||
"mcl_sculk", "mcl_armor", "mcl_lanterns", "mcl_stairs", "mcl_bells",
|
||||
"mcl_hamburger", "mcl_signs", "mcl_honey", "mcl_stonecutter", "mcl_fire",
|
||||
"mcl_compass", "mcl_ocean", "mcl_fences", "mcl_buckets", "mcl_potions",
|
||||
"tnt", "mcl_cherry_blossom", "mcl_portals", "mcl_chests", "mcl_shields",
|
||||
"mcl_wip", "mcl_raids", "mcl_moon", "lightning", "mcl_weather",
|
||||
"mcl_formspec", "mcl_death_messages", "mcl_bossbars", "awards",
|
||||
"mcl_inventory", "mcl_title", "mcl_offhand", "hb", "mcl_experience",
|
||||
"mcl_info", "mcl_credits", "tsm_railcorridors", "mcl_mapgen_core",
|
||||
"mcl_structures", "settlements", "mcl_dungeons", "mcl_colors_official"
|
||||
}
|
12
commands.lua
12
commands.lua
@ -43,7 +43,8 @@ core.register_chatcommand("pay", {
|
||||
|
||||
-- user /money chat command
|
||||
core.register_chatcommand("money", {
|
||||
description = S("Return your emeralds in your bank account."),
|
||||
description = S("Return your emeralds in your bank account. Or if have server priv, other players too"),
|
||||
params = "[player]",
|
||||
func = function(name, param)
|
||||
-- Determine the target player: either the command issuer or the specified player
|
||||
local target_player = param ~= "" and minetest.check_player_privs(name, {server=true}) and param or name
|
||||
@ -78,13 +79,18 @@ core.register_chatcommand("emeralds", {
|
||||
if player and num then
|
||||
emeraldbank.add_emeralds(player, num)
|
||||
atm.read_account(playername)
|
||||
minetest.chat_send_player(name, S("@1 has now @2 emeralds in bank account", playername, atm.balance[playername]))
|
||||
minetest.chat_send_player(name, S("@1 has now @2 emeralds in bank account",
|
||||
playername, atm.balance[playername]))
|
||||
return true
|
||||
end
|
||||
else
|
||||
-- Notify the command issuer that the player is not found or not online
|
||||
minetest.chat_send_player(name, S("Player @1 not found or not online.", playername))
|
||||
return false
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
-- experimental upgrade command
|
||||
core.register_chatcommand("upgrade", {
|
||||
description = S("Admin Command! Upgrade a shop"),
|
||||
|
Loading…
Reference in New Issue
Block a user