diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2026-01-13 10:51:30 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-13 10:51:30 -0600 |
| commit | d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (patch) | |
| tree | ea04702f96ad170fb1d90e5ed2dc875ae8166495 /azalea-client/tests | |
| parent | efb36d5fc0fe56a98f5795c53dfa109887cd5aae (diff) | |
| download | azalea-drasl-d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff.tar.xz | |
Rename Instance to World (#304)
Diffstat (limited to 'azalea-client/tests')
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); |
