minetest -> core

This commit is contained in:
ROllerozxa 2024-11-08 21:50:47 +01:00
parent 97db8c565a
commit 3cd7a38019

View File

@ -7,31 +7,31 @@ local owofaces = {
">w<"
}
local storage = minetest.get_mod_storage()
local storage = core.get_mod_storage()
local enabled = (storage:get('enabled')) or 1
-- LOL
enabled = (enabled == 1)
minetest.register_on_chat_message(function(name, message)
core.register_on_chat_message(function(name, message)
if enabled then
minetest.chat_send_all(minetest.format_chat_message(name,
core.chat_send_all(core.format_chat_message(name,
message:gsub(".", {r = "w", R = "W", l = "w", L = "W"}) .. " " .. owofaces[math.random(#owofaces)]))
return true
end
end)
minetest.register_chatcommand("owospeak", {
core.register_chatcommand("owospeak", {
params = "",
description = "Toggles OwOspeak",
privs = { server = true },
func = function(name, param)
if enabled then
minetest.chat_send_player(name, minetest.colorize("#ff0000", "Disabled OwOspeak"))
core.chat_send_player(name, core.colorize("#ff0000", "Disabled OwOspeak"))
storage:set_int('enabled', 0)
enabled = false
else
minetest.chat_send_player(name, minetest.colorize("#00ff00", "Enabled OwOspeak"))
core.chat_send_player(name, core.colorize("#00ff00", "Enabled OwOspeak"))
storage:set_int('enabled', 1)
enabled = true
end