Skip to content

Commit

Permalink
💫 Improve config
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixr-codes committed May 2, 2024
1 parent 2d3601e commit 2c5e1a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ pub struct Dependency {
derive(schemars::JsonSchema),
schemars(deny_unknown_fields)
)]
#[serde(rename_all = "kebab-case")]
pub enum Identifier {
/// The name of the dependency to use (e.g. `@minecraft/server`).
ModuleName(String),
Expand Down Expand Up @@ -407,7 +408,7 @@ pub struct SP {
)]
#[serde(rename_all = "kebab-case")]
pub struct WT {
/// Whether to use the `manifest.json` file in the `WR` directory instead of generating one.
/// Whether to use the `manifest.json` file in the `WT` directory instead of generating one.
#[serde(default)]
pub custom_manifest: bool,

Expand All @@ -432,11 +433,4 @@ pub struct WT {
/// Override description for behavior pack.
#[serde(default)]
pub description: Option<OptionallyLocalized<String>>,

/// Define extra dependencies.
///
/// Note that the behavior pack and the resource pack definined in the same project will depend on each
/// other by default.
#[serde(default)]
pub dependencies: Vec<Dependency>,
}
2 changes: 1 addition & 1 deletion src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl From<&config::Dependency> for Dependency {
fn from(value: &config::Dependency) -> Self {
Self {
uuid: match &value.id {
config::Identifier::ModuleName(_) => todo!("module_name key"),
config::Identifier::ModuleName(_) => todo!("module_name key; use UUID instead"),
config::Identifier::Uuid(id) => id.to_string(),
},
version: version_from_string(&value.version),
Expand Down

0 comments on commit 2c5e1a6

Please sign in to comment.