Skip to content

Commit

Permalink
track
Browse files Browse the repository at this point in the history
  • Loading branch information
BreakingLead committed Aug 9, 2024
1 parent 734bf35 commit fb662e9
Show file tree
Hide file tree
Showing 71 changed files with 725 additions and 4,269 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target
/blockworld-client/assets/minecraft/
/assets
assets

1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions blockworld-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
blockworld-utils = { path = "../blockworld-utils" }

anyhow = "1.0.83"
bytemuck = { version = "1.15.0", features = ["derive"] }
clap = { version = "4.5.4", features = ["derive"] }
Expand Down
Binary file removed blockworld-client/assets/atlas.png
Binary file not shown.
Binary file removed blockworld-client/assets/fonts/Minecraft.otf
Binary file not shown.
Binary file removed blockworld-client/assets/fonts/Minecraft_B.otf
Binary file not shown.
Binary file removed blockworld-client/assets/fonts/Minecraft_BI.otf
Binary file not shown.
Binary file removed blockworld-client/assets/fonts/Minecraft_I.otf
Binary file not shown.
4 changes: 0 additions & 4 deletions blockworld-client/assets/readme.md

This file was deleted.

70 changes: 70 additions & 0 deletions blockworld-client/block/block.rs
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,
}
2 changes: 2 additions & 0 deletions blockworld-client/block/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod block;
pub use block::*;
51 changes: 0 additions & 51 deletions blockworld-client/game/block.rs

This file was deleted.

157 changes: 0 additions & 157 deletions blockworld-client/game/chunk.rs

This file was deleted.

22 changes: 2 additions & 20 deletions blockworld-client/game/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
use self::player_state::PlayerState;
use crate::io::input_helper::InputState;
use std::rc::Rc;

use chunk_provider::ClientChunkProvider;
use world::ClientWorld;

use crate::io::input_helper::InputState;

use self::player_state::PlayerState;

pub mod block;
pub mod chunk;
pub mod chunk_provider;
pub mod console_instr;
pub mod player_state;
pub mod register;
Expand All @@ -21,17 +14,6 @@ pub struct Game {
pub client_world: Rc<ClientWorld>,
pub chunk_provider: ClientChunkProvider,
}
impl Default for Game {
fn default() -> Self {
let client_world = Rc::new(ClientWorld);
Self {
player_state: Default::default(),
client_world: client_world.clone(),
// ! TEMP
chunk_provider: ClientChunkProvider::new(client_world.clone(), 16),
}
}
}

impl Game {
/// update all entity states in game (except for camera)
Expand Down
9 changes: 3 additions & 6 deletions blockworld-client/game/register.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
use std::collections::HashMap;

use crate::block::*;
use anyhow::Error;

use block::{BlockID, BlockMeta};

use super::block;
use std::collections::HashMap;

#[derive(Debug)]
pub struct RegisterTable {
pub struct BlockRegisterTable {
table_block: HashMap<BlockID, BlockMeta>,
}

Expand Down
3 changes: 3 additions & 0 deletions blockworld-client/io/mod.rs
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;

2 changes: 2 additions & 0 deletions blockworld-client/io/nbt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use std::io::Cursor;
struct a;
Loading

0 comments on commit fb662e9

Please sign in to comment.