-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
127 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use crate::block::leaves::LeavesProperties; | ||
use crate::block::*; | ||
use crate::{block_def, block_state}; | ||
use serde_derive::Deserialize; | ||
|
||
pub const BIRCH_LEAVES: &str = "minecraft:birch_leaves"; | ||
block_def! { | ||
BirchLeaves, | ||
BlockBuilder::new::<BirchLeavesBlockState>(BIRCH_LEAVES, BlockSettings::new().strength(0.2)) | ||
} | ||
block_state!(BirchLeavesBlockState, LeavesProperties, BIRCH_LEAVES); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use crate::block::logs::LogProperties; | ||
use crate::block::*; | ||
use crate::block_state; | ||
use serde_derive::Deserialize; | ||
|
||
pub const BIRCH_LOG: &str = "minecraft:birch_log"; | ||
pub struct BirchLog { | ||
pub builder: BlockBuilder, | ||
} | ||
impl Block for BirchLog { | ||
fn get_builder(&self) -> &BlockBuilder { | ||
&self.builder | ||
} | ||
} | ||
|
||
impl BirchLog { | ||
pub(crate) fn new() -> BirchLog { | ||
BirchLog { | ||
builder: BlockBuilder::new::<BirchLogBlockState>( | ||
BIRCH_LOG, | ||
BlockSettings::new().strength(2.0), | ||
), | ||
} | ||
} | ||
} | ||
|
||
block_state!(BirchLogBlockState, LogProperties, BIRCH_LOG); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use serde_derive::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize)] | ||
pub enum Distance { | ||
#[serde(rename = "0")] | ||
D0, | ||
#[serde(rename = "1")] | ||
D1, | ||
#[serde(rename = "2")] | ||
D2, | ||
#[serde(rename = "3")] | ||
D3, | ||
#[serde(rename = "4")] | ||
D4, | ||
#[serde(rename = "5")] | ||
D5, | ||
#[serde(rename = "6")] | ||
D6, | ||
#[serde(rename = "7")] | ||
D7, | ||
} | ||
|
||
#[derive(Serialize, Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize)] | ||
pub struct LeavesProperties { | ||
distance: Distance, | ||
persistent: bool, | ||
waterlogged: bool, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use serde_derive::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize)] | ||
pub enum Axis { | ||
#[serde(rename = "x")] | ||
X, | ||
#[serde(rename = "y")] | ||
Y, | ||
#[serde(rename = "z")] | ||
Z, | ||
} | ||
|
||
#[derive(Serialize, Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize)] | ||
pub struct LogProperties { | ||
axis: Axis, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use crate::block::leaves::LeavesProperties; | ||
use crate::block::*; | ||
use crate::{block_def, block_state}; | ||
use serde_derive::Deserialize; | ||
|
||
pub const OAK_LEAVES: &str = "minecraft:oak_leaves"; | ||
block_def! { | ||
OakLeaves, | ||
BlockBuilder::new::<OakLeavesBlockState>(OAK_LEAVES, BlockSettings::new().strength(0.2)) | ||
} | ||
block_state!(OakLeavesBlockState, LeavesProperties, OAK_LEAVES); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters