-
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
1 parent
734bf35
commit fb662e9
Showing
71 changed files
with
725 additions
and
4,269 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/target | ||
/blockworld-client/assets/minecraft/ | ||
/assets | ||
assets | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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,70 @@ | ||
use crate::io::atlas_helper::UV; | ||
use blockworld_utils::resource_location::str; | ||
|
||
pub type BlockID = u32; | ||
|
||
pub trait Block { | ||
fn texture_name() -> String; | ||
fn hardness() -> f32; | ||
fn material() -> Material; | ||
} | ||
|
||
pub struct Air; | ||
impl Block for Air { | ||
fn texture_name() -> String { | ||
"block/air".to_string() | ||
} | ||
fn hardness() -> f32 { | ||
0.0 | ||
} | ||
fn material() -> Material { | ||
Material::Air | ||
} | ||
} | ||
|
||
pub struct Stone; | ||
impl Block for Stone { | ||
fn texture_name() -> String { | ||
"block/stone".to_string() | ||
} | ||
fn hardness() -> f32 { | ||
1.5 | ||
} | ||
fn material() -> Material { | ||
Material::Solid | ||
} | ||
} | ||
|
||
pub struct Grass; | ||
impl Block for Grass { | ||
fn texture_name() -> String { | ||
"block/grass".to_string() | ||
} | ||
fn hardness() -> f32 { | ||
0.6 | ||
} | ||
fn material() -> Material { | ||
Material::Solid | ||
} | ||
} | ||
|
||
pub struct Dirt; | ||
impl Block for Dirt { | ||
fn texture_name() -> String { | ||
"block/dirt".to_string() | ||
} | ||
fn hardness() -> f32 { | ||
0.5 | ||
} | ||
fn material() -> Material { | ||
Material::Solid | ||
} | ||
} | ||
|
||
#[derive(Debug, Default, Clone, Copy)] | ||
pub enum Material { | ||
#[default] | ||
Solid, | ||
Glass, | ||
Air, | ||
} |
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,2 @@ | ||
mod block; | ||
pub use block::*; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
pub mod atlas_helper; | ||
|
||
pub mod input_helper; | ||
pub mod nbt; | ||
|
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,2 @@ | ||
use std::io::Cursor; | ||
struct a; |
Oops, something went wrong.