Fix gapple bugs and unload far chunks
This commit is contained in:
11
bot.py
11
bot.py
@@ -51,12 +51,13 @@ def tick(global_state):
|
||||
|
||||
target = None
|
||||
|
||||
try:
|
||||
g.chunks.get_block_at(*utils.pint(p))
|
||||
except ChunkNotLoadedException:
|
||||
# make sure current chunks are loaded for physics
|
||||
if not g.chunks.check_loaded(p, 9):
|
||||
packet = serverbound.play.PositionAndLookPacket(x=p.x, feet_y=p.y, z=p.z, pitch=0, yaw=0, on_ground=True)
|
||||
g.connection.write_packet(packet, force=True)
|
||||
return
|
||||
|
||||
#g.jobstate.run()
|
||||
g.chunks.unload_chunks(p)
|
||||
|
||||
if g.path and len(g.path):
|
||||
target = LPoint3f(g.path[0])
|
||||
@@ -194,7 +195,7 @@ def bot(global_state):
|
||||
time.sleep(utils.TICK)
|
||||
print('Player loaded.')
|
||||
|
||||
while not g.chunks.check_loaded(g.pos):
|
||||
while not g.chunks.check_loaded(g.pos, 529):
|
||||
time.sleep(utils.TICK)
|
||||
print('Chunks loaded.')
|
||||
|
||||
|
Reference in New Issue
Block a user