Skip to content

Commit

Permalink
add optimized bool
Browse files Browse the repository at this point in the history
  • Loading branch information
suprohub committed Jan 6, 2025
1 parent 81ee044 commit 2bd73e7
Show file tree
Hide file tree
Showing 5 changed files with 291 additions and 153 deletions.
29 changes: 29 additions & 0 deletions pumpkin-config/src/chunk_optimization.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use serde::{Deserialize, Serialize};

// Why needed this?
// if we implement a more cool chunk optimizations we can define it here
// but now its only for rle vec

#[derive(Deserialize, Serialize)]
#[serde(default)]
pub struct ChunkOptimizationConfig {
pub rle_compression: Option<RleCompression>,
}

impl Default for ChunkOptimizationConfig {
fn default() -> Self {
Self {
rle_compression: Some(Default::default()),
}
}
}

#[derive(Deserialize, Serialize)]
#[serde(default)]
pub struct RleCompression {}

impl Default for RleCompression {
fn default() -> Self {
Self {}
}
}
4 changes: 4 additions & 0 deletions pumpkin-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use chunk_optimization::ChunkOptimizationConfig;
use log::warn;
use logging::LoggingConfig;
use pumpkin_core::{Difficulty, GameMode, PermissionLvl};
Expand Down Expand Up @@ -30,6 +31,8 @@ pub mod op;
mod pvp;
mod server_links;

pub mod chunk_optimization;

use networking::NetworkingConfig;
use resource_pack::ResourcePackConfig;

Expand All @@ -48,6 +51,7 @@ pub static BASIC_CONFIG: LazyLock<BasicConfiguration> = LazyLock::new(BasicConfi
#[derive(Deserialize, Serialize, Default)]
#[serde(default)]
pub struct AdvancedConfiguration {
pub chunk_optimization: ChunkOptimizationConfig,
pub logging: LoggingConfig,
pub resource_pack: ResourcePackConfig,
pub networking: NetworkingConfig,
Expand Down
2 changes: 1 addition & 1 deletion pumpkin-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pub mod gamemode;
pub mod math;
pub mod permission;
pub mod rle_vec;
pub mod random;
pub mod rle_vec;
pub mod text;

pub use gamemode::GameMode;
Expand Down
Loading

0 comments on commit 2bd73e7

Please sign in to comment.