Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: arrow entity handling and damage. #772

Merged
merged 33 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ecacefc
Arrow Entity handling and damage.
Tebarem Dec 19, 2024
c604a53
Arrow hitting blocks and damaging entities
Tebarem Dec 19, 2024
1bb1901
Despawn Arrow and clamp velocity properly :)
Tebarem Dec 19, 2024
263adfd
hand animations :thumbsup:
Tebarem Dec 19, 2024
c5f07d8
fix bow?
Tebarem Dec 19, 2024
973cf57
first_collision rewrite. somewhat fixed arrow through floor
Tebarem Dec 20, 2024
58d2e3f
Arrow Entity handling and damage.
Tebarem Dec 19, 2024
f6129d3
Arrow hitting blocks and damaging entities
Tebarem Dec 19, 2024
b413b32
Despawn Arrow and clamp velocity properly :)
Tebarem Dec 19, 2024
d2715d2
hand animations :thumbsup:
Tebarem Dec 19, 2024
60a7470
fix bow?
Tebarem Dec 19, 2024
7142da6
first_collision rewrite. somewhat fixed arrow through floor
Tebarem Dec 20, 2024
b4f69eb
updated some stuff and when position updates.
Tebarem Dec 20, 2024
1dc359b
Merge branch 'arrows' of https://github.com/hyperion-mc/hyperion into…
Tebarem Dec 20, 2024
a33b4cf
stash apply
Tebarem Dec 20, 2024
799b358
fix
andrewgazelka Dec 20, 2024
28a4e2f
Voxel Traversal and Ray changes.
Tebarem Dec 21, 2024
5903cc4
Merge branch 'arrows' of https://github.com/hyperion-mc/hyperion into…
Tebarem Dec 21, 2024
877962b
ray changes DDA-> Amanadites and woo algorithim
Tebarem Dec 21, 2024
201f6dd
Arrows Collisions Complete. No more crashing i think! :)
Tebarem Dec 22, 2024
4fd90ac
Merge remote-tracking branch 'origin/main' into arrows
andrewgazelka Dec 22, 2024
4d59a8b
test updates.
Tebarem Dec 22, 2024
c063332
Merge branch 'arrows' of https://github.com/hyperion-mc/hyperion into…
Tebarem Dec 22, 2024
5cd21a7
update
andrewgazelka Dec 22, 2024
1600877
Merge remote-tracking branch 'origin/main' into arrows
TestingPlant Jan 12, 2025
a0ad35f
fix warnings
TestingPlant Jan 12, 2025
baae245
style: remove commented out code
TestingPlant Jan 12, 2025
5fa3e7b
fmt
TestingPlant Jan 12, 2025
89f2d65
style: fix chunk typo
TestingPlant Jan 12, 2025
eb68987
fmt again
TestingPlant Jan 12, 2025
05b24f7
fix(geometry): return if t_min > t_max
TestingPlant Jan 14, 2025
bc9a4cb
fix: add Owner to arrow in test
TestingPlant Jan 14, 2025
7197728
Merge branch 'main' into arrows
andrewgazelka Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
andrewgazelka committed Dec 20, 2024
commit 799b3588396aea3fee3513cb71973200735c769f
2 changes: 1 addition & 1 deletion crates/hyperion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ pub mod egress;
pub mod ingress;
pub mod net;
pub mod simulation;
pub mod storage;
pub mod spatial;
pub mod storage;

/// Relationship for previous values
#[derive(Component)]
Expand Down
3 changes: 1 addition & 2 deletions crates/hyperion/src/simulation/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ use valence_generated::block::BlockState;
use valence_protocol::Hand;
use valence_server::{ItemKind, entity::item_frame::ItemStack};

use crate::simulation::skin::PlayerSkin;

use super::blocks::RayCollision;
use crate::simulation::skin::PlayerSkin;

#[derive(Component, Default, Debug)]
pub struct ItemDropEvent {
Expand Down
4 changes: 2 additions & 2 deletions crates/hyperion/src/simulation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ impl Module for SimModule {

world.component::<hyperion_inventory::PlayerInventory>();

/* world.component::<BowCharging>();
component!(world, BowCharging).opaque_func(meta_ser_stringify_type_display::<BowCharging>); */
// world.component::<BowCharging>();
// component!(world, BowCharging).opaque_func(meta_ser_stringify_type_display::<BowCharging>);

observer!(
world,
Expand Down
5 changes: 3 additions & 2 deletions crates/hyperion/src/spatial/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ use flecs_ecs::{
prelude::Module,
};
use geometry::{aabb::Aabb, ray::Ray};
use ordered_float::NotNan;
use rayon::iter::Either;

use super::{
egress::player_join::RayonWorldStages,
glam::Vec3,
Expand All @@ -15,8 +18,6 @@ use super::{
blocks::{Blocks, RayCollision},
},
};
use ordered_float::NotNan;
use rayon::iter::Either;

#[derive(Component)]
pub struct SpatialModule;
Expand Down
4 changes: 3 additions & 1 deletion crates/hyperion/tests/spatial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use flecs_ecs::core::{QueryBuilderImpl, SystemAPI, World, WorldGet, flecs};
use geometry::{aabb::Aabb, ray::Ray};
use glam::Vec3;
use hyperion::{
simulation::{entity_kind::EntityKind, EntitySize, Position}, spatial, HyperionCore
HyperionCore,
simulation::{EntitySize, Position, entity_kind::EntityKind},
spatial,
};
use spatial::{Spatial, SpatialIndex, SpatialModule};

Expand Down
2 changes: 1 addition & 1 deletion events/tag/src/command/raycast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use clap::Parser;
use flecs_ecs::core::{Entity, EntityView, EntityViewGet, WorldProvider};
use hyperion::{
glam::Vec3,
spatial::get_first_collision,
simulation::{Pitch, Position, Yaw, entity_kind::EntityKind},
spatial::get_first_collision,
};
use hyperion_clap::{CommandPermission, MinecraftCommand};
use rayon::iter::Either;
Expand Down
4 changes: 2 additions & 2 deletions events/tag/src/module/bow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ impl Module for BowModule {
world,
&mut EventQueue<event::ReleaseUseItem>($),
)
.multi_threaded()
.kind::<flecs::pipeline::PreUpdate>()
.each_iter(move |it, _, event_queue| {
let _system = it.system();
Expand Down Expand Up @@ -196,7 +195,8 @@ impl Module for BowModule {

debug!("Arrow spawn position: {:?}", spawn_pos);

world.entity()
world
.entity()
.add_enum(EntityKind::Arrow)
.set(Uuid::new_v4())
.set(Position::new(spawn_pos.x, spawn_pos.y, spawn_pos.z))
Expand Down
Loading