diff --git a/azalea-physics/src/discrete_voxel_shape.rs b/azalea-physics/src/discrete_voxel_shape.rs index 1750612f..13c22de2 100644 --- a/azalea-physics/src/discrete_voxel_shape.rs +++ b/azalea-physics/src/discrete_voxel_shape.rs @@ -43,9 +43,12 @@ pub trait DiscreteVoxelShape { } false } + + // i don't know how to do this properly + fn clone(&self) -> Box; } -#[derive(Default)] +#[derive(Default, Clone)] pub struct BitSetDiscreteVoxelShape { x_size: u32, y_size: u32, @@ -152,4 +155,8 @@ impl DiscreteVoxelShape for BitSetDiscreteVoxelShape { fn last_full_z(&self) -> u32 { self.z_max } + + fn clone(&self) -> Box { + Box::new(Clone::clone(self)) + } } diff --git a/azalea-physics/src/shape.rs b/azalea-physics/src/shape.rs index 4616af9a..52f29d32 100644 --- a/azalea-physics/src/shape.rs +++ b/azalea-physics/src/shape.rs @@ -87,25 +87,25 @@ impl CubeVoxelShape { impl VoxelShape for ArrayVoxelShape { fn shape(&self) -> Box { - todo!() + self.shape.clone() } fn get_x_coords(&self) -> Vec { - todo!() + self.xs.clone() } fn get_y_coords(&self) -> Vec { - todo!() + self.ys.clone() } fn get_z_coords(&self) -> Vec { - todo!() + self.zs.clone() } } impl VoxelShape for CubeVoxelShape { fn shape(&self) -> Box { - todo!() + self.shape.clone() } fn get_x_coords(&self) -> Vec {