Skip to content

Commit

Permalink
feat: Update Luanti standard to 5.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
appgurueu authored and alerque committed Nov 12, 2024
1 parent a25463e commit 398f29d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/luacheck/builtin_standards/luanti.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
-- Luanti Lua API standard
-- API reference: https://github.com/minetest/minetest/blob/master/doc/lua_api.md
-- Changelog: https://dev.minetest.net/Changelog
-- Current version of this standard: 5.10.0
local standards = require "luacheck.standards"

local empty = {}
Expand All @@ -16,6 +18,7 @@ local core = {
get_game_info = empty,
get_worldpath = empty,
is_singleplayer = empty,
is_valid_player_name = empty,
features = open_table,
has_feature = empty,
get_player_information = empty,
Expand All @@ -30,8 +33,10 @@ local core = {
sha1 = empty,
colorspec_to_colorstring = empty,
colorspec_to_bytes = empty,
colorspec_to_table = empty,
encode_png = empty,
urlencode = empty,
time_to_day_night_ratio = empty,

-- Logging
debug = empty,
Expand Down Expand Up @@ -167,6 +172,7 @@ local core = {
set_node = empty,
add_node = empty,
bulk_set_node = empty,
bulk_swap_node = empty,
swap_node = empty,
remove_node = empty,
get_node = empty,
Expand Down Expand Up @@ -395,6 +401,12 @@ local core = {
get_translated_string = empty,
translate = empty,

-- IPC
ipc_set = empty,
ipc_get = empty,
ipc_cas = empty,
ipc_poll = empty,

-- Global tables
registered_items = open_table,
registered_nodes = open_table,
Expand Down Expand Up @@ -430,7 +442,7 @@ local core = {
}

-- Table additions
local table = standards.def_fields("copy", "indexof", "insert_all", "key_value_swap", "shuffle")
local table = standards.def_fields("copy", "indexof", "insert_all", "key_value_swap", "shuffle", "keyof")

-- String additions
local string = standards.def_fields("split", "trim")
Expand All @@ -445,7 +457,8 @@ local bit = standards.def_fields("tobit","tohex","bnot","band","bor","bxor","lsh
-- vector util
local vector = standards.def_fields("new", "zero", "copy", "from_string", "to_string", "direction", "distance",
"length", "normalize", "floor", "round", "apply", "combine", "equals", "sort", "angle", "dot", "cross", "offset",
"check", "in_area", "add", "subtract", "multiply", "divide", "rotate", "rotate_around_axis", "dir_to_rotation")
"check", "in_area", "add", "subtract", "multiply", "divide", "rotate", "rotate_around_axis", "dir_to_rotation",
"ceil", "sign", "abs", "random_in_area", "random_direction")

return {
read_globals = {
Expand Down

0 comments on commit 398f29d

Please sign in to comment.