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)
|
|
|
|
mc_packets.add(packets.BlockChangePacket)
|
|
|
|
mc_packets.add(packets.MultiBlockChangePacket)
|
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)
|