1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

Add serde to BlockPos

This commit is contained in:
Shayne Hartford 2024-10-03 01:04:56 -04:00
parent 2992fc6b47
commit 6194c52b88

View file

@ -10,7 +10,8 @@ use std::{
io::{Cursor, Write},
ops::{Add, AddAssign, Mul, Rem, Sub},
};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use crate::resource_location::ResourceLocation;
macro_rules! vec3_impl {
@ -235,6 +236,7 @@ impl Vec3 {
/// The coordinates of a block in the world. For entities (if the coordinate
/// with decimals), use [`Vec3`] instead.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
pub struct BlockPos {
pub x: i32,
pub y: i32,