30 lines
1004 B
Rust
30 lines
1004 B
Rust
//! Selected-slot drop state for the vanilla key-handler parity harness.
|
|
use horizon_client::command::args::GameMode;
|
|
use horizon_client::items::{ItemStack, take_held_drop};
|
|
|
|
fn main() {
|
|
for mode in [
|
|
GameMode::Survival,
|
|
GameMode::Creative,
|
|
GameMode::Adventure,
|
|
GameMode::Spectator,
|
|
] {
|
|
for all in [false, true] {
|
|
for _selected in [0, 8] {
|
|
for count in [0, 1, 4, 64] {
|
|
let mut slot = Some(ItemStack::new("minecraft:stone", count));
|
|
let mut dropped = 0;
|
|
for _ in 0..2 {
|
|
if let Some(stack) =
|
|
take_held_drop(&mut slot, all, mode == GameMode::Spectator)
|
|
{
|
|
dropped += stack.count;
|
|
}
|
|
println!("{} {}", slot.as_ref().map_or(0, |s| s.count), dropped);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|