-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Hello Folks.
I've been having a lot of fun trying to understand how this project works, and I've been able to hack apart enough of the code to get a "followbot" sporadically working on the cuberite server clone.
Unfortunately, I'm getting the following error with both the example code and my 'follow bot' plugin.
[DEBUG]: Physics failed to generate an MTV, bailing out
that message spams the console until I ^c out.
The error above is with a default vanilla server, version 1.8.8
Using the same code with a cuberite server (the C++ clone from http://cuberite.org/ ), I get
[DEBUG]: EVENTCORE: Exception while emitting PLAY<Chunk Data [02:03:38] <<< (0x03, 0x21): Chunk Data {'chunk_z': 8, 'data': b'', 'continuous': True, 'primary_bitmap': 0, 'chunk_x': 3}
[DEBUG]: EVENTCORE: Exception while emitting SOCKET_RECV None
[DEBUG]: EVENTCORE: Exception while emitting event_tick None
Traceback (most recent call last):
File "bot.py", line 55, in <module>
client.start(SERVER, 25565)
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/helpers/start.py", line 34, in start
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/core/event.py", line 29, in event_loop
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/core/event.py", line 36, in run_continuous
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/core/event.py", line 62, in emit
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/core/net.py", line 193, in tick
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/core/event.py", line 62, in emit
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/core/net.py", line 209, in handle_recv
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/core/net.py", line 145, in read_packet
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/core/event.py", line 62, in emit
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/helpers/world.py", line 64, in handle_chunk_data
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/tools/smpmap.py", line 217, in unpack_column
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/tools/smpmap.py", line 188, in unpack
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/plugins/tools/smpmap.py", line 106, in unpack
File "/home/brandon/GitCode/SpockBot/lib/python3.4/site-packages/spockbot-0.1.3-py3.4.egg/spockbot/mcp/bbuff.py", line 14, in read
spockbot.mcp.bbuff.BufferUnderflowException
That bot follows me for 1-10 seconds, and then crashes. The default example code never crashes on cuberite, but the single startup call to move_to does not cause the bot to move. I suspect this call is simply too soon after the bot was initialized, because subsequent calls work (until the error is thrown)
The only code that changed in my follow bot is the entity_move handler:
def entity_move_handler(self, name, data):
#Get the Entity object from data.
#Has 'entity' and 'old_pos' or something like that.
entity = data['entity']
#Check if the entity was a player
if (entity.eid in self.entities.players):
logger.info("{0} moved to {1} {2} {3}".format(entity.metadata, entity.x, entity.y, entity.z))
target = Vector3(entity.x, entity.y, entity.z)
self.movement.move_to(*target)
Obviously this error is caused by my call to move_to(*target) - I can comment it out and nothing crashes.
Thanks!