refactor!: replace setters with fields

This commit is contained in:
2026-04-19 14:15:17 -04:00
parent 6cb5a4e73f
commit 3ce06e1731
8 changed files with 44 additions and 29 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ function attack_entities(target_kind, minimum)
pos.y = pos.y + 1.5
hold_sword()
client:look_at(pos)
client.looking_at = pos
client:attack(e.id)
while client.has_attack_cooldown do
sleep(100)
+2 -2
View File
@@ -6,7 +6,7 @@ function hold_items_in_hotbar(target_kinds, inventory)
if index >= 37 and index <= 45 and table.contains(target_kinds, item.kind) then
inventory = nil
sleep(500)
client:set_held_slot(index - 37)
client.held_slot = index - 37
return true
end
end
@@ -35,7 +35,7 @@ end
function steal(item_name)
for _, chest_pos in ipairs(client:find_blocks(client.position, get_block_states({ "chest" }))) do
client:go_to({ position = chest_pos, radius = 3 }, { type = RADIUS_GOAL })
client:look_at(chest_pos)
client.looking_at = chest_pos
local container = client:open_container_at(chest_pos)
for index, item in ipairs(container.contents) do
+1 -1
View File
@@ -2,7 +2,7 @@ function look_at_player(name)
local player = get_player(name)
if player then
player.position.y = player.position.y + 1
client:look_at(player.position)
client.looking_at = player.position
end
end
+1 -1
View File
@@ -141,7 +141,7 @@ function interact_bed()
end
client:go_to({ position = bed, radius = 2 }, { type = RADIUS_GOAL, options = { without_mining = true } })
client:look_at(bed)
client.looking_at = bed
client:block_interact(bed)
end