aboutsummaryrefslogtreecommitdiff
path: root/azalea-physics/tests
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2025-12-12 00:56:02 -0600
committerGitHub <noreply@github.com>2025-12-12 00:56:02 -0600
commitf9c25665c203d6377ace62f1e95381d037d8fd9e (patch)
tree8b4131d20fe661d3cc1175ec27f801fe61df41ea /azalea-physics/tests
parent82ad975242292d5875780b4398b62637674bf50a (diff)
downloadazalea-drasl-f9c25665c203d6377ace62f1e95381d037d8fd9e.tar.xz
Refactor azalea-registry (#294)
* move registries in azalea-registry into separate modules * rename Item and Block to ItemKind and BlockKind * remove 'extra' registries from azalea-registry * hide deprecated items from docs * use DamageKindKey instead of Identifier when parsing registries * store tag entries as a Vec instead of a HashSet * sort tag values by protocol id * update changelog
Diffstat (limited to 'azalea-physics/tests')
-rw-r--r--azalea-physics/tests/physics.rs33
1 files changed, 18 insertions, 15 deletions
diff --git a/azalea-physics/tests/physics.rs b/azalea-physics/tests/physics.rs
index 09cb5379..57747692 100644
--- a/azalea-physics/tests/physics.rs
+++ b/azalea-physics/tests/physics.rs
@@ -5,13 +5,16 @@ use azalea_block::{
properties::WaterLevel,
};
use azalea_core::{
- identifier::Identifier,
position::{BlockPos, ChunkPos, Vec3},
registry_holder::RegistryHolder,
tick::GameTick,
};
use azalea_entity::{EntityBundle, EntityPlugin, HasClientLoaded, LocalEntity, Physics, Position};
use azalea_physics::PhysicsPlugin;
+use azalea_registry::{
+ builtin::{BlockKind, EntityKind},
+ identifier::Identifier,
+};
use azalea_world::{Chunk, Instance, InstanceContainer, MinecraftEntityId, PartialInstance};
use bevy_app::App;
use parking_lot::RwLock;
@@ -58,7 +61,7 @@ fn test_gravity() {
y: 70.,
z: 0.,
},
- azalea_registry::EntityKind::Zombie,
+ EntityKind::Zombie,
Identifier::new("minecraft:overworld"),
),
MinecraftEntityId(0),
@@ -114,7 +117,7 @@ fn test_collision() {
y: 70.,
z: 0.5,
},
- azalea_registry::EntityKind::Player,
+ EntityKind::Player,
Identifier::new("minecraft:overworld"),
),
MinecraftEntityId(0),
@@ -124,12 +127,12 @@ fn test_collision() {
.id();
let block_state = partial_world.chunks.set_block_state(
BlockPos { x: 0, y: 69, z: 0 },
- azalea_registry::Block::Stone.into(),
+ BlockKind::Stone.into(),
&world_lock.write().chunks,
);
assert!(
block_state.is_some(),
- "Block state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
+ "BlockKind state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
);
app.update();
app.world_mut().run_schedule(GameTick);
@@ -171,7 +174,7 @@ fn test_slab_collision() {
y: 71.,
z: 0.5,
},
- azalea_registry::EntityKind::Player,
+ EntityKind::Player,
Identifier::new("minecraft:overworld"),
),
MinecraftEntityId(0),
@@ -190,7 +193,7 @@ fn test_slab_collision() {
);
assert!(
block_state.is_some(),
- "Block state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
+ "BlockKind state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
);
// do a few steps so we fall on the slab
for _ in 0..20 {
@@ -222,7 +225,7 @@ fn test_top_slab_collision() {
y: 71.,
z: 0.5,
},
- azalea_registry::EntityKind::Player,
+ EntityKind::Player,
Identifier::new("minecraft:overworld"),
),
MinecraftEntityId(0),
@@ -240,7 +243,7 @@ fn test_top_slab_collision() {
);
assert!(
block_state.is_some(),
- "Block state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
+ "BlockKind state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
);
// do a few steps so we fall on the slab
for _ in 0..20 {
@@ -280,7 +283,7 @@ fn test_weird_wall_collision() {
y: 73.,
z: 0.5,
},
- azalea_registry::EntityKind::Player,
+ EntityKind::Player,
Identifier::new("minecraft:overworld"),
),
MinecraftEntityId(0),
@@ -302,7 +305,7 @@ fn test_weird_wall_collision() {
);
assert!(
block_state.is_some(),
- "Block state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
+ "BlockKind state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
);
// do a few steps so we fall on the wall
for _ in 0..20 {
@@ -343,7 +346,7 @@ fn test_negative_coordinates_weird_wall_collision() {
y: 73.,
z: -7.5,
},
- azalea_registry::EntityKind::Player,
+ EntityKind::Player,
Identifier::new("minecraft:overworld"),
),
MinecraftEntityId(0),
@@ -369,7 +372,7 @@ fn test_negative_coordinates_weird_wall_collision() {
);
assert!(
block_state.is_some(),
- "Block state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
+ "BlockKind state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed"
);
// do a few steps so we fall on the wall
for _ in 0..20 {
@@ -410,7 +413,7 @@ fn spawn_and_unload_world() {
y: 73.,
z: -7.5,
},
- azalea_registry::EntityKind::Player,
+ EntityKind::Player,
Identifier::new("minecraft:overworld"),
),
MinecraftEntityId(0),
@@ -526,7 +529,7 @@ fn test_afk_pool() {
y: 70.,
z: 1.5,
},
- azalea_registry::EntityKind::Player,
+ EntityKind::Player,
Identifier::new("minecraft:overworld"),
),
MinecraftEntityId(0),