From 4c575106b619d57ad047a8683fed562f18ee9058 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 9 Dec 2020 18:29:53 +0100 Subject: [PATCH] Add Suffocation --- mods/player_mechanics/init.lua | 1 + mods/server_utilities/init.lua | 11 ++++++++--- todo.txt | 1 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mods/player_mechanics/init.lua b/mods/player_mechanics/init.lua index f7b420a..cf8665b 100644 --- a/mods/player_mechanics/init.lua +++ b/mods/player_mechanics/init.lua @@ -5,3 +5,4 @@ dofile(path.."/player_mechanics.lua") dofile(path.."/eating_mechanics.lua") dofile(path.."/flowing.lua") dofile(path.."/fall_damage.lua") +dofile(path.."/suffocation.lua") diff --git a/mods/server_utilities/init.lua b/mods/server_utilities/init.lua index 8e62a90..32e5d18 100644 --- a/mods/server_utilities/init.lua +++ b/mods/server_utilities/init.lua @@ -10,7 +10,7 @@ local home_timeout = 60 minetest.register_chatcommand("sethome", { params = "nil", description = "Use this to set your home. Can be returned to by setting /home", - privs = {}, + privs = {home = true}, func = function(name) local time = minetest.get_us_time()/1000000 local player = minetest.get_player_by_name(name) @@ -34,7 +34,7 @@ minetest.register_chatcommand("sethome", { minetest.register_chatcommand("home", { params = "nil", description = "Use this to set your home. Can be returned to by setting /home", - privs = {}, + privs = {home = true}, func = function(name) local time = minetest.get_us_time()/1000000 local player = minetest.get_player_by_name(name) @@ -59,4 +59,9 @@ minetest.register_chatcommand("home", { minetest.chat_send_player(name, diff.." more second"..s.." until you can run that command.") end end, -}) \ No newline at end of file +}) + +minetest.register_privilege("home", { + description = "Player can use /home and /sethome.", + give_to_singleplayer = false, +}) diff --git a/todo.txt b/todo.txt index e3c02f0..8ee3cbf 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,3 @@ -- Dont show cheat button if priv is missing - Take damage when inside blocks - Bucket sounds - Background images for armor in inventory -- 2.44.0