From f60f489df4a040d7ad71c72a46c024d5a2756369 Mon Sep 17 00:00:00 2001 From: min Date: Sun, 8 Feb 2026 01:13:36 -0500 Subject: [PATCH] fix: faketpa --- cclib/textutils.lua | 20 ++++++++++---------- chat.lua | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cclib/textutils.lua b/cclib/textutils.lua index 850e319..d39fb5f 100644 --- a/cclib/textutils.lua +++ b/cclib/textutils.lua @@ -75,9 +75,9 @@ function textutils.pagedTabulate(...) end ------ ---[Official Documentation](https://tweaked.cc/module/textutils.html#v:empty_json_array) textutils.empty_json_array = { - __tostring = function() - return "[]" - end, + __tostring = function() + return "[]" + end, } ---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) textutils.json_null = { - __tostring = function() - return "null" - end, + __tostring = function() + return "null" + end, } ---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 ---commands API, though may also be used in making http requests. ---@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 ---@throws If the `value` contains a function ---@throws If the `value` contains tables that appear multiple times ------ ---[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 --- @@ -154,13 +154,13 @@ function textutils.serializeJSON(tbl, NBTstyle) end ---This is largely intended for interacting with various functions from the ---commands API, though may also be used in making http requests. ---@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 ---@throws If `t` contains a function ---@throws If `t` contains tables that appear multiple times ------ ---[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 ---@param str string The string to unserialize diff --git a/chat.lua b/chat.lua index 7540245..813bce3 100644 --- a/chat.lua +++ b/chat.lua @@ -126,7 +126,7 @@ local function faketpa(tgtplr, sender, fakeplr, fakemsg) }, { text = " |" }, } - local jsonMsg = textutils.serialiseJSON(msg) + local jsonMsg = textutils.serialiseJSON(msg, { allow_repetitions = true }) jsonMsg = jsonMsg:gsub("!ARROWEMJ!", "\\u27A1") jsonMsg = jsonMsg:gsub("!ACCEPTEMJ!", "\\u2714") jsonMsg = jsonMsg:gsub("!DENYEMJ!", "\\u274C")