-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rewrite Event * fix errors * send + sync in tests
- Loading branch information
Showing
4 changed files
with
240 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
use rimecraft_event::Event; | ||
use std::sync::Arc; | ||
|
||
use rimecraft_event::{DefaultEvent, Event}; | ||
|
||
use super::Item; | ||
|
||
pub static POST_PROCESS_NBT: Event<dyn Fn(Item, &mut rimecraft_nbt_ext::Compound)> = | ||
Event::new(|listeners| { | ||
Box::new(move |item, nbt| { | ||
for listener in listeners { | ||
listener(item, nbt) | ||
} | ||
}) | ||
}); | ||
pub static POST_PROCESS_NBT: DefaultEvent< | ||
dyn Fn(Item, &mut rimecraft_nbt_ext::Compound) + Send + Sync, | ||
> = Event::new(|listeners| { | ||
Arc::new(move |item, nbt| { | ||
for listener in &listeners { | ||
listener(item, nbt) | ||
} | ||
}) | ||
}); |
Oops, something went wrong.