From 90ef0875e8879834a710f9f95a7c3e588b5caebf Mon Sep 17 00:00:00 2001 From: cheapie Date: Thu, 28 Nov 2024 14:22:26 -0600 Subject: Add initial content --- .luacheckrc | 6 ++++++ init.lua | 18 ++++++++++++++++++ mod.conf | 3 +++ 3 files changed, 27 insertions(+) create mode 100644 .luacheckrc create mode 100644 init.lua create mode 100644 mod.conf diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..48e4f64 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,6 @@ +max_line_length = 160 + +read_globals = { + "core", + "irc", +} diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..5a62ef5 --- /dev/null +++ b/init.lua @@ -0,0 +1,18 @@ +local minversion = 42 +local message = "Multicraft and outdated clients (older than 5.7) are not supported and will experience severe issues.\n".. + "Please update to the latest official Luanti client (from luanti.org/downloads) before 2025-02-01 or you will no longer be able to connect." + +core.register_on_joinplayer(function(player) + local info = core.get_player_information(player:get_player_name()) + if info.protocol_version >= minversion then return end + player:hud_add({ + position = {x = 0.5,y = 0.2}, + name = "deprecationwarning", + type = "text", + scale = {x = 100,y = 100}, + number = 0xFF5555, + alignment = {x = 0,y = 0}, + text = message, + }) + if core.get_modpath("irc") then irc.say(player:get_player_name().." is using Multicraft or an old version") end +end) diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..55a71de --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = deprecationwarning +title = Warning for old protocol versions +optional_depends = irc -- cgit v1.2.3