pub struct Server {
pub plugin_id: String,
pub sender: Sender<PluginToHost>,
}Fields§
§plugin_id: String§sender: Sender<PluginToHost>Implementations§
Source§impl Server
impl Server
Sourcepub async fn send_chat(
&self,
target_uuid: String,
message: String,
) -> Result<(), SendError<PluginToHost>>
pub async fn send_chat( &self, target_uuid: String, message: String, ) -> Result<(), SendError<PluginToHost>>
Sends a SendChat action to the server.
Sourcepub async fn teleport(
&self,
player_uuid: String,
position: Option<Vec3>,
rotation: Option<Vec3>,
) -> Result<(), SendError<PluginToHost>>
pub async fn teleport( &self, player_uuid: String, position: Option<Vec3>, rotation: Option<Vec3>, ) -> Result<(), SendError<PluginToHost>>
Sends a Teleport action to the server.
Sourcepub async fn kick(
&self,
player_uuid: String,
reason: String,
) -> Result<(), SendError<PluginToHost>>
pub async fn kick( &self, player_uuid: String, reason: String, ) -> Result<(), SendError<PluginToHost>>
Sends a Kick action to the server.
Sourcepub async fn set_game_mode(
&self,
player_uuid: String,
game_mode: i32,
) -> Result<(), SendError<PluginToHost>>
pub async fn set_game_mode( &self, player_uuid: String, game_mode: i32, ) -> Result<(), SendError<PluginToHost>>
Sends a SetGameMode action to the server.
Sourcepub async fn give_item(
&self,
player_uuid: String,
item: Option<ItemStack>,
) -> Result<(), SendError<PluginToHost>>
pub async fn give_item( &self, player_uuid: String, item: Option<ItemStack>, ) -> Result<(), SendError<PluginToHost>>
Sends a GiveItem action to the server.
Sourcepub async fn clear_inventory(
&self,
player_uuid: String,
) -> Result<(), SendError<PluginToHost>>
pub async fn clear_inventory( &self, player_uuid: String, ) -> Result<(), SendError<PluginToHost>>
Sends a ClearInventory action to the server.
Sourcepub async fn set_held_item(
&self,
player_uuid: String,
main: Option<ItemStack>,
offhand: Option<ItemStack>,
) -> Result<(), SendError<PluginToHost>>
pub async fn set_held_item( &self, player_uuid: String, main: Option<ItemStack>, offhand: Option<ItemStack>, ) -> Result<(), SendError<PluginToHost>>
Sends a SetHeldItem action to the server.
Sourcepub async fn set_health(
&self,
player_uuid: String,
health: f64,
max_health: Option<f64>,
) -> Result<(), SendError<PluginToHost>>
pub async fn set_health( &self, player_uuid: String, health: f64, max_health: Option<f64>, ) -> Result<(), SendError<PluginToHost>>
Sends a SetHealth action to the server.
Sourcepub async fn set_food(
&self,
player_uuid: String,
food: i32,
) -> Result<(), SendError<PluginToHost>>
pub async fn set_food( &self, player_uuid: String, food: i32, ) -> Result<(), SendError<PluginToHost>>
Sends a SetFood action to the server.
Sourcepub async fn set_experience(
&self,
player_uuid: String,
level: Option<i32>,
progress: Option<f32>,
amount: Option<i32>,
) -> Result<(), SendError<PluginToHost>>
pub async fn set_experience( &self, player_uuid: String, level: Option<i32>, progress: Option<f32>, amount: Option<i32>, ) -> Result<(), SendError<PluginToHost>>
Sends a SetExperience action to the server.
Sourcepub async fn set_velocity(
&self,
player_uuid: String,
velocity: Option<Vec3>,
) -> Result<(), SendError<PluginToHost>>
pub async fn set_velocity( &self, player_uuid: String, velocity: Option<Vec3>, ) -> Result<(), SendError<PluginToHost>>
Sends a SetVelocity action to the server.
Sourcepub async fn add_effect(
&self,
player_uuid: String,
effect_type: i32,
level: i32,
duration_ms: i64,
show_particles: bool,
) -> Result<(), SendError<PluginToHost>>
pub async fn add_effect( &self, player_uuid: String, effect_type: i32, level: i32, duration_ms: i64, show_particles: bool, ) -> Result<(), SendError<PluginToHost>>
Sends a AddEffect action to the server.
Sourcepub async fn remove_effect(
&self,
player_uuid: String,
effect_type: i32,
) -> Result<(), SendError<PluginToHost>>
pub async fn remove_effect( &self, player_uuid: String, effect_type: i32, ) -> Result<(), SendError<PluginToHost>>
Sends a RemoveEffect action to the server.
Sourcepub async fn send_title(
&self,
player_uuid: String,
title: String,
subtitle: Option<String>,
fade_in_ms: Option<i64>,
duration_ms: Option<i64>,
fade_out_ms: Option<i64>,
) -> Result<(), SendError<PluginToHost>>
pub async fn send_title( &self, player_uuid: String, title: String, subtitle: Option<String>, fade_in_ms: Option<i64>, duration_ms: Option<i64>, fade_out_ms: Option<i64>, ) -> Result<(), SendError<PluginToHost>>
Sends a SendTitle action to the server.
Sourcepub async fn send_popup(
&self,
player_uuid: String,
message: String,
) -> Result<(), SendError<PluginToHost>>
pub async fn send_popup( &self, player_uuid: String, message: String, ) -> Result<(), SendError<PluginToHost>>
Sends a SendPopup action to the server.
Sourcepub async fn send_tip(
&self,
player_uuid: String,
message: String,
) -> Result<(), SendError<PluginToHost>>
pub async fn send_tip( &self, player_uuid: String, message: String, ) -> Result<(), SendError<PluginToHost>>
Sends a SendTip action to the server.
Sourcepub async fn play_sound(
&self,
player_uuid: String,
sound: i32,
position: Option<Vec3>,
volume: Option<f32>,
pitch: Option<f32>,
) -> Result<(), SendError<PluginToHost>>
pub async fn play_sound( &self, player_uuid: String, sound: i32, position: Option<Vec3>, volume: Option<f32>, pitch: Option<f32>, ) -> Result<(), SendError<PluginToHost>>
Sends a PlaySound action to the server.
Sourcepub async fn execute_command(
&self,
player_uuid: String,
command: String,
) -> Result<(), SendError<PluginToHost>>
pub async fn execute_command( &self, player_uuid: String, command: String, ) -> Result<(), SendError<PluginToHost>>
Sends a ExecuteCommand action to the server.
Sourcepub async fn world_set_default_game_mode(
&self,
world: Option<WorldRef>,
game_mode: i32,
) -> Result<(), SendError<PluginToHost>>
pub async fn world_set_default_game_mode( &self, world: Option<WorldRef>, game_mode: i32, ) -> Result<(), SendError<PluginToHost>>
Sends a WorldSetDefaultGameMode action to the server.
Sourcepub async fn world_set_difficulty(
&self,
world: Option<WorldRef>,
difficulty: i32,
) -> Result<(), SendError<PluginToHost>>
pub async fn world_set_difficulty( &self, world: Option<WorldRef>, difficulty: i32, ) -> Result<(), SendError<PluginToHost>>
Sends a WorldSetDifficulty action to the server.
Sourcepub async fn world_set_tick_range(
&self,
world: Option<WorldRef>,
tick_range: i32,
) -> Result<(), SendError<PluginToHost>>
pub async fn world_set_tick_range( &self, world: Option<WorldRef>, tick_range: i32, ) -> Result<(), SendError<PluginToHost>>
Sends a WorldSetTickRange action to the server.
Sourcepub async fn world_set_block(
&self,
world: Option<WorldRef>,
position: Option<BlockPos>,
block: Option<BlockState>,
) -> Result<(), SendError<PluginToHost>>
pub async fn world_set_block( &self, world: Option<WorldRef>, position: Option<BlockPos>, block: Option<BlockState>, ) -> Result<(), SendError<PluginToHost>>
Sends a WorldSetBlock action to the server.
Sourcepub async fn world_play_sound(
&self,
world: Option<WorldRef>,
sound: i32,
position: Option<Vec3>,
) -> Result<(), SendError<PluginToHost>>
pub async fn world_play_sound( &self, world: Option<WorldRef>, sound: i32, position: Option<Vec3>, ) -> Result<(), SendError<PluginToHost>>
Sends a WorldPlaySound action to the server.
Sourcepub async fn world_add_particle(
&self,
world: Option<WorldRef>,
position: Option<Vec3>,
particle: i32,
block: Option<BlockState>,
face: Option<i32>,
) -> Result<(), SendError<PluginToHost>>
pub async fn world_add_particle( &self, world: Option<WorldRef>, position: Option<Vec3>, particle: i32, block: Option<BlockState>, face: Option<i32>, ) -> Result<(), SendError<PluginToHost>>
Sends a WorldAddParticle action to the server.
Sourcepub async fn world_query_entities(
&self,
world: Option<WorldRef>,
) -> Result<(), SendError<PluginToHost>>
pub async fn world_query_entities( &self, world: Option<WorldRef>, ) -> Result<(), SendError<PluginToHost>>
Sends a WorldQueryEntities action to the server.
Sourcepub async fn world_query_players(
&self,
world: Option<WorldRef>,
) -> Result<(), SendError<PluginToHost>>
pub async fn world_query_players( &self, world: Option<WorldRef>, ) -> Result<(), SendError<PluginToHost>>
Sends a WorldQueryPlayers action to the server.
Sourcepub async fn world_query_entities_within(
&self,
world: Option<WorldRef>,
box: Option<BBox>,
) -> Result<(), SendError<PluginToHost>>
pub async fn world_query_entities_within( &self, world: Option<WorldRef>, box: Option<BBox>, ) -> Result<(), SendError<PluginToHost>>
Sends a WorldQueryEntitiesWithin action to the server.
Source§impl Server
impl Server
Sourcepub async fn send_action(
&self,
kind: Kind,
) -> Result<(), SendError<PluginToHost>>
pub async fn send_action( &self, kind: Kind, ) -> Result<(), SendError<PluginToHost>>
Helper to build and send a single action.
Sourcepub async fn send_actions(
&self,
actions: Vec<Action>,
) -> Result<(), SendError<PluginToHost>>
pub async fn send_actions( &self, actions: Vec<Action>, ) -> Result<(), SendError<PluginToHost>>
Helper to send a batch of actions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnwindSafe for Server
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request