Some cleaning

This commit is contained in:
Jean-Patrick Guerrero
2021-10-19 05:54:51 +02:00
parent 43b20b317e
commit caba7f3599
5 changed files with 39 additions and 29 deletions

View File

@ -1,4 +1,4 @@
local fmt, insert = string.format, table.insert
local fmt, insert, copy, pairs, ipairs = string.format, table.insert, table.copy, pairs, ipairs
local wood_types = {
"acacia_wood", "aspen_wood", "junglewood", "pine_wood",
@ -262,7 +262,7 @@ local moreblocks_nodes = {
"ice",
}
local colors_moreblocks = table.copy(colors)
local colors_moreblocks = copy(colors)
insert(colors_moreblocks, "white")
local moreblocks_mods = {

View File

@ -1,4 +1,3 @@
local modpath = core.get_modpath "i3"
local damage_enabled = core.settings:get_bool "enable_damage"
local reg_items = core.registered_items
@ -20,14 +19,10 @@ local min, max, floor, ceil = math.min, math.max, math.floor, math.ceil
local clr, ESC, check_privs, translate =
core.colorize, core.formspec_escape, core.check_player_privs, core.get_translated_string
local model_aliases = dofile(modpath .. "/etc/model_aliases.lua")
local PNG, styles, fs_elements = dofile(modpath .. "/etc/styles.lua")
local _, _, is_group, extract_groups, item_has_groups =
unpack(dofile(modpath .. "/etc/common.lua").progressive)
local groups_to_items, compression_active, compressible, true_str, is_fav =
unpack(dofile(modpath .. "/etc/common.lua").gui)
local model_aliases = i3.files.model_alias()
local PNG, styles, fs_elements = i3.files.styles()
local _, _, is_group, extract_groups, item_has_groups = unpack(i3.files.common().progressive)
local groups_to_items, compression_active, compressible, true_str, is_fav = unpack(i3.files.common().gui)
local S = i3.S

View File

@ -1,14 +1,12 @@
local POLL_FREQ = 0.25
local HUD_TIMER_MAX = 1.5
local set_fs = i3.set_fs
local modpath = core.get_modpath "i3"
local search, table_merge, is_group, extract_groups, item_has_groups, apply_recipe_filters =
unpack(dofile(modpath .. "/etc/common.lua").progressive)
unpack(i3.files.common().progressive)
local singleplayer = core.is_singleplayer()
local fmt, after = string.format, core.after
local fmt, after, pairs = string.format, core.after, pairs
local set_fs = i3.set_fs
local function array_diff(t1, t2)
local hash = {}
@ -204,8 +202,7 @@ local function show_hud_success(player, data)
end
player:hud_change(data.hud.text, "text",
fmt("%u new recipe%s unlocked!",
data.discovered, data.discovered > 1 and "s" or ""))
fmt("%u new recipe%s unlocked!", data.discovered, data.discovered > 1 and "s" or ""))
elseif data.show_hud == false then
if data.hud_timer >= HUD_TIMER_MAX then