1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use std::ops::{Deref, DerefMut};

use super::AbstractVehicle;

mod minecart;
pub use minecart::*;
mod abstract_minecart_container;
pub use abstract_minecart_container::*;
mod minecart_furnace;
pub use minecart_furnace::*;
mod minecart_tnt;
pub use minecart_tnt::*;
mod minecart_spawner;
pub use minecart_spawner::*;
mod minecart_command_block;
pub use minecart_command_block::*;

/// An interface to store minecart data
#[derive(PartialEq)]
pub struct AbstractMinecart {
    abstract_vehicle: AbstractVehicle,
    /// The costom block id
    pub custom_block_id: i32,
    /// The custom Y-Position of the block ( in 16ths of a block )
    pub custom_block_y: i32,
    /// Whether the custom block should be shown
    pub show_custom_block: bool,
}
impl Default for AbstractMinecart {
    fn default() -> Self {
        Self {
            abstract_vehicle: AbstractVehicle::default(),
            custom_block_id: 0,
            custom_block_y: 6,
            show_custom_block: false,
        }
    }
}
impl Deref for AbstractMinecart {
    type Target = AbstractVehicle;

    fn deref(&self) -> &Self::Target {
        &self.abstract_vehicle
    }
}
impl DerefMut for AbstractMinecart {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.abstract_vehicle
    }
}