Pull chunk data files over from Elektordi/pyCraft
https://github.com/Elektordi/pyCraft
This commit is contained in:
@@ -10,6 +10,8 @@ from minecraft.exceptions import YggdrasilError
|
||||
from minecraft.networking.connection import Connection
|
||||
from minecraft.networking.packets import Packet, clientbound, serverbound
|
||||
|
||||
from custom.managers import DataManager, ChunksManager
|
||||
|
||||
|
||||
def get_options():
|
||||
parser = OptionParser()
|
||||
@@ -63,6 +65,8 @@ def get_options():
|
||||
def main():
|
||||
options = get_options()
|
||||
|
||||
mcdata = DataManager('./mcdata')
|
||||
|
||||
if options.offline:
|
||||
print("Connecting in offline mode...")
|
||||
connection = Connection(
|
||||
@@ -107,6 +111,9 @@ def main():
|
||||
print("Message (%s): %s" % (
|
||||
chat_packet.field_string('position'), chat_packet.json_data))
|
||||
|
||||
chunks = ChunksManager(mcdata)
|
||||
chunks.register(connection)
|
||||
|
||||
connection.register_packet_listener(
|
||||
print_chat, clientbound.play.ChatMessagePacket)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user