aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/client/chatcommands.lua4
-rw-r--r--builtin/client/cheats.lua2
-rw-r--r--builtin/client/death_formspec.lua1
-rw-r--r--builtin/client/register.lua2
-rw-r--r--builtin/client/util.lua4
-rw-r--r--builtin/common/misc_helpers.lua13
-rw-r--r--builtin/mainmenu/tab_content.lua18
7 files changed, 23 insertions, 21 deletions
diff --git a/builtin/client/chatcommands.lua b/builtin/client/chatcommands.lua
index fc6ed5b2b..0da3dab1b 100644
--- a/builtin/client/chatcommands.lua
+++ b/builtin/client/chatcommands.lua
@@ -180,5 +180,5 @@ core.register_chatcommand("setpitch", {
end
})
-core.register_list_command("xray", "Configure X-Ray", "xray_nodes")
-core.register_list_command("search", "Configure NodeESP", "node_esp_nodes")
+core.register_list_command("xray", "Configure X-Ray", "xray_nodes")
+core.register_list_command("search", "Configure NodeESP", "node_esp_nodes")
diff --git a/builtin/client/cheats.lua b/builtin/client/cheats.lua
index 42f7abbb3..1abc2c8ef 100644
--- a/builtin/client/cheats.lua
+++ b/builtin/client/cheats.lua
@@ -55,4 +55,4 @@ core.cheats = {
function core.register_cheat(cheatname, category, func)
core.cheats[category] = core.cheats[category] or {}
core.cheats[category][cheatname] = func
-end
+end
diff --git a/builtin/client/death_formspec.lua b/builtin/client/death_formspec.lua
index 499ed47f3..7b8530440 100644
--- a/builtin/client/death_formspec.lua
+++ b/builtin/client/death_formspec.lua
@@ -36,4 +36,3 @@ core.register_chatcommand("respawn", {
end
end
})
-
diff --git a/builtin/client/register.lua b/builtin/client/register.lua
index 669ef134e..de5d89909 100644
--- a/builtin/client/register.lua
+++ b/builtin/client/register.lua
@@ -60,7 +60,7 @@ function core.override_item(name, redefinition)
end
local nodedef = core.get_node_def(name)
table.combine(itemdef, nodedef)
-
+
for k, v in pairs(redefinition) do
rawset(itemdef, k, v)
end
diff --git a/builtin/client/util.lua b/builtin/client/util.lua
index 30f983af3..e85727436 100644
--- a/builtin/client/util.lua
+++ b/builtin/client/util.lua
@@ -13,13 +13,13 @@ function core.parse_pos(param)
return true, vector.round(p)
end
return false, "Invalid position (" .. param .. ")"
-end
+end
function core.parse_relative_pos(param)
local success, pos = core.parse_pos(param:gsub("~", "0"))
if success then pos = vector.round(vector.add(core.localplayer:get_pos(), pos)) end
return success, pos
-end
+end
function core.find_item(item, mini, maxi)
for index, stack in ipairs(core.get_inventory("current_player").main) do
diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua
index 64d67bc72..db94e7073 100644
--- a/builtin/common/misc_helpers.lua
+++ b/builtin/common/misc_helpers.lua
@@ -516,6 +516,7 @@ function table.shuffle(t, from, to, random)
end
end
+
function table.combine(t, other)
other = other or {}
for k, v in pairs(other) do
@@ -603,7 +604,7 @@ local function rgb_to_hex(rgb)
while(value > 0)do
local index = math.fmod(value, 16) + 1
value = math.floor(value / 16)
- hex = string.sub('0123456789ABCDEF', index, index) .. hex
+ hex = string.sub('0123456789ABCDEF', index, index) .. hex
end
if(string.len(hex) == 0)then
@@ -624,12 +625,12 @@ local function color_from_hue(hue)
local c = 255
local x = (1 - math.abs(h%2 - 1)) * 255
- local i = math.floor(h);
+ local i = math.floor(h);
if (i == 0) then
return rgb_to_hex({c, x, 0})
- elseif (i == 1) then
+ elseif (i == 1) then
return rgb_to_hex({x, c, 0})
- elseif (i == 2) then
+ elseif (i == 2) then
return rgb_to_hex({0, c, x})
elseif (i == 3) then
return rgb_to_hex({0, x, c});
@@ -649,9 +650,9 @@ function core.rainbow(input)
if char:match("%s") then
output = output .. char
else
- output = output .. core.get_color_escape_sequence(color_from_hue(hue)) .. char
+ output = output .. core.get_color_escape_sequence(color_from_hue(hue)) .. char
end
- hue = hue + step
+ hue = hue + step
end
return output
end
diff --git a/builtin/mainmenu/tab_content.lua b/builtin/mainmenu/tab_content.lua
index 623210597..a76fee864 100644
--- a/builtin/mainmenu/tab_content.lua
+++ b/builtin/mainmenu/tab_content.lua
@@ -50,12 +50,12 @@ local function get_formspec(tabview, name, tabdata)
packages = filterlist.create(get_data, pkgmgr.compare_package,
is_equal, nil, {})
-
+
local filename = core.get_clientmodpath() .. DIR_DELIM .. "mods.conf"
local conffile = Settings(filename)
local mods = conffile:to_table()
-
+
for i = 1, #packages_raw do
local mod = packages_raw[i]
if mod.is_clientside and not mod.is_modpack then
@@ -71,7 +71,7 @@ local function get_formspec(tabview, name, tabdata)
mods["load_mod_" .. mod.name] = nil
end
end
-
+
-- Remove mods that are not present anymore
for key in pairs(mods) do
if key:sub(1, 9) == "load_mod_" then
@@ -211,24 +211,26 @@ local function handle_buttons(tabview, fields, tabname, tabdata)
local event = core.explode_table_event(fields["pkglist"])
tabdata.selected_pkg = event.row
local mod = packages:get_list()[tabdata.selected_pkg]
-
+
if event.type == "DCL" and mod.is_clientside then
pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}})
packages = nil
end
return true
end
-
+
if fields.btn_mod_mgr_mp_enable ~= nil or
fields.btn_mod_mgr_mp_disable ~= nil then
- pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}}, fields.btn_mod_mgr_mp_enable ~= nil)
+ pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}},
+ fields.btn_mod_mgr_mp_enable ~= nil)
packages = nil
return true
end
-
+
if fields.btn_mod_mgr_enable_mod ~= nil or
fields.btn_mod_mgr_disable_mod ~= nil then
- pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}}, fields.btn_mod_mgr_enable_mod ~= nil)
+ pkgmgr.enable_mod({data = {list = packages, selected_mod = tabdata.selected_pkg}},
+ fields.btn_mod_mgr_enable_mod ~= nil)
packages = nil
return true
end