Repository navigation
Add PlayerAdvancementCriterionRevokeEvent and PlayerAdvancementRevokeEvent - #14445
FlowerDevelops wants to merge 3 commits into
Conversation
ImKarven
left a comment
There was a problem hiding this comment.
PlayerAdvancementRevokeEvent should also have changes similar to PlayerAdvancementRevokeCriterionEvent.
Javadoc should be added to getAdvancement() (for both events) and getCriterion().
Actually, the firing logic for PlayerAdvancementRevokeCriterionEvent should be moved to PlayerAdvancements#revoke so that the event is also fired when a plugin revoke an advancement through the API.
| * An event fired when a {@link Player} has an advancement revoked | ||
| */ | ||
| @NullMarked | ||
| public final class PlayerAdvancementCriterionRevokeEvent extends Event implements Cancellable { |
There was a problem hiding this comment.
Use PlayerEvent instead.
-public final class PlayerAdvancementCriterionRevokeEvent extends Event implements Cancellable {
+public final class PlayerAdvancementCriterionRevokeEvent extends PlayerEvent implements Cancellable {|
|
||
| @ApiStatus.Internal | ||
| public PlayerAdvancementCriterionRevokeEvent(final Player player, Advancement advancement, String criterion) { | ||
| this.player = player; |
There was a problem hiding this comment.
- this.player = player;
+ super(player);| this.criterion = criterion; | ||
| } | ||
|
|
||
| public Player getPlayer() |
There was a problem hiding this comment.
- public Player getPlayer()
- {
- return this.player;
- }
-|
|
||
| private boolean cancelled; | ||
|
|
||
| private final Player player; |
| + if (event.isCancelled()) { | ||
| + return false; | ||
| + } | ||
| + // Paper end |
There was a problem hiding this comment.
Suffix with commit description:
// Paper end - Add PlayerAdvancementRevokeEvent
| + if (!event.callEvent()) { | ||
| + return false; | ||
| + } | ||
| + // Paper end |
|
I'll check all comment and change my code. |
|
I made 2 commits that should fix this |
|
If there are any changes you'd still want to see, tell me |
No description provided.