aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/tests/simulation
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-client/tests/simulation')
-rw-r--r--azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs22
-rw-r--r--azalea-client/tests/simulation/client_disconnect.rs4
-rw-r--r--azalea-client/tests/simulation/login_to_dimension_with_same_name.rs24
-rw-r--r--azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs4
-rw-r--r--azalea-client/tests/simulation/receive_start_config_packet.rs4
5 files changed, 29 insertions, 29 deletions
diff --git a/azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs b/azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs
index 2d4fb749..c23ef843 100644
--- a/azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs
+++ b/azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs
@@ -6,7 +6,7 @@ use azalea_protocol::packets::{
config::{ClientboundFinishConfiguration, ClientboundRegistryData},
};
use azalea_registry::{DataRegistry, data::DimensionKind, identifier::Identifier};
-use azalea_world::InstanceName;
+use azalea_world::WorldName;
use simdnbt::owned::{NbtCompound, NbtTag};
#[test]
@@ -19,12 +19,12 @@ fn test_change_dimension_to_nether_and_back() {
fn generic_test_change_dimension_to_nether_and_back(using_respawn: bool) {
let make_basic_login_or_respawn_packet = if using_respawn {
- |dimension: DimensionKind, instance_name: Identifier| {
- make_basic_respawn_packet(dimension, instance_name).into_variant()
+ |dimension: DimensionKind, world_name: Identifier| {
+ make_basic_respawn_packet(dimension, world_name).into_variant()
}
} else {
- |dimension: DimensionKind, instance_name: Identifier| {
- make_basic_login_packet(dimension, instance_name).into_variant()
+ |dimension: DimensionKind, world_name: Identifier| {
+ make_basic_login_packet(dimension, world_name).into_variant()
}
};
@@ -81,9 +81,9 @@ fn generic_test_change_dimension_to_nether_and_back(using_respawn: bool) {
simulation.tick();
assert_eq!(
- *simulation.component::<InstanceName>(),
+ *simulation.component::<WorldName>(),
Identifier::new("azalea:a"),
- "InstanceName should be azalea:a after setting dimension to that"
+ "WorldName should be azalea:a after setting dimension to that"
);
simulation.receive_packet(make_basic_empty_chunk(ChunkPos::new(0, 0), (384 + 64) / 16));
@@ -108,9 +108,9 @@ fn generic_test_change_dimension_to_nether_and_back(using_respawn: bool) {
"chunk should not exist immediately after changing dimensions"
);
assert_eq!(
- *simulation.component::<InstanceName>(),
+ *simulation.component::<WorldName>(),
Identifier::new("azalea:b"),
- "InstanceName should be azalea:b after changing dimensions to that"
+ "WorldName should be azalea:b after changing dimensions to that"
);
simulation.receive_packet(make_basic_empty_chunk(ChunkPos::new(0, 0), 256 / 16));
@@ -136,9 +136,9 @@ fn generic_test_change_dimension_to_nether_and_back(using_respawn: bool) {
simulation.tick();
assert_eq!(
- *simulation.component::<InstanceName>(),
+ *simulation.component::<WorldName>(),
Identifier::new("azalea:a"),
- "InstanceName should be azalea:a after setting dimension back to that"
+ "WorldName should be azalea:a after setting dimension back to that"
);
assert!(
simulation.chunk(ChunkPos::new(0, 0)).is_none(),
diff --git a/azalea-client/tests/simulation/client_disconnect.rs b/azalea-client/tests/simulation/client_disconnect.rs
index 0956fbfa..60f112c2 100644
--- a/azalea-client/tests/simulation/client_disconnect.rs
+++ b/azalea-client/tests/simulation/client_disconnect.rs
@@ -1,6 +1,6 @@
use azalea_client::test_utils::prelude::*;
use azalea_protocol::packets::ConnectionProtocol;
-use azalea_world::InstanceName;
+use azalea_world::WorldName;
#[test]
fn test_client_disconnect() {
@@ -12,7 +12,7 @@ fn test_client_disconnect() {
simulation.tick();
// make sure we're disconnected
- let is_connected = simulation.has_component::<InstanceName>();
+ let is_connected = simulation.has_component::<WorldName>();
assert!(!is_connected);
// tick again to make sure nothing goes wrong
diff --git a/azalea-client/tests/simulation/login_to_dimension_with_same_name.rs b/azalea-client/tests/simulation/login_to_dimension_with_same_name.rs
index 917c50bb..ef67130f 100644
--- a/azalea-client/tests/simulation/login_to_dimension_with_same_name.rs
+++ b/azalea-client/tests/simulation/login_to_dimension_with_same_name.rs
@@ -1,5 +1,5 @@
use azalea_client::{
- InConfigState, InGameState, local_player::InstanceHolder, test_utils::prelude::*,
+ InConfigState, InGameState, local_player::WorldHolder, test_utils::prelude::*,
};
use azalea_core::position::ChunkPos;
use azalea_entity::LocalEntity;
@@ -9,7 +9,7 @@ use azalea_protocol::packets::{
game::ClientboundStartConfiguration,
};
use azalea_registry::{DataRegistry, data::DimensionKind, identifier::Identifier};
-use azalea_world::InstanceName;
+use azalea_world::WorldName;
use simdnbt::owned::{NbtCompound, NbtTag};
#[test]
@@ -22,12 +22,12 @@ fn test_login_to_dimension_with_same_name() {
fn generic_test_login_to_dimension_with_same_name(using_respawn: bool) {
let make_basic_login_or_respawn_packet = if using_respawn {
- |dimension: DimensionKind, instance_name: Identifier| {
- make_basic_respawn_packet(dimension, instance_name).into_variant()
+ |dimension: DimensionKind, world_name: Identifier| {
+ make_basic_respawn_packet(dimension, world_name).into_variant()
}
} else {
- |dimension: DimensionKind, instance_name: Identifier| {
- make_basic_login_packet(dimension, instance_name).into_variant()
+ |dimension: DimensionKind, world_name: Identifier| {
+ make_basic_login_packet(dimension, world_name).into_variant()
}
};
@@ -66,9 +66,9 @@ fn generic_test_login_to_dimension_with_same_name(using_respawn: bool) {
simulation.tick();
assert_eq!(
- *simulation.component::<InstanceName>(),
+ *simulation.component::<WorldName>(),
Identifier::new("azalea:overworld"),
- "InstanceName should be azalea:overworld after setting dimension to that"
+ "WorldName should be azalea:overworld after setting dimension to that"
);
simulation.receive_packet(make_basic_empty_chunk(ChunkPos::new(0, 0), (384 + 64) / 16));
@@ -107,14 +107,14 @@ fn generic_test_login_to_dimension_with_same_name(using_respawn: bool) {
"chunk should not exist immediately after changing dimensions"
);
assert_eq!(
- *simulation.component::<InstanceName>(),
+ *simulation.component::<WorldName>(),
Identifier::new("azalea:overworld"),
- "InstanceName should still be azalea:overworld after changing dimensions to that"
+ "WorldName should still be azalea:overworld after changing dimensions to that"
);
assert_eq!(
simulation
- .component::<InstanceHolder>()
- .instance
+ .component::<WorldHolder>()
+ .shared
.read()
.chunks
.height,
diff --git a/azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs b/azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs
index 13dd38fc..d6b228cb 100644
--- a/azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs
+++ b/azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs
@@ -5,7 +5,7 @@ use azalea_protocol::packets::{
game::{ClientboundAddEntity, ClientboundStartConfiguration},
};
use azalea_registry::builtin::EntityKind;
-use azalea_world::InstanceName;
+use azalea_world::WorldName;
use uuid::Uuid;
#[test]
@@ -15,7 +15,7 @@ fn test_receive_spawn_entity_and_start_config_packet() {
let mut simulation = Simulation::new(ConnectionProtocol::Game);
simulation.receive_packet(default_login_packet());
simulation.tick();
- assert!(simulation.has_component::<InstanceName>());
+ assert!(simulation.has_component::<WorldName>());
simulation.tick();
simulation.receive_packet(ClientboundAddEntity {
diff --git a/azalea-client/tests/simulation/receive_start_config_packet.rs b/azalea-client/tests/simulation/receive_start_config_packet.rs
index f87d65da..a54abe5b 100644
--- a/azalea-client/tests/simulation/receive_start_config_packet.rs
+++ b/azalea-client/tests/simulation/receive_start_config_packet.rs
@@ -1,6 +1,6 @@
use azalea_client::{InConfigState, test_utils::prelude::*};
use azalea_protocol::packets::{ConnectionProtocol, game::ClientboundStartConfiguration};
-use azalea_world::InstanceName;
+use azalea_world::WorldName;
#[test]
fn test_receive_start_config_packet() {
@@ -10,7 +10,7 @@ fn test_receive_start_config_packet() {
simulation.receive_packet(default_login_packet());
simulation.tick();
- assert!(simulation.has_component::<InstanceName>());
+ assert!(simulation.has_component::<WorldName>());
simulation.tick();
simulation.receive_packet(ClientboundStartConfiguration);