Implement 26.3 food consumption

This commit is contained in:
Tanner
2026-11-04 20:06:02 +00:00
parent 1ecec547ae
commit 7d4f045100
8 changed files with 200 additions and 25 deletions
+9 -1
View File
@@ -23,7 +23,9 @@ from mosfet.protocol.packets import (
)
from mosfet.protocol.types import Slot
from mosfet.protocol.modern import PlayerCommandPacket, UpdateTimePacket
from mosfet.protocol.modern import (
PlayerCommandPacket, UpdateTimePacket, UseItemPacket,
)
from mosfet import utils
from mosfet import path
@@ -713,6 +715,12 @@ class Game(LegacyGame):
self._send_action(PlayerCommandPacket(
entity_id=self.g.eid, action_id=0, jump_boost=0))
def use_item(self, hand=0):
self._send_action(UseItemPacket(
hand=hand, sequence=self._next_sequence(),
yaw=float(self.g.get('yaw', 0.0)),
pitch=float(self.g.get('pitch', 0.0))))
def start_drain(self):
slots = [slot for slot, item in sorted(self.g.inv.items())
if 9 <= slot <= 45 and getattr(item, 'present', False)]