fix: faketpa

This commit is contained in:
minish 2026-02-08 01:13:36 -05:00
parent faae37274c
commit f60f489df4
Signed by: min
SSH Key Fingerprint: SHA256:mf+pUTmK92Y57BuCjlkBdd82LqztTfDCQIUp0fCKABc
2 changed files with 11 additions and 11 deletions

View File

@ -75,9 +75,9 @@ function textutils.pagedTabulate(...) end
------ ------
---[Official Documentation](https://tweaked.cc/module/textutils.html#v:empty_json_array) ---[Official Documentation](https://tweaked.cc/module/textutils.html#v:empty_json_array)
textutils.empty_json_array = { textutils.empty_json_array = {
__tostring = function() __tostring = function()
return "[]" return "[]"
end, end,
} }
---A table representing the JSON null value ---A table representing the JSON null value
@ -87,9 +87,9 @@ textutils.empty_json_array = {
------ ------
---[Official Documentation](https://tweaked.cc/module/textutils.html#v:json_null) ---[Official Documentation](https://tweaked.cc/module/textutils.html#v:json_null)
textutils.json_null = { textutils.json_null = {
__tostring = function() __tostring = function()
return "null" return "null"
end, end,
} }
---Get a textual representation of a Lua table, suitable for saving to a file or ---Get a textual representation of a Lua table, suitable for saving to a file or
@ -137,13 +137,13 @@ function textutils.unserialise(str) end
---This is largely intended for interacting with various functions from the ---This is largely intended for interacting with various functions from the
---commands API, though may also be used in making http requests. ---commands API, though may also be used in making http requests.
---@param tbl string|boolean|number|table The value to serialize ---@param tbl string|boolean|number|table The value to serialize
---@param NBTstyle? boolean If [NBT style](https://minecraft.fandom.com/wiki/NBT_format) JSON (non-quoted keys) should be output ---@param options? table Options for serialization
---@return string JSON The JSON output ---@return string JSON The JSON output
---@throws If the `value` contains a function ---@throws If the `value` contains a function
---@throws If the `value` contains tables that appear multiple times ---@throws If the `value` contains tables that appear multiple times
------ ------
---[Official Documentation](https://tweaked.cc/module/textutils.html#v:serializeJSON) ---[Official Documentation](https://tweaked.cc/module/textutils.html#v:serializeJSON)
function textutils.serializeJSON(tbl, NBTstyle) end function textutils.serializeJSON(tbl, options) end
---Get a JSON representation of the given value ---Get a JSON representation of the given value
--- ---
@ -154,13 +154,13 @@ function textutils.serializeJSON(tbl, NBTstyle) end
---This is largely intended for interacting with various functions from the ---This is largely intended for interacting with various functions from the
---commands API, though may also be used in making http requests. ---commands API, though may also be used in making http requests.
---@param tbl table The value to serialise ---@param tbl table The value to serialise
---@param NBTstyle? boolean If [NBT style](https://minecraft.fandom.com/wiki/NBT_format) JSON (non-quoted keys) should be output ---@param options? table Options for serialisation
---@return string JSON The JSON output ---@return string JSON The JSON output
---@throws If `t` contains a function ---@throws If `t` contains a function
---@throws If `t` contains tables that appear multiple times ---@throws If `t` contains tables that appear multiple times
------ ------
---[Official Documentation](https://tweaked.cc/module/textutils.html#v:serialiseJSON) ---[Official Documentation](https://tweaked.cc/module/textutils.html#v:serialiseJSON)
function textutils.serialiseJSON(tbl, NBTstyle) end function textutils.serialiseJSON(tbl, options) end
---Convert a serialized JSON string back into a Lua table ---Convert a serialized JSON string back into a Lua table
---@param str string The string to unserialize ---@param str string The string to unserialize

View File

@ -126,7 +126,7 @@ local function faketpa(tgtplr, sender, fakeplr, fakemsg)
}, },
{ text = " |" }, { text = " |" },
} }
local jsonMsg = textutils.serialiseJSON(msg) local jsonMsg = textutils.serialiseJSON(msg, { allow_repetitions = true })
jsonMsg = jsonMsg:gsub("!ARROWEMJ!", "\\u27A1") jsonMsg = jsonMsg:gsub("!ARROWEMJ!", "\\u27A1")
jsonMsg = jsonMsg:gsub("!ACCEPTEMJ!", "\\u2714") jsonMsg = jsonMsg:gsub("!ACCEPTEMJ!", "\\u2714")
jsonMsg = jsonMsg:gsub("!DENYEMJ!", "\\u274C") jsonMsg = jsonMsg:gsub("!DENYEMJ!", "\\u274C")