You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
675 B

import minecraft.networking.packets
from custom.networking.packets.clientbound.play import chunk_data, block_change_packet
def get_packets(old_get_packets):
def wrapper(func, context):
print('Monkey-patch worked.')
packets = func(context)
# add any custom packets here
packets.add(chunk_data.ChunkDataPacket)
packets.add(block_change_packet.BlockChangePacket)
packets.add(block_change_packet.MultiBlockChangePacket)
return packets
return lambda x: wrapper(old_get_packets, x)
minecraft.networking.packets.clientbound.play.get_packets = get_packets(minecraft.networking.packets.clientbound.play.get_packets)