Clear leaves when low on saplings
This commit is contained in:
5
bot.py
5
bot.py
@@ -61,6 +61,7 @@ def tick(global_state):
|
||||
g.chunks.unload_chunks(p)
|
||||
|
||||
########## object physics ##########
|
||||
# note: it's possible the chunk data is out of date when this runs
|
||||
|
||||
for eid, obj in copy(g.objects).items():
|
||||
if obj.velocity_x:
|
||||
@@ -84,8 +85,8 @@ def tick(global_state):
|
||||
obj.velocity_z *= 0.5
|
||||
|
||||
# float object back up in case it clipped through multiple blocks
|
||||
while g.chunks.get_block_at(floor(obj.x), floor(obj.y), floor(obj.z)) not in blocks.NON_SOLID_IDS:
|
||||
obj.y += 1
|
||||
if g.chunks.get_block_at(floor(obj.x), floor(obj.y), floor(obj.z)) not in blocks.NON_SOLID_IDS:
|
||||
obj.y += 0.05
|
||||
|
||||
if abs(obj.velocity_x) < 1: obj.velocity_x = 0
|
||||
if abs(obj.velocity_z) < 1: obj.velocity_z = 0
|
||||
|
Reference in New Issue
Block a user