Implement brewing stand inventory measurement in comparator

This commit is contained in:
Jürgen Rühle 2024-10-30 15:59:04 +01:00 committed by cora
parent be4ae94c10
commit 5e4911c89f
2 changed files with 13 additions and 0 deletions

View File

@ -79,6 +79,7 @@ end
local measure_double_chest_left = measure_double_chest("left")
local measure_double_chest_right = measure_double_chest("right")
local measure_furnace = measure_complex_inventory({"fuel", "src", "dst"})
local measure_brewing_stand = measure_complex_inventory({"fuel", "input", "stand"})
-- measurable nodes mapped to their measuring function
local measure_tab = {
@ -106,6 +107,14 @@ local measure_tab = {
["mcl_furnaces:furnace"] = measure_furnace,
["mcl_blast_furnace:blast_furnace"] = measure_furnace,
["mcl_smoker:smoker"] = measure_furnace,
["mcl_brewing:stand_000"] = measure_brewing_stand,
["mcl_brewing:stand_001"] = measure_brewing_stand,
["mcl_brewing:stand_010"] = measure_brewing_stand,
["mcl_brewing:stand_011"] = measure_brewing_stand,
["mcl_brewing:stand_100"] = measure_brewing_stand,
["mcl_brewing:stand_101"] = measure_brewing_stand,
["mcl_brewing:stand_110"] = measure_brewing_stand,
["mcl_brewing:stand_111"] = measure_brewing_stand,
}
-- check if node at pos is 'interesting'

View File

@ -114,6 +114,7 @@ local function take_fuel (pos, meta, inv)
else
inv:set_stack("fuel", 1, "")
end
mcl_redstone.update_comparators(pos)
return BURN_TIME -- New value of fuel_timer_new
else -- no fuel available
return 0
@ -181,6 +182,7 @@ local function brewing_stand_timer(pos, elapsed)
end
end
stand_timer = 0
mcl_redstone.update_comparators(pos)
end
end
end
@ -284,6 +286,7 @@ local function start_stand_if_not_empty(pos)
end
minetest.swap_node(pos, {name = "mcl_brewing:stand_"..str})
minetest.get_node_timer(pos):start(1.0)
mcl_redstone.update_comparators(pos)
end
local function on_put(pos, listname, _, stack, _)
@ -310,6 +313,7 @@ local function on_put(pos, listname, _, stack, _)
return
end
minetest.get_node_timer (pos):start (1.0)
mcl_redstone.update_comparators(pos)
end
local function allow_move(pos, from_list, from_index, to_list, _, count, _)