server: fix block placement in 1.16 (#512)
* fix block placement in 1.16 * fmt
This commit is contained in:
parent
e3845a0dbf
commit
8cecbb37e3
|
@ -797,7 +797,27 @@ impl Server {
|
||||||
renderer.view_vector.cast().unwrap(),
|
renderer.view_vector.cast().unwrap(),
|
||||||
target::test_block,
|
target::test_block,
|
||||||
) {
|
) {
|
||||||
if self.protocol_version >= 315 {
|
if self.protocol_version >= 477 {
|
||||||
|
self.write_packet(
|
||||||
|
packet::play::serverbound::PlayerBlockPlacement_insideblock {
|
||||||
|
location: pos,
|
||||||
|
face: protocol::VarInt(match face {
|
||||||
|
Direction::Down => 0,
|
||||||
|
Direction::Up => 1,
|
||||||
|
Direction::North => 2,
|
||||||
|
Direction::South => 3,
|
||||||
|
Direction::West => 4,
|
||||||
|
Direction::East => 5,
|
||||||
|
_ => unreachable!(),
|
||||||
|
}),
|
||||||
|
hand: protocol::VarInt(0),
|
||||||
|
cursor_x: at.x as f32,
|
||||||
|
cursor_y: at.y as f32,
|
||||||
|
cursor_z: at.z as f32,
|
||||||
|
inside_block: false,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else if self.protocol_version >= 315 {
|
||||||
self.write_packet(packet::play::serverbound::PlayerBlockPlacement_f32 {
|
self.write_packet(packet::play::serverbound::PlayerBlockPlacement_f32 {
|
||||||
location: pos,
|
location: pos,
|
||||||
face: protocol::VarInt(match face {
|
face: protocol::VarInt(match face {
|
||||||
|
|
Loading…
Reference in New Issue