Skip to content

Commit 8cfacdc

Browse files
committed
Initial command implementation: almost-complete /tp command.
/tp: send PlayerPositionAndLook instead of EntityTeleport Initial support for entity selectors Implement tp Rebase onto develop fix bump feather-server-commands to 0.6.0 to account for release of 0.6.0
1 parent b8dc118 commit 8cfacdc

File tree

28 files changed

+1078
-176
lines changed

28 files changed

+1078
-176
lines changed

Cargo.lock

Lines changed: 152 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ members = [
2020
"server/template",
2121
"server/chat",
2222
"server/chunk",
23+
"server/commands",
2324
"server/config",
2425
"server/entity",
2526
"server/lighting",

core/network/src/packet.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,11 @@ static PACKET_ID_MAPPINGS: Lazy<AHashMap<PacketId, PacketType>> = Lazy::new(|| {
595595
PacketType::CollectItem,
596596
);
597597

598+
m.insert(
599+
PacketId(0x50, PacketDirection::Clientbound, PacketStage::Play),
600+
PacketType::EntityTeleport,
601+
);
602+
598603
m
599604
});
600605

core/network/src/packets.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ pub static IMPL_MAP: Lazy<AHashMap<PacketType, PacketBuilder>> = Lazy::new(|| {
308308
SpawnPosition,
309309
TimeUpdate,
310310
CollectItem,
311+
EntityTeleport,
311312
Response,
312313
Pong,
313314
);
@@ -2223,3 +2224,14 @@ pub struct CollectItem {
22232224
pub collector: VarInt,
22242225
pub count: VarInt,
22252226
}
2227+
2228+
#[derive(Default, AsAny, Packet, Clone)]
2229+
pub struct EntityTeleport {
2230+
pub entity_id: VarInt,
2231+
pub x: f64,
2232+
pub y: f64,
2233+
pub z: f64,
2234+
pub yaw: u8,
2235+
pub pitch: u8,
2236+
pub on_ground: bool,
2237+
}

0 commit comments

Comments
 (0)