Confirm crop seed selection before planting

This commit is contained in:
Tanner committed 2026-11-10 00:52:26 +00:00
1 parent 1a7bdb2be4
commit 46b0657bcf
4 files changed
+105 -21

No files matched your search

+3 -2
View File
@@ -1283,7 +1283,8 @@ class Game(LegacyGame):
self.breaking_state = None
self.next_swing_at = 0.0
def select_item(self, item_ids):
def select_item(self, item_ids, force=False):
"""Select an item, optionally resending the hotbar slot authoritatively."""
item_ids = set(item_ids)
matches = [(slot, item) for slot, item in self.g.inv.items()
if item.present and item.item_id in item_ids]
@@ -1317,7 +1318,7 @@ class Game(LegacyGame):
else:
return False
if self.g.get('holding_slot') != hotbar_slot:
if force or self.g.get('holding_slot') != hotbar_slot:
self.g.connection.write_packet(SetCarriedItemPacket(
slot=hotbar_slot), force=True)
self.g.holding_slot = hotbar_slot