Recover inventory space when gathering supplies
This commit is contained in:
1 parent
1b4dc21ea4
commit
1a7bdb2be4
4 files changed
+435
-13
No files matched your search
@@ -1373,6 +1373,21 @@ class Game(LegacyGame):
|
||||
self.g.connection.write_packet(ClientTickEnd(), force=True)
|
||||
return True
|
||||
|
||||
def swap_container_slot_with_hotbar(self, container_slot, inventory_slot):
|
||||
window = self.g.get('window')
|
||||
if not window or not 36 <= inventory_slot <= 44:
|
||||
return False
|
||||
packet = ContainerClickSwapPacket(
|
||||
container_id=window.window_id,
|
||||
state_id=self.g.inventory_state_ids.get(
|
||||
window.window_id, window.state_id),
|
||||
slot=container_slot,
|
||||
button=inventory_slot - 36,
|
||||
)
|
||||
self.g.connection.write_packet(packet, force=True)
|
||||
self.g.connection.write_packet(ClientTickEnd(), force=True)
|
||||
return True
|
||||
|
||||
def close_window(self):
|
||||
window = self.g.get('window')
|
||||
if not window:
|
||||
|
||||
Reference in new issue
Block a user