Implement 26.3 food consumption
This commit is contained in:
+9
-1
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user