Update compass in all inv slots (not just hotbar)

This commit is contained in:
Wuzzy 2023-02-02 23:25:17 +01:00
parent 1fb21f8b2b
commit dd861427fc

View File

@ -62,8 +62,8 @@ local function on_globalstep(dtime)
local yaw = player:get_look_horizontal() local yaw = player:get_look_horizontal()
local pos = player:get_pos() local pos = player:get_pos()
-- Cycle through hotbar slots -- Cycle through all inventory slots
for i = 1, 8 do for i = 1, inv:get_size("main") do
local itemstack = inv:get_stack("main", i) local itemstack = inv:get_stack("main", i)
local changed local changed
itemstack, changed = update_compass_itemstack(itemstack, pos, yaw) itemstack, changed = update_compass_itemstack(itemstack, pos, yaw)