diff --git a/crates/horizon-client/src/command/args.rs b/crates/horizon-client/src/command/args.rs index 2d44b4e93..c92c44a33 100644 --- a/crates/horizon-client/src/command/args.rs +++ b/crates/horizon-client/src/command/args.rs @@ -46,6 +46,7 @@ pub struct Registries { pub damage_types: Vec, pub attributes: Vec, pub loot_tables: Vec, + pub templates: Vec, pub random_sequences: Vec, pub datapacks_enabled: Vec, pub datapacks_disabled: Vec, @@ -1926,6 +1927,7 @@ impl ArgType { "damage_types" => reg.damage_types.clone(), "attributes" => reg.attributes.clone(), "loot_tables" => reg.loot_tables.clone(), + "templates" => reg.templates.clone(), "random_sequences" => reg.random_sequences.clone(), "predicates" => reg.predicates.clone(), "time_markers" => reg.time_markers.clone(), diff --git a/crates/horizon-client/src/command/tests.rs b/crates/horizon-client/src/command/tests.rs index 3c10045c7..c7fe6b1fa 100644 --- a/crates/horizon-client/src/command/tests.rs +++ b/crates/horizon-client/src/command/tests.rs @@ -458,3 +458,19 @@ fn world_command_trees() { assert!(run("spreadplayers 0 0 5 0 false @a").is_err()); assert!(run("worldborder warning distance -1").is_err()); } + +#[test] +fn place_template_tree() { + for line in [ + "place template minecraft:igloo/top", + "place template minecraft:igloo/top ~ ~ ~", + "place template minecraft:igloo/top 1 2 3 clockwise_90 left_right 0.5 12 strict", + ] { + assert_eq!( + run(line).unwrap_or_else(|e| panic!("{line}: {e:?}")).0, + "place" + ); + } + assert!(run("place template minecraft:x ~ ~ ~ sideways").is_err()); + assert!(run("place template minecraft:x ~ ~ ~ none none 2").is_err()); +} diff --git a/crates/horizon-client/src/command/tree_world.rs b/crates/horizon-client/src/command/tree_world.rs index da7915c3c..39742bcfe 100644 --- a/crates/horizon-client/src/command/tree_world.rs +++ b/crates/horizon-client/src/command/tree_world.rs @@ -52,6 +52,33 @@ pub fn register(d: &mut Dispatcher, root: usize) { let targets = d.argument(respect, "targets", ENTITIES); d.executes(targets, "spreadplayers"); + // place template