MCPcopy Create free account
hub / github.com/Vulae/pkmc / execute

Method execute

examples/server/src/player/command.rs:109–124  ·  view source on GitHub ↗
(self, player: &mut Player)

Source from the content-addressed store, hash-verified

107
108impl PlayerExecutableCommand for CommandGoto {
109 fn execute(self, player: &mut Player) -> Result<(), PlayerError> {
110 if let Some(dimension) = self.dimension {
111 match player.set_dimension(dimension.into(), self.position) {
112 Err(PlayerError::CouldNotFindDimension(dimension)) => {
113 player.system_message(format!(
114 "Could not find dimension \"{:?}\"",
115 dimension.name()
116 ))?;
117 }
118 res => res?,
119 }
120 } else {
121 player.teleport(self.position)?;
122 }
123 Ok(())
124 }
125}
126
127#[derive(Debug)]

Callers 2

execute_commandMethod · 0.80

Calls 8

set_dimensionMethod · 0.80
system_messageMethod · 0.80
teleportMethod · 0.80
lockMethod · 0.80
query_block_dataMethod · 0.80
get_blockMethod · 0.80
is_airMethod · 0.80
set_blockMethod · 0.80

Tested by

no test coverage detected