-
Notifications
You must be signed in to change notification settings - Fork 54
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
Events for Actions #1296
Merged
Cheaterpaul
merged 16 commits into
TeamLapen:1.20
from
TheDrOfDoctoring:1.20-action_event
Dec 7, 2023
Merged
Events for Actions #1296
Cheaterpaul
merged 16 commits into
TeamLapen:1.20
from
TheDrOfDoctoring:1.20-action_event
Dec 7, 2023
Conversation
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
Cheaterpaul
requested changes
Dec 6, 2023
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.
Very nice 🎉🎉. That's about what i thought for such action events
I haven't tested it yet, but there where some minor issues with the implementation and some regarding the design. A lot of requested changed but mainly the following:
- PreActionActivatedEvent
To me there is no point in having two event that are called for activating an action if they can be rearranged and merged into one. - UpdateEvent
I have no problem with this if it is only about deactivating the action prematurely. But it might be worth to invest more time on the event to make it more powerful.
src/main/java/de/teamlapen/vampirism/entity/player/actions/ActionHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/de/teamlapen/vampirism/entity/player/actions/ActionHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/de/teamlapen/vampirism/entity/player/actions/ActionHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/de/teamlapen/vampirism/entity/player/actions/ActionHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/de/teamlapen/vampirism/entity/player/actions/ActionHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/de/teamlapen/vampirism/entity/player/actions/ActionHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/de/teamlapen/vampirism/entity/player/actions/ActionHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/de/teamlapen/vampirism/entity/player/actions/ActionHandler.java
Outdated
Show resolved
Hide resolved
TheDrOfDoctoring
force-pushed
the
1.20-action_event
branch
from
December 7, 2023 12:05
6a6852f
to
14b3f30
Compare
Cheaterpaul
approved these changes
Dec 7, 2023
🎉🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds 4 new events to the action system to allow for some degree of modification of existing actions. These actions are
ActionActivatedEvent
,ActionDeactivatedEvent
,ActionUpdateEvent
andPreActionActivatedEvent
.PreActionActivatedEvent
allows an action to be cancelled before it is activated.ActionActivatedEvent
allows the cooldown of an action to be changed, as well as the duration for lasting actions.ActionDeactivatedEvent
allows for the cooldown of an action to be changed before it is deactivated.ActionUpdateEvent
allows is fired for every action update, but does not allow for any part of the action to be changed.Additionally, lasting actions that add potion effects (such as sunscreen or rage) have been moved to applying the effect every 20 ticks under
onUpdate
. Previously, the potion effects were only added once when first activated. The regeneration vampire action also has been moved to a lasting action due to all the other similar actions being lasting actions already.