1 unstable release
0.1.0 | Apr 21, 2024 |
---|
#1085 in Parser implementations
179 downloads per month
76KB
2.5K
SLoC
terra-plr
Library for reading and modifying terraria player files.
Examples
Change player max life to 300
let mut player = Player::read_player("player.plr")?;
player.max_life = 300;
player.write_player("player.plr", *SUPPORTED_VERSIONS.end())?;
Set 999 dirt items to first inventory slot
let mut player = Player::read_player("player.plr")?;
player.inventory[0][0] = Some(InventorySlot {
item: terra_items::Item::DirtBlock,
prefix: None,
count: PositiveI32::new(999).expect("In bounds"),
is_favorite: false,
});
player.write_player("player.plr", *SUPPORTED_VERSIONS.end())?;
Print player name
let mut player = Player::read_player("player.plr")?;
println!("{}", player.name);
License
AGPL v3+ © Filip K.
Dependencies
~3MB
~69K SLoC