Decode clientbound block events
This commit is contained in:
1 parent
a48b366b09
commit
d6505489d5
2 files changed
+55
-1
No files matched your search
@@ -318,6 +318,18 @@ class BlockEntityDataPacket(Packet):
|
||||
self.data = nbt_plain(read_anonymous_nbt(file_object))
|
||||
|
||||
|
||||
class BlockEventPacket(Packet):
|
||||
"""Clientbound block event (chest viewer-count updates, etc.)."""
|
||||
id = 0x07
|
||||
packet_name = "block event"
|
||||
|
||||
def read(self, file_object):
|
||||
self.location = Position.read_with_context(file_object, self.context)
|
||||
self.action = UnsignedByte.read(file_object)
|
||||
self.parameter = UnsignedByte.read(file_object)
|
||||
self.block_id = VarInt.read(file_object)
|
||||
|
||||
|
||||
class BlockUpdatePacket(Packet):
|
||||
id = 0x08
|
||||
packet_name = "block update"
|
||||
@@ -1226,7 +1238,7 @@ class ModernPlayingReactor(PacketReactor):
|
||||
ClientboundChunkBatchFinished, ClientboundPlayerChatPacket,
|
||||
EntityAnimationPacket, EntitySwingAnimationPacket,
|
||||
BlockChangedAckPacket, AddEntityPacket, SetEntityDataPacket,
|
||||
BlockEntityDataPacket, RemoveEntitiesPacket,
|
||||
BlockEntityDataPacket, BlockEventPacket, RemoveEntitiesPacket,
|
||||
MoveEntityPositionPacket,
|
||||
MoveEntityPositionRotationPacket, MoveEntityRotationPacket,
|
||||
EntityPositionSyncPacket, PlayerInfoUpdatePacket,
|
||||
|
||||
Reference in new issue
Block a user