From 5e8c513fddce2df7bff5e90de47c1b97a5fef7b0 Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS Date: Fri, 14 Jan 2022 18:32:18 +0100 Subject: [PATCH] warning when jumpdrive is placed in atmosphere send player chat warning when jumpdrive is placed in atmosphere and player does not have landing priv --- travel/jumpdrive.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/travel/jumpdrive.lua b/travel/jumpdrive.lua index 09cf8d7..aeb1905 100644 --- a/travel/jumpdrive.lua +++ b/travel/jumpdrive.lua @@ -1,3 +1,14 @@ +local default_after_place = minetest.registered_nodes["jumpdrive:engine"].after_place_node +local function custom_after_place(pos, placer) + default_after_place(pos, placer) + local playername = placer:get_player_name() + local has_landing_priv = minetest.check_player_privs(playername, { jumpdrive_land = true }) + if not has_landing_priv and -20 < pos.y and 100 > pos.y then + minetest.chat_send_player(playername, "You won't be able to jump away from here until you have jumpdrive_land priv!") + end +end +minetest.override_item("jumpdrive:engine", { after_place_node = custom_after_place }) + jumpdrive.preflight_check = function(source, destination, radius, playername) local has_landing_priv = minetest.check_player_privs(playername, {jumpdrive_land=true})