mirror of
https://github.com/minetest-mods/i3.git
synced 2025-07-03 09:00:23 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
36cdcde7ed | |||
c9e02dfe09 | |||
7005794cc3 |
2
init.lua
2
init.lua
@ -20,7 +20,7 @@ local function lf(path)
|
|||||||
end
|
end
|
||||||
|
|
||||||
i3 = {
|
i3 = {
|
||||||
version = 115,
|
version = 1151,
|
||||||
data = core.deserialize(storage:get_string"data") or {},
|
data = core.deserialize(storage:get_string"data") or {},
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local replacements = {fuel = {}}
|
local replacements = {fuel = {}}
|
||||||
local http = ...
|
local http = ...
|
||||||
|
|
||||||
IMPORT("maxn", "copy", "insert", "sort", "match", "sub")
|
IMPORT("copy", "insert", "sort", "match", "sub")
|
||||||
IMPORT("true_str", "is_table", "valid_item", "table_merge", "table_replace", "table_eq")
|
IMPORT("true_str", "is_table", "valid_item", "table_merge", "table_replace", "table_eq")
|
||||||
IMPORT("fmt", "reg_items", "reg_aliases", "reg_nodes", "is_cube", "get_cube", "ItemStack")
|
IMPORT("fmt", "reg_items", "reg_aliases", "reg_nodes", "is_cube", "get_cube", "ItemStack")
|
||||||
IMPORT("is_group", "extract_groups", "item_has_groups", "groups_to_items", "get_group_stereotype")
|
IMPORT("is_group", "extract_groups", "item_has_groups", "groups_to_items", "get_group_stereotype")
|
||||||
@ -178,13 +178,7 @@ local function cache_recipes(item)
|
|||||||
_recipes[#recipes + 1 - k] = v
|
_recipes[#recipes + 1 - k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
local size_rpl = maxn(replacements[item])
|
|
||||||
local size_rcp = #_recipes
|
|
||||||
local shift = size_rcp - size_rpl
|
|
||||||
|
|
||||||
for k, v in pairs(replacements[item]) do
|
for k, v in pairs(replacements[item]) do
|
||||||
k += shift
|
|
||||||
|
|
||||||
if _recipes[k] then
|
if _recipes[k] then
|
||||||
_recipes[k].replacements = v
|
_recipes[k].replacements = v
|
||||||
end
|
end
|
||||||
|
19
src/hud.lua
19
src/hud.lua
@ -118,6 +118,10 @@ core.register_globalstep(function(dt)
|
|||||||
local data = i3.data[name]
|
local data = i3.data[name]
|
||||||
if not data then return end
|
if not data then return end
|
||||||
|
|
||||||
|
if data.show_hud ~= nil then
|
||||||
|
show_hud(player, data)
|
||||||
|
end
|
||||||
|
|
||||||
local has_text = player:hud_get(data.hud.wielditem).text ~= ""
|
local has_text = player:hud_get(data.hud.wielditem).text ~= ""
|
||||||
|
|
||||||
if not data.wielditem_hud then
|
if not data.wielditem_hud then
|
||||||
@ -152,21 +156,6 @@ core.register_globalstep(function(dt)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
core.register_globalstep(function()
|
|
||||||
local players = get_connected_players()
|
|
||||||
players[0] = #players
|
|
||||||
|
|
||||||
for i = 1, players[0] do
|
|
||||||
local player = players[i]
|
|
||||||
local name = player:get_player_name()
|
|
||||||
local data = i3.data[name]
|
|
||||||
|
|
||||||
if data and data.show_hud ~= nil then
|
|
||||||
show_hud(player, data)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
local function init_waypoints(player)
|
local function init_waypoints(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local data = i3.data[name]
|
local data = i3.data[name]
|
||||||
|
Reference in New Issue
Block a user