mirror of
https://github.com/azalea-rs/azalea-hax.git
synced 2025-08-02 14:26:05 +00:00
update deps and remove unsafe now that bevy EventMutator exists
This commit is contained in:
parent
5026040bf4
commit
2af9e0759a
3 changed files with 1340 additions and 873 deletions
2200
Cargo.lock
generated
2200
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "azalea-hax"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
11
src/lib.rs
11
src/lib.rs
|
@ -48,17 +48,10 @@ impl HaxClientExt for azalea::Client {
|
|||
pub struct AntiKnockback;
|
||||
|
||||
fn anti_knockback(
|
||||
mut events: EventReader<KnockbackEvent>,
|
||||
mut events: EventMutator<KnockbackEvent>,
|
||||
entity_query: Query<(), With<AntiKnockback>>,
|
||||
) {
|
||||
// bevy please merge this https://github.com/bevyengine/bevy/pull/8051
|
||||
// :pleading:
|
||||
#[allow(invalid_reference_casting)]
|
||||
for event in events
|
||||
.read()
|
||||
// shhh you didn't see anything
|
||||
.map(|e| unsafe { &mut *(e as *const KnockbackEvent as *mut KnockbackEvent) })
|
||||
{
|
||||
for event in events.read() {
|
||||
if entity_query.get(event.entity).is_ok() {
|
||||
event.knockback = KnockbackType::Add(Vec3::default());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue