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
use std::ops::{Deref, DerefMut};

use nbt_lib::datatypes::TextComponent;

use super::AbstractMinecart;

/// An instance of a minecart that carries a command block
#[derive(PartialEq, Default)]
pub struct MinecartCommandBlock {
    abstract_minecart: AbstractMinecart,
    /// The command of the command block
    pub command: String,
    /// The last output of the command block
    pub last_output: TextComponent,
}
impl Deref for MinecartCommandBlock {
    type Target = AbstractMinecart;

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