-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 EntityExtinguishEvent #5242
Add EntityExtinguishEvent #5242
Conversation
Changed :) |
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.
One note, otherwise LGTM. The note can be handled on merge.
+ // Paper start - add EntityExtinguishEvent | ||
+ EntityExtinguishEvent event = CraftEventFactory.callEntityExtinguishEvent(entity, EntityExtinguishEvent.Cause.WET); | ||
+ if (!event.isCancelled()) { | ||
+ entity.extinguish(); |
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 indent
Do you mind separating the extinguish cases a bit more, please? The previous PR had 8 cases versus 4 in this one. |
Added more reasons, removed the indents and resolved conflicts |
dc9cc7d
to
26f6880
Compare
"rebased" |
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 apart from the unused BUBBLE
cause.
+import org.jetbrains.annotations.NotNull; | ||
+ | ||
+/** | ||
+ * Is called when a burning {@link org.bukkit.entity.Entity} is extinguished. |
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.
Nitpick: I would specify what "burning" and "being extinguished" means. Meaning that I would add JavaDoc links to the fireTicks property.
26f6880
to
f006e57
Compare
import net.minecraft.world.phys.shapes.VoxelShapeCollision; | ||
import net.minecraft.world.phys.shapes.VoxelShapes; | ||
|
||
+import org.bukkit.craftbukkit.event.CraftEventFactory; |
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.
I think that isn't needed.
|
||
// CraftBukkit start | ||
import net.minecraft.world.entity.item.EntityItem; | ||
+import org.bukkit.craftbukkit.event.CraftEventFactory; |
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.
I think that isn't needed.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
As mentioned in #5517, I think if this pull request want to include 'FireTickChangeEvent' event stuff, then its event name should be altered, so that that event can include both |
This issue has been automatically closed because it has not had activity in a long time. If the issue still applies to the most recent supported version, please open a new issue referencing this original issue. |
Closes #5143
Replaces #5144
I tried to see if I could manage to fix that issue and add that event. After finishing, I noticed that there already way a PR for this, but as it was made by Ivan and he is banned from the Org, I figured to open a PR anyway.
I haven't implemented cancellable, because I figured this would cause a lot of issues in the long run, and I wasn't sure how to properly address that.
Other than that there is another extinguish called in EntityHuman line 1211, but I decided to not call the event there, since the entity was never technically on fire