-
Notifications
You must be signed in to change notification settings - Fork 551
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
Add TalismanActivateEvent (Updated version of #3920) #4045
Add TalismanActivateEvent (Updated version of #3920) #4045
Conversation
Activates when a Talisman is activated.
…lismanActivatedEvent.java changes variable names to camel case Co-authored-by: TheBusyBiscuit <[email protected]>
…lismanActivatedEvent.java changes the who variable to a more clear player variable Co-authored-by: Sefiraat <[email protected]>
…n/items/magical/talismans/Talisman.java adds a space for readability Co-authored-by: J3fftw <[email protected]>
…n/items/magical/talismans/Talisman.java more spaces for readability Co-authored-by: J3fftw <[email protected]>
…n/items/magical/talismans/Talisman.java didnt commit the first time I guess Co-authored-by: J3fftw <[email protected]>
Your Pull Request was automatically labelled as: "🔧 API" |
The couple of ideas I had that I wanted opinions on:
|
Slimefun preview buildA Slimefun preview build is available for testing! https://preview-builds.walshy.dev/download/Slimefun/4045/c43dad64
|
src/main/java/io/github/thebusybiscuit/slimefun4/api/events/TalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Daniel Walsh <[email protected]>
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.
Requesting change as I don't see a reason not to add the optional preventConsumption flag. Adding a test request while I am at it
EDIT: Justin added the needs testing already
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.
Spent some time in VC and all looks good, especially the tests <3
can we also have tests that the endertalisman doesnt work in a normal inventory and for the normal talisman not to work in an enderchest |
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
…stTalismanActivateEvent.java
…stTalismanActivateEvent.java
…stTalismanActivateEvent.java
…stTalismanActivateEvent.java
…stTalismanActivateEvent.java
…stTalismanActivateEvent.java
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
…stTalismanActivateEvent.java
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/thebusybiscuit/slimefun4/api/events/TestTalismanActivateEvent.java
Outdated
Show resolved
Hide resolved
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.
Don't worry about the list of commits above, for some reason I was unable to push to Justin's fork and I am an impatient blueberry so I copied over my changes a piece at a time. Also didn't know about batch committing suggested changes so there you go
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.
Looks good to alessio
Description
I've made this pull request to update and apply some suggestions from #3920
I also have a couple of ideas of things to add to the PR but I'm going to ask for opinions on those beforehand
Proposed changes
Talisman#activateTalisman
method it now passes the ender talisman's talisman (mouthful I know)TalismanActivateEvent#getTalisman
will properly reflect wether an ender or normal talisman was usedTalismanActivateEvent
PlayerEvent
and implementsCancellable
Talisman#activateTalisman
eventPlayer
,Talisman
, andItemStack
used when activating a talismanTalisman#activateTalisman
call the new eventpreventsConsumption
is false (which is the default value)TestActivateTalismanEvent
(Blame sfiguz for any problems with it (half joking))Related Issues (if applicable)
N/A
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values