Skip to content

Commit

Permalink
Add serde to BlockPos
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayBox committed Oct 3, 2024
1 parent 2992fc6 commit 6194c52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion azalea-core/src/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6194c52

Please sign in to comment.