Gather sand and sleep at night
This commit is contained in:
+23
-5
@@ -1,7 +1,7 @@
|
||||
import minecraft.networking.packets
|
||||
|
||||
from minecraft.networking.packets import Packet
|
||||
from minecraft.networking.types import BlockFace, VarInt, Position, Boolean, Byte, UnsignedByte, Short, TrailingByteArray
|
||||
from minecraft.networking.types import BlockFace, VarInt, Position, Boolean, Byte, UnsignedByte, Short, TrailingByteArray, Long
|
||||
from minecraft.networking.types.basic import Type
|
||||
|
||||
#def qot(x):
|
||||
@@ -15,9 +15,9 @@ class AcknowledgePlayerDiggingPacket(Packet):
|
||||
id = 0x08
|
||||
packet_name = 'acknowledge player digging'
|
||||
definition = [
|
||||
{'status': VarInt},
|
||||
{'location': Position},
|
||||
{'face': VarInt},
|
||||
{'block': VarInt},
|
||||
{'status': VarInt},
|
||||
{'successful': Boolean},
|
||||
]
|
||||
|
||||
@@ -72,8 +72,6 @@ class Slot(Type):
|
||||
# TODO
|
||||
pass
|
||||
|
||||
|
||||
|
||||
class SetSlotPacket(Packet):
|
||||
id = 0x17
|
||||
packet_name = 'set slot'
|
||||
@@ -83,6 +81,14 @@ class SetSlotPacket(Packet):
|
||||
{'slot_data': Slot},
|
||||
]
|
||||
|
||||
class TimeUpdatePacket(Packet):
|
||||
id = 0x4F
|
||||
packet_name = 'time update'
|
||||
definition = [
|
||||
{'world_age': Long},
|
||||
{'time_of_day': Long},
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -93,6 +99,7 @@ def get_packets(old_get_packets):
|
||||
packets.add(AcknowledgePlayerDiggingPacket)
|
||||
packets.add(BlockBreakAnimationPacket)
|
||||
packets.add(SetSlotPacket)
|
||||
packets.add(TimeUpdatePacket)
|
||||
return packets
|
||||
return lambda x: wrapper(old_get_packets, x)
|
||||
|
||||
@@ -129,3 +136,14 @@ class PickItemPacket(Packet):
|
||||
definition = [
|
||||
{'slot_to_use': VarInt},
|
||||
]
|
||||
|
||||
class HeldItemChangePacket(Packet):
|
||||
# Sent when the player changes the slot selection
|
||||
# https://wiki.vg/Protocol#Held_Item_Change_.28serverbound.29
|
||||
|
||||
id = 0x23
|
||||
packet_name = 'held item change'
|
||||
|
||||
definition = [
|
||||
{'slot': Short},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user