aboutsummaryrefslogtreecommitdiff
path: root/azalea-physics/src/lib.rs
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/src/lib.rs
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/src/lib.rs')
-rw-r--r--azalea-physics/src/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs
index b993a7b5..663c60db 100644
--- a/azalea-physics/src/lib.rs
+++ b/azalea-physics/src/lib.rs
@@ -20,7 +20,7 @@ use azalea_entity::{
LookDirection, OnClimbable, Physics, Pose, Position, dimensions::EntityDimensions,
metadata::Sprinting, move_relative,
};
-use azalea_registry::{Block, EntityKind, MobEffect};
+use azalea_registry::builtin::{BlockKind, EntityKind, MobEffect};
use azalea_world::{Instance, InstanceContainer, InstanceName};
use bevy_app::{App, Plugin, Update};
use bevy_ecs::prelude::*;
@@ -296,10 +296,10 @@ fn handle_entity_inside_block(
block_pos: BlockPos,
physics: &mut Physics,
) {
- let registry_block = azalea_registry::Block::from(block);
+ let registry_block = BlockKind::from(block);
#[allow(clippy::single_match)]
match registry_block {
- azalea_registry::Block::BubbleColumn => {
+ BlockKind::BubbleColumn => {
let block_above = world.get_block_state(block_pos.up(1)).unwrap_or_default();
let is_block_above_empty =
block_above.is_collision_shape_empty() && FluidState::from(block_above).is_empty();
@@ -417,14 +417,14 @@ fn handle_relative_friction_and_calculate_movement(ctx: &mut MoveCtx, block_fric
// Vec3(var3.x, 0.2D, var3.z); }
if ctx.physics.horizontal_collision || *ctx.jumping {
- let block_at_feet: Block = ctx
+ let block_at_feet: BlockKind = ctx
.world
.chunks
.get_block_state(BlockPos::from(*ctx.position))
.unwrap_or_default()
.into();
- if *ctx.on_climbable || block_at_feet == Block::PowderSnow {
+ if *ctx.on_climbable || block_at_feet == BlockKind::PowderSnow {
ctx.physics.velocity.y = 0.2;
}
}
@@ -454,12 +454,12 @@ fn handle_on_climbable(
// sneaking on ladders/vines
if y < 0.0
&& pose == Some(Pose::Crouching)
- && azalea_registry::Block::from(
+ && BlockKind::from(
world
.chunks
.get_block_state(position.into())
.unwrap_or_default(),
- ) != azalea_registry::Block::Scaffolding
+ ) != BlockKind::Scaffolding
{
y = 0.;
}