Simplify directory structure
This commit is contained in:
+6
-6
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user