8 releases

0.2.5 Feb 14, 2025
0.2.4 Dec 3, 2024
0.2.1 Oct 17, 2024
0.1.1 Aug 25, 2024
0.1.0 Apr 21, 2024

#769 in Parser implementations

Download history 305/week @ 2024-11-28 90/week @ 2024-12-05 18/week @ 2024-12-12 1/week @ 2025-01-02 129/week @ 2025-02-13 4/week @ 2025-02-20 6/week @ 2025-02-27

139 downloads per month
Used in terra-plr-xbox360

AGPL-3.0-or-later

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(File::open("player.plr")?)?;
player.max_life = 300;
player.write_player(File::create("player.plr")?, *SUPPORTED_VERSIONS.end())?;

Set 999 dirt items to first inventory slot

let mut player = Player::read_player(File::open("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(File::create("player.plr")?, *SUPPORTED_VERSIONS.end())?;

Print player name

let mut player = Player::read_player(File::open("player.plr")?)?;
println!("{}", player.name);

License

AGPL v3+ © Filip K.

Dependencies

~3.5MB
~75K SLoC