-
-
Notifications
You must be signed in to change notification settings - Fork 36
Complete JavaDocs for the API #78
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
8b47588
207ed4c
608c66c
3931a63
e49096b
58bebab
674d6c7
abbb0a0
09ca1c9
63253e0
f567132
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,11 +5,14 @@ | |
| package net.minecraftforge.eventbus.api.event.characteristic; | ||
|
|
||
| import net.minecraftforge.eventbus.api.bus.EventBus; | ||
| import net.minecraftforge.eventbus.internal.AbstractEventBusImpl; | ||
|
|
||
| /** | ||
| * A self-destructing event will {@link AbstractEventBusImpl#dispose() dispose} of its associated {@link EventBus} | ||
| * after it has been posted to free up resources, after which it cannot be posted to again. | ||
| * A self-destructing event will {@linkplain net.minecraftforge.eventbus.api.bus.BusGroup#dispose() dispose} of its | ||
| * associated {@link EventBus} after it has been posted to free up resources. | ||
| * <p>This is useful for single-use lifecycle events.</p> | ||
| * | ||
| * @apiNote Similar to {@link net.minecraftforge.eventbus.api.bus.BusGroup#dispose()}, the posting of this event is a | ||
| * destructive action that will cause its resources to be freed. <strong>It must not be used after it is | ||
| * posted!</strong> | ||
|
Comment on lines
+14
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iirc this is enforced at runtime to make it a no-op, so "cannot be used" is clearer to me than "must not be used", as the latter implies an exception would be thrown. It's no-op instead of exception for performance reasons.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah it is no-op? I must've misread the internals then. I was under the assumption that disposing of a bus group is equivalent to |
||
| */ | ||
| public non-sealed interface SelfDestructing extends EventCharacteristic {} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method isn't pure because it can return different values based on when it is executed (false when normal priority listeners are running, true when monitoring priority listeners are running). A method is only pure if it always returns the same value when given the same arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, thanks.