Wait for landing before block breaking
This commit is contained in:
1 parent
3e8b95c895
commit
5a3b299aa9
5 files changed
+281
-85
No files matched your search
+5
-1
@@ -248,6 +248,10 @@ def tick(global_state):
|
||||
block_above = g.chunks.get_block_at(floor(p.x), ceil(p.y+1), floor(p.z))
|
||||
in_void = p.y < 0
|
||||
in_air = block_below in blocks.NON_SOLID_IDS or in_void
|
||||
support_below = g.chunks.get_block_at(
|
||||
floor(p.x), floor(p.y - 0.2), floor(p.z))
|
||||
g.on_ground = (support_below is not None and
|
||||
support_below not in blocks.NON_SOLID_IDS and not in_void)
|
||||
in_water = block_below in blocks.WATER_IDS
|
||||
g.crawling = block_above not in blocks.NON_SOLID_IDS
|
||||
|
||||
@@ -289,7 +293,7 @@ def tick(global_state):
|
||||
)
|
||||
packet = PlayerPositionRotation(
|
||||
x=p.x, y=p.y, z=p.z, pitch=g.pitch, yaw=g.yaw,
|
||||
on_ground=(not in_air))
|
||||
on_ground=g.on_ground)
|
||||
# Keep the client-tick boundary after its movement packet on the wire.
|
||||
g.connection.write_packet(packet, force=True)
|
||||
g.connection.write_packet(ClientTickEnd(), force=True)
|
||||
|
||||
Reference in new issue
Block a user