2020-09-07 22:08:59 +00:00
|
|
|
import minecraft.networking.packets
|
2020-09-09 02:13:15 +00:00
|
|
|
from protocol import packets
|
2020-09-07 22:08:59 +00:00
|
|
|
|
|
|
|
def get_packets(old_get_packets):
|
|
|
|
def wrapper(func, context):
|
2020-09-08 04:31:55 +00:00
|
|
|
print('Monkey-patch worked.')
|
2020-09-09 02:13:15 +00:00
|
|
|
mc_packets = func(context)
|
2020-09-07 22:08:59 +00:00
|
|
|
|
|
|
|
# add any custom packets here
|
2020-09-09 02:13:15 +00:00
|
|
|
mc_packets.add(packets.ChunkDataPacket)
|
2020-09-09 20:15:37 +00:00
|
|
|
mc_packets.add(packets.AcknowledgePlayerDiggingPacket)
|
|
|
|
mc_packets.add(packets.BlockBreakAnimationPacket)
|
|
|
|
mc_packets.add(packets.SetSlotPacket)
|
|
|
|
mc_packets.add(packets.PlayerDiggingPacket)
|
|
|
|
mc_packets.add(packets.PickItemPacket)
|
|
|
|
mc_packets.add(packets.HeldItemChangePacket)
|
2020-09-21 01:08:23 +00:00
|
|
|
mc_packets.add(packets.OpenWindowPacket)
|
|
|
|
mc_packets.add(packets.CloseWindowPacket)
|
|
|
|
mc_packets.add(packets.ClickWindowPacket)
|
2020-09-21 05:41:55 +00:00
|
|
|
mc_packets.add(packets.ClientWindowConfirmationPacket)
|
|
|
|
mc_packets.add(packets.ServerWindowConfirmationPacket)
|
2020-09-23 06:00:28 +00:00
|
|
|
mc_packets.add(packets.EntityMetadataPacket)
|
2020-09-23 21:36:18 +00:00
|
|
|
mc_packets.add(packets.SpawnLivingEntityPacket)
|
|
|
|
mc_packets.add(packets.EntityPositionRotationPacket)
|
2020-10-14 02:26:50 +00:00
|
|
|
mc_packets.add(packets.DestroyEntitiesPacket)
|
2020-12-04 02:49:22 +00:00
|
|
|
mc_packets.add(packets.EntityActionPacket)
|
2020-09-07 22:08:59 +00:00
|
|
|
|
2020-09-09 02:13:15 +00:00
|
|
|
return mc_packets
|
2020-09-07 22:08:59 +00:00
|
|
|
return lambda x: wrapper(old_get_packets, x)
|
|
|
|
|
|
|
|
minecraft.networking.packets.clientbound.play.get_packets = get_packets(minecraft.networking.packets.clientbound.play.get_packets)
|