From e7dd15183395d0aeb34b6f2c3e2f421597a3612c Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 9 Jul 2019 17:08:43 +0100 Subject: [PATCH] Added fruit trees --- assets/world/tree/fruit/1.vox | 3 +++ assets/world/tree/fruit/2.vox | 3 +++ assets/world/tree/fruit/3.vox | 3 +++ assets/world/tree/fruit/4.vox | 3 +++ assets/world/tree/fruit/5.vox | 3 +++ assets/world/tree/fruit/6.vox | 3 +++ common/src/terrain/structure.rs | 2 ++ world/src/block/mod.rs | 5 +++++ world/src/block/natural.rs | 11 +++++++++++ 9 files changed, 36 insertions(+) create mode 100644 assets/world/tree/fruit/1.vox create mode 100644 assets/world/tree/fruit/2.vox create mode 100644 assets/world/tree/fruit/3.vox create mode 100644 assets/world/tree/fruit/4.vox create mode 100644 assets/world/tree/fruit/5.vox create mode 100644 assets/world/tree/fruit/6.vox diff --git a/assets/world/tree/fruit/1.vox b/assets/world/tree/fruit/1.vox new file mode 100644 index 0000000000..4c6a550088 --- /dev/null +++ b/assets/world/tree/fruit/1.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29f4e1cb1a389e1e7094ca59115189354fb8c008661a17d2fbe45dbf15f8da45 +size 45145 diff --git a/assets/world/tree/fruit/2.vox b/assets/world/tree/fruit/2.vox new file mode 100644 index 0000000000..46c60c36e6 --- /dev/null +++ b/assets/world/tree/fruit/2.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:086d818f8d0f0b53564f68e29b5176293e4d5ddd4e044f60e2aec0997196d709 +size 45361 diff --git a/assets/world/tree/fruit/3.vox b/assets/world/tree/fruit/3.vox new file mode 100644 index 0000000000..5a74e9e95a --- /dev/null +++ b/assets/world/tree/fruit/3.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f22e491dd240f64655d72caf2f6cc70b607b2506dc10fb965aafe23b13ebde99 +size 45357 diff --git a/assets/world/tree/fruit/4.vox b/assets/world/tree/fruit/4.vox new file mode 100644 index 0000000000..3608cbabd0 --- /dev/null +++ b/assets/world/tree/fruit/4.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72e75bd106009dc57f31e4ca52dba70dfed2f8c6d38780473b41df4d70001d46 +size 45009 diff --git a/assets/world/tree/fruit/5.vox b/assets/world/tree/fruit/5.vox new file mode 100644 index 0000000000..3380acc31e --- /dev/null +++ b/assets/world/tree/fruit/5.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98eeb7f435816700b8d4f9db6265732a6c760bd524ad32a4db471fe993c9f4bc +size 45001 diff --git a/assets/world/tree/fruit/6.vox b/assets/world/tree/fruit/6.vox new file mode 100644 index 0000000000..dff9b9d188 --- /dev/null +++ b/assets/world/tree/fruit/6.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51c4772b406bd878555be294e3699308b85062b9ce3624161b51f2e2c3ca5a62 +size 45177 diff --git a/common/src/terrain/structure.rs b/common/src/terrain/structure.rs index c84041bf19..4d386c9743 100644 --- a/common/src/terrain/structure.rs +++ b/common/src/terrain/structure.rs @@ -14,6 +14,7 @@ pub enum StructureBlock { PineLeaves, Acacia, PalmLeaves, + Fruit, Block(Block), } @@ -92,6 +93,7 @@ impl Asset for Structure { 1 => StructureBlock::PineLeaves, 2 => StructureBlock::PalmLeaves, 4 => StructureBlock::Acacia, + 7 => StructureBlock::Fruit, index => { let color = palette .get(index as usize) diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 9e481f6b2a..8913da883d 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -327,6 +327,11 @@ impl<'a> BlockGen<'a> { ) .map(|e| e as u8), ), + StructureBlock::Fruit => Block::new( + 1, + Lerp::lerp(Rgb::new(255.0, 0.0, 0.0), Rgb::new(200.0, 255.0, 6.0), lerp) + .map(|e| e as u8), + ), StructureBlock::Block(block) => block, } } diff --git a/world/src/block/natural.rs b/world/src/block/natural.rs index f496b355a5..55e1ae80e8 100644 --- a/world/src/block/natural.rs +++ b/world/src/block/natural.rs @@ -54,6 +54,7 @@ pub fn structure_gen<'a>( ForestKind::Palm => &PALMS, ForestKind::Savannah => &ACACIAS, ForestKind::Oak if QUIRKY_RAND.get(st_seed) % 16 == 7 => &OAK_STUMPS, + ForestKind::Oak if QUIRKY_RAND.get(st_seed) % 8 == 7 => &FRUIT_TREES, ForestKind::Oak => &OAKS, ForestKind::Pine => &PINES, ForestKind::SnowPine => &SNOW_PINES, @@ -371,6 +372,16 @@ lazy_static! { st_asset("world/tree/acacia/5.vox", (19, 18, 1)), ]; + pub static ref FRUIT_TREES: Vec> = vec![ + // snow pines + st_asset("world/tree/fruit/1.vox", (5, 5, 7)), + st_asset("world/tree/fruit/2.vox", (5, 5, 7)), + st_asset("world/tree/fruit/3.vox", (5, 5, 7)), + st_asset("world/tree/fruit/4.vox", (5, 5, 7)), + st_asset("world/tree/fruit/5.vox", (5, 5, 7)), + st_asset("world/tree/fruit/6.vox", (5, 5, 7)), + ]; + /* // snow birches -> need roots! assets::load_map("world/tree/snow_birch/1.vox", |s: Structure| s