Skip to content

Commit 12cc6b7

Browse files
committed
Fix unit tests
1 parent 782bb00 commit 12cc6b7

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

crates/valence_schem/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ valence_block.workspace = true
1818
valence_core.workspace = true
1919
valence_instance.workspace = true
2020
valence_nbt.workspace = true
21+
22+
[dev-dependencies]
23+
valence.workspace = true

crates/valence_schem/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -957,16 +957,16 @@ impl Schematic {
957957
mod test {
958958
use std::fs;
959959

960+
use valence::prelude::*;
961+
use valence_core::ident;
962+
960963
use super::*;
961964

962965
#[test]
963966
fn schematic_copy_paste() {
964967
let mut app = App::new();
965-
app.add_plugin(ServerPlugin::new(()));
966-
let mut instance = app
967-
.world
968-
.resource::<Server>()
969-
.new_instance(DimensionId::default());
968+
app.add_plugins(DefaultPlugins);
969+
let mut instance = Instance::new_unit_testing(ident!("overworld"), app.world.resource());
970970

971971
for x in -1..=0 {
972972
for z in -1..=0 {
@@ -981,7 +981,7 @@ mod test {
981981
instance.set_block([6, 2, -1], BlockState::STONE);
982982
instance.set_block(
983983
[5, 3, -1],
984-
Block::with_nbt(
984+
ValenceBlock::with_nbt(
985985
BlockState::OAK_SIGN,
986986
compound! {"Text1" => "abc".into_text()},
987987
),
@@ -997,7 +997,7 @@ mod test {
997997
&instance,
998998
(BlockPos::new(4, 3, -1), BlockPos::new(6, 1, 0)),
999999
BlockPos::new(5, 3, 0),
1000-
|_| ident!("minecraft:plains"),
1000+
|_| ident!("minecraft:plains").to_string_ident(),
10011001
);
10021002

10031003
schematic.paste(&mut instance, BlockPos::new(15, 18, 16), |_| {
@@ -1068,7 +1068,7 @@ mod test {
10681068
"Data" => compound!{
10691069
"Text1" => "abc".into_text(),
10701070
},
1071-
"Id" => "sign",
1071+
"Id" => "minecraft:sign",
10721072
"Pos" => vec![1, 2, 0],
10731073
},
10741074
]))

0 commit comments

Comments
 (0)