return true
end
end)
+
+function core.send_colorized(message)
+ local starts_with = message:sub(1, 1)
+
+ if starts_with == "/" or starts_with == "." then return end
+
+ local reverse = core.settings:get_bool("chat_reverse")
+
+ if reverse then
+ local msg = ""
+ for i = 1, #message do
+ msg = message:sub(i, i) .. msg
+ end
+ message = msg
+ end
+
+ local use_chat_color = core.settings:get("use_chat_color")
+ local color = core.settings:get("chat_color")
+
+ if color then
+ local msg
+ if color == "rainbow" then
+ msg = core.rainbow(message)
+ else
+ msg = core.colorize(color, message)
+ end
+ message = msg
+ end
+
+ core.send_chat_message(message)
+ return true
+end
+
+core.register_on_sending_chat_message(core.send_colorized)
+
["ScaffoldPlus"] = "scaffold_plus",
["BlockWater"] = "block_water",
["PlaceOnTop"] = "autotnt",
- ["Replace"] = "replace"
- ["Nuke"] = "nuke"
+ ["Replace"] = "replace",
+ ["Nuke"] = "nuke",
},
["Exploit"] = {
["EntitySpeed"] = "entity_speed",
},
["Chat"] = {
["IgnoreStatus"] = "ignore_status_messages",
- ["Deathmessages"] = "mark_deathmessages"
+ ["Deathmessages"] = "mark_deathmessages",
+ ["ColoredChat"] = "use_chat_color",
+ ["ReversedChat"] = "chat_reverse",
},
["Inventory"] = {
["AutoEject"] = "autoeject",
function core.get_pointed_thing()
local pos = core.camera:get_pos()
local pos2 = vector.add(pos, vector.multiply(core.camera:get_look_dir(), 5))
- local ray = core.raycast(pos, pos2, true, core.settings:get_bool("point_liquids") or core.get_item_def(core.localplayer:get_wielded_item():get_name()).liquids_pointable)
- return ray:next()
+ local player = core.localplayer
+ if not player then return end
+ local item = player:get_wielded_item()
+ if not item then return end
+ local def = core.get_item_def(item:get_name())
+ local ray = core.raycast(pos, pos2, true, core.settings:get_bool("point_liquids") or def and def.liquids_pointable)
+ return ray and ray:next()
end
autorefill (AutoRefill) bool false
nuke (Nuke) bool false
+
+chat_color (Chat Color) string rainbow
+
+use_chat_color (ColoredChat) bool false
+
+chat_reverse (ReversedChat) bool false
settings->setDefault("strip", "false");
settings->setDefault("autorefill", "false");
settings->setDefault("nuke", "false");
+ settings->setDefault("chat_color", "rainbow");
+ settings->setDefault("use_chat_color", "false");
+ settings->setDefault("chat_reverse", "false");
// Keymap
settings->setDefault("remote_port", "30000");