-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
267 additions
and
158 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
# player-mover | ||
プレイヤーの座標を編集するMinecraftのツールです。 | ||
[English](./README.md) / [日本語](./README_ja.md) | ||
|
||
## 使い方 | ||
A Minecraft tool to edit player positions. | ||
|
||
## Usage | ||
``` | ||
player_mover <WORLD> [CHANGE_POSITION] [CHANGE_DIMENSION] | ||
``` | ||
- WORLD (必須) | ||
- ワールドディレクトリ | ||
- CHANGE_POSITION (任意) | ||
- 指定した座標にプレイヤーを移動させます。 | ||
- 形式: x,y,z | ||
- 指定していない場合はスポーン座標に移動させます | ||
- CHANGE_DIMENSION (任意) | ||
- 指定したディメンションにプレイヤーを移動させます | ||
- 指定していない場合はオーバーワールドに移動させます | ||
|
||
- WORLD (required) | ||
- World directory | ||
- CHANGE_POSITION (optional) | ||
- Moves the player to the specified position. | ||
- Format: x,y,z | ||
- If not specified, the player is moved to the spawn position. | ||
- CHANGE_DIMENSION (optional) | ||
- Moves the player to the specified dimension. | ||
- If not specified, the player is moved to the Overworld. |
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 @@ | ||
# player-mover | ||
[English](./README.md) / [日本語](./README_ja.md) | ||
|
||
プレイヤーの座標を編集するMinecraftのツールです。 | ||
|
||
## 使い方 | ||
``` | ||
player_mover <WORLD> [CHANGE_POSITION] [CHANGE_DIMENSION] | ||
``` | ||
- WORLD (必須) | ||
- ワールドディレクトリ | ||
- CHANGE_POSITION (任意) | ||
- 指定した座標にプレイヤーを移動させます。 | ||
- 形式: x,y,z | ||
- 指定していない場合はスポーン座標に移動させます | ||
- CHANGE_DIMENSION (任意) | ||
- 指定したディメンションにプレイヤーを移動させます | ||
- 指定していない場合はオーバーワールドに移動させます |
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,25 @@ | ||
use std::error::Error; | ||
|
||
use serde::Deserialize; | ||
|
||
#[derive(Deserialize)] | ||
struct Player { | ||
name: String, | ||
} | ||
|
||
pub fn fetch_player_name(uuid: &str) -> Result<String, Box<dyn Error>> { | ||
let player: Player = ureq::get(&format!( | ||
"https://sessionserver.mojang.com/session/minecraft/profile/{}", | ||
uuid.replace('-', "").to_lowercase() | ||
)) | ||
.call()? | ||
.into_json()?; | ||
|
||
Ok(player.name) | ||
} | ||
|
||
#[test] | ||
fn test_fetch_player_name() { | ||
let name = fetch_player_name("069a79f4-44e9-4726-a5be-fca90e38aaf5").unwrap(); | ||
assert_eq!(name, "Notch"); | ||
} |
Oops, something went wrong.