minecraft-command-types 0.1.0

Provides an AST like structure for Minecraft commands.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use minecraft_command_types_derive::HasMacro;
use ordered_float::NotNan;
use std::fmt::{Display, Formatter};

#[derive(Debug, Clone, Eq, PartialEq, Hash, Ord, PartialOrd, HasMacro)]
pub struct Rotation(pub NotNan<f32>, pub NotNan<f32>);

impl Display for Rotation {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(f, "{} {}", self.0, self.1)
    }
}