Compare commits
1 Commits
811d715082
...
b9c319165e
Author | SHA1 | Date |
---|---|---|
|
b9c319165e |
|
@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Added
|
||||
- support for commands using macros
|
||||
- support for registering scoreboards (automatic creation and deletion)
|
||||
|
||||
### Changed
|
||||
- use "return" command for conditionals instead of data storage when using supported pack format
|
||||
|
|
|
@ -128,12 +128,6 @@ impl Datapack {
|
|||
);
|
||||
}
|
||||
|
||||
/// Scoreboards registered in the datapack.
|
||||
#[must_use]
|
||||
pub fn scoreboards(&self) -> &BTreeMap<String, (Option<String>, Option<String>)> {
|
||||
&self.scoreboards
|
||||
}
|
||||
|
||||
/// Add a custom file to the datapack.
|
||||
pub fn add_custom_file(&mut self, path: &str, file: VFile) {
|
||||
self.custom_files.add_file(path, file);
|
||||
|
@ -170,7 +164,7 @@ impl Datapack {
|
|||
.or_insert_with(|| Cow::Owned(Namespace::new(&self.main_namespace_name)));
|
||||
let register_scoreboard_function = main_namespace
|
||||
.to_mut()
|
||||
.function_mut("sb/register_scoreboards");
|
||||
.function_mut("shu/register_scoreboards");
|
||||
for (name, (criteria, display_name)) in &self.scoreboards {
|
||||
let mut creation_command = format!(
|
||||
"scoreboard objectives add {name} {criteria}",
|
||||
|
@ -195,13 +189,12 @@ impl Datapack {
|
|||
.to_mut()
|
||||
.tag_mut("load", tag::TagType::Function)
|
||||
.add_value(tag::TagValue::Simple(format!(
|
||||
"{}:sb/register_scoreboards",
|
||||
"{}:shu/register_scoreboards",
|
||||
self.main_namespace_name
|
||||
)));
|
||||
}
|
||||
|
||||
if let Some(uninstall_commands) = uninstall_commands {
|
||||
if !uninstall_commands.is_empty() {
|
||||
let main_namespace = modified_namespaces
|
||||
.entry(&self.main_namespace_name)
|
||||
.or_insert_with(|| Cow::Owned(Namespace::new(&self.main_namespace_name)));
|
||||
|
@ -210,7 +203,9 @@ impl Datapack {
|
|||
.get_commands_mut()
|
||||
.extend(uninstall_commands);
|
||||
}
|
||||
}
|
||||
|
||||
dbg!(&self.namespaces);
|
||||
dbg!(&modified_namespaces);
|
||||
|
||||
// Compile namespaces
|
||||
for (name, namespace) in modified_namespaces {
|
||||
|
|
Loading…
Reference in New Issue