-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added packets * Created worldborder struct * Added worldborder command * Improved worldborder command Added messages to worldborder command Removed all .unwrap() Created consumer for command * Fixed small issue /worldborder add wasn't working properly
- Loading branch information
Showing
18 changed files
with
1,118 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
pumpkin-protocol/src/client/play/c_initialize_world_border.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use pumpkin_macros::client_packet; | ||
use serde::Serialize; | ||
|
||
use crate::{VarInt, VarLong}; | ||
|
||
use super::ClientboundPlayPackets; | ||
|
||
#[derive(Serialize)] | ||
#[client_packet(ClientboundPlayPackets::InitializeWorldBorder as i32)] | ||
pub struct CInitializeWorldBorder { | ||
x: f64, | ||
z: f64, | ||
old_diameter: f64, | ||
new_diameter: f64, | ||
speed: VarLong, | ||
portal_teleport_boundary: VarInt, | ||
warning_blocks: VarInt, | ||
warning_time: VarInt, | ||
} | ||
|
||
impl CInitializeWorldBorder { | ||
#[expect(clippy::too_many_arguments)] | ||
pub fn new( | ||
x: f64, | ||
z: f64, | ||
old_diameter: f64, | ||
new_diameter: f64, | ||
speed: VarLong, | ||
portal_teleport_boundary: VarInt, | ||
warning_blocks: VarInt, | ||
warning_time: VarInt, | ||
) -> Self { | ||
Self { | ||
x, | ||
z, | ||
old_diameter, | ||
new_diameter, | ||
speed, | ||
portal_teleport_boundary, | ||
warning_blocks, | ||
warning_time, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use pumpkin_macros::client_packet; | ||
use serde::Serialize; | ||
|
||
use super::ClientboundPlayPackets; | ||
|
||
#[derive(Serialize)] | ||
#[client_packet(ClientboundPlayPackets::WorldBorderCenter as i32)] | ||
pub struct CSetBorderCenter { | ||
x: f64, | ||
z: f64, | ||
} | ||
|
||
impl CSetBorderCenter { | ||
pub fn new(x: f64, z: f64) -> Self { | ||
Self { x, z } | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
pumpkin-protocol/src/client/play/c_set_border_lerp_size.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use pumpkin_macros::client_packet; | ||
use serde::Serialize; | ||
|
||
use crate::VarLong; | ||
|
||
use super::ClientboundPlayPackets; | ||
|
||
#[derive(Serialize)] | ||
#[client_packet(ClientboundPlayPackets::WorldBorderLerpSize as i32)] | ||
pub struct CSetBorderLerpSize { | ||
old_diameter: f64, | ||
new_diameter: f64, | ||
speed: VarLong, | ||
} | ||
|
||
impl CSetBorderLerpSize { | ||
pub fn new(old_diameter: f64, new_diameter: f64, speed: VarLong) -> Self { | ||
Self { | ||
old_diameter, | ||
new_diameter, | ||
speed, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use pumpkin_macros::client_packet; | ||
use serde::Serialize; | ||
|
||
use super::ClientboundPlayPackets; | ||
|
||
#[derive(Serialize)] | ||
#[client_packet(ClientboundPlayPackets::WorldBorderSize as i32)] | ||
pub struct CSetBorderSize { | ||
diameter: f64, | ||
} | ||
|
||
impl CSetBorderSize { | ||
pub fn new(diameter: f64) -> Self { | ||
Self { diameter } | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
pumpkin-protocol/src/client/play/c_set_border_warning_delay.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use pumpkin_macros::client_packet; | ||
use serde::Serialize; | ||
|
||
use crate::VarInt; | ||
|
||
use super::ClientboundPlayPackets; | ||
|
||
#[derive(Serialize)] | ||
#[client_packet(ClientboundPlayPackets::WorldBorderWarningDelay as i32)] | ||
pub struct CSetBorderWarningDelay { | ||
warning_time: VarInt, | ||
} | ||
|
||
impl CSetBorderWarningDelay { | ||
pub fn new(warning_time: VarInt) -> Self { | ||
Self { warning_time } | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
pumpkin-protocol/src/client/play/c_set_border_warning_distance.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use pumpkin_macros::client_packet; | ||
use serde::Serialize; | ||
|
||
use crate::VarInt; | ||
|
||
use super::ClientboundPlayPackets; | ||
|
||
#[derive(Serialize)] | ||
#[client_packet(ClientboundPlayPackets::WorldBorderWarningReach as i32)] | ||
pub struct CSetBorderWarningDistance { | ||
warning_blocks: VarInt, | ||
} | ||
|
||
impl CSetBorderWarningDistance { | ||
pub fn new(warning_blocks: VarInt) -> Self { | ||
Self { warning_blocks } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.