Add: Basic Combat

This commit is contained in:
Snowiiii committed 2024-08-13 09:16:00 +02:00
1 parent c2bde2f73e
commit 9fc86e260b
15 files changed
+163 -55

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ use lazy_static::lazy_static;
use crate::world::WorldError;
const BLOCKS_JSON: &'static str = include_str!("../blocks.json");
const BLOCKS_JSON: &str = include_str!("../blocks.json");
#[derive(serde::Deserialize, Debug, Clone, PartialEq, Eq)]
struct BlockDefinition {
+2 -3
View File
@@ -25,10 +25,9 @@
// }
// }
use std::{collections::HashMap, io::Write};
use std::collections::HashMap;
use fastnbt::LongArray;
use itertools::Itertools;
use crate::{world::WorldError, WORLD_HEIGHT};
@@ -157,7 +156,7 @@ impl ChunkData {
// }
// dbg!("{}", blocks.iter().filter(|v| **v == 2005).collect_vec().len());
Ok(ChunkData {
blocks: blocks,
blocks,
position: at,
heightmaps: chunk_data.heightmaps,
})
+3 -3
View File
@@ -1,15 +1,15 @@
use std::{collections::VecDeque, future, io::Read, path::PathBuf, sync::Arc};
use std::{io::Read, path::PathBuf, sync::Arc};
use flate2::bufread::ZlibDecoder;
use itertools::Itertools;
use thiserror::Error;
use tokio::{
fs::File,
io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt},
io::{AsyncReadExt, AsyncSeekExt},
sync::Mutex,
};
use crate::{chunk::ChunkData, dimension::Dimension};
use crate::chunk::ChunkData;
pub struct Level {
root_folder: PathBuf,