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
|
|
|
|
2020-12-06 23:53:04 +00:00
|
|
|
# add any custom CLIENTBOUND 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)
|
2020-09-21 01:08:23 +00:00
|
|
|
mc_packets.add(packets.OpenWindowPacket)
|
2020-09-21 05:41:55 +00:00
|
|
|
mc_packets.add(packets.ClientWindowConfirmationPacket)
|
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-14 04:27:06 +00:00
|
|
|
mc_packets.add(packets.EntityTeleport)
|
2021-02-20 23:04:48 +00:00
|
|
|
mc_packets.add(packets.TradeListPacket)
|
2020-09-07 22:08:59 +00:00
|
|
|
|
2020-12-06 23:53:04 +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)
|