From 990e41ee901c02f74ceee99ce0072539e06b4f73 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Tue, 8 Aug 2023 18:18:39 +0100 Subject: [PATCH] removed intllib --- depends.txt | 5 ----- description.txt | 1 - functions.lua | 19 ++++--------------- init.lua | 22 ++++++---------------- mod.conf | 2 +- 5 files changed, 11 insertions(+), 38 deletions(-) delete mode 100644 depends.txt delete mode 100644 description.txt diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 56db31a..0000000 --- a/depends.txt +++ /dev/null @@ -1,5 +0,0 @@ -default -wool -player_api? -pova? -intllib? diff --git a/description.txt b/description.txt deleted file mode 100644 index 64c8604..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -beds which allows sleep, featured to (auto) skip the night. diff --git a/functions.lua b/functions.lua index 3f33f91..321864a 100644 --- a/functions.lua +++ b/functions.lua @@ -1,5 +1,4 @@ local S = beds.get_translator -local is_50 = minetest.get_modpath("player_api") local is_54 = minetest.has_feature("direct_velocity_on_players") local is_pova = minetest.get_modpath("pova") local pi = math.pi @@ -106,13 +105,8 @@ local function lay_down(player, pos, bed_pos, state, skip) player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}) player:set_look_horizontal(math.random(1, 180) / 100) - if is_50 then - player_api.player_attached[name] = false - player_api.set_animation(player, "stand" , 30) - else - default.player_attached[name] = false - default.player_set_animation(player, "stand" , 30) - end + player_api.player_attached[name] = false + player_api.set_animation(player, "stand" , 30) hud_flags.wielditem = true @@ -175,13 +169,8 @@ local function lay_down(player, pos, bed_pos, state, skip) player:set_pos(p) - if is_50 then - player_api.player_attached[name] = true - player_api.set_animation(player, "lay" , 0) - else - default.player_attached[name] = true - default.player_set_animation(player, "lay" , 0) - end + player_api.player_attached[name] = true + player_api.set_animation(player, "lay" , 0) hud_flags.wielditem = false end diff --git a/init.lua b/init.lua index daa4cf3..3a803c9 100644 --- a/init.lua +++ b/init.lua @@ -2,22 +2,12 @@ local S if minetest.get_translator ~= nil then S = minetest.get_translator("beds") -- 5.x translation function -else - if minetest.get_modpath("intllib") then - dofile(minetest.get_modpath("intllib") .. "/init.lua") - if intllib.make_gettext_pair then - gettext, ngettext = intllib.make_gettext_pair() -- new gettext method - else - gettext = intllib.Getter() -- old text file method - end - S = gettext - else -- boilerplate function for 0.4 - S = function(str, ...) - local args = {...} - return str:gsub("@%d+", function(match) - return args[tonumber(match:sub(2))] - end) - end +else -- boilerplate function for 0.4 + S = function(str, ...) + local args = {...} + return str:gsub("@%d+", function(match) + return args[tonumber(match:sub(2))] + end) end end diff --git a/mod.conf b/mod.conf index ae353fb..30a95ce 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = beds description = beds which allows sleep, featured to (auto) skip the night. depends = default, wool -optional_depends = player_api, pova, intllib +optional_depends = player_api, pova