Simplify directory structure

This commit is contained in:
2020-09-08 20:13:15 -06:00
parent e444cf6677
commit 8fabe5859a
17 changed files with 275 additions and 318 deletions
+6 -6
View File
@@ -1,17 +1,17 @@
import minecraft.networking.packets
from custom.networking.packets.clientbound.play import chunk_data, block_change_packet
from protocol import packets
def get_packets(old_get_packets):
def wrapper(func, context):
print('Monkey-patch worked.')
packets = func(context)
mc_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)
mc_packets.add(packets.ChunkDataPacket)
mc_packets.add(packets.BlockChangePacket)
mc_packets.add(packets.MultiBlockChangePacket)
return packets
return mc_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)