mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-22 02:19:44 +00:00
Merge pull request #1043 from ostermine/feat/hotbar-control
make hotbar size and layout configurable
This commit is contained in:
commit
bb73e3f354
16 changed files with 188 additions and 20 deletions
|
|
@ -43,7 +43,8 @@ function on_hud_open()
|
|||
end
|
||||
local id = block.get_picking_item(block.get(x, y, z))
|
||||
local inv, cur_slot = player.get_inventory(pid)
|
||||
local slot = inventory.find_by_item(inv, id, 0, 9)
|
||||
local hotbar_size = player.get_hotbar_size(pid)
|
||||
local slot = inventory.find_by_item(inv, id, 0, hotbar_size)
|
||||
if slot then
|
||||
player.set_selected_slot(pid, slot)
|
||||
return
|
||||
|
|
@ -51,7 +52,7 @@ function on_hud_open()
|
|||
if not rules.get("allow-content-access") then
|
||||
return
|
||||
end
|
||||
slot = inventory.find_by_item(inv, 0, 0, 9)
|
||||
slot = inventory.find_by_item(inv, 0, 0, hotbar_size)
|
||||
if slot then
|
||||
cur_slot = slot
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue