mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
Finish converting all events to jspecify annotations
This commit is contained in:
@@ -20,24 +20,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Called after a player is granted a criteria in an advancement.
|
||||
+ * If cancelled the criteria will be revoked.
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class PlayerAdvancementCriterionGrantEvent extends PlayerEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ @NotNull private final Advancement advancement;
|
||||
+ @NotNull private final String criterion;
|
||||
+ @NotNull private final AdvancementProgress advancementProgress;
|
||||
+ private final Advancement advancement;
|
||||
+ private final String criterion;
|
||||
+ private final AdvancementProgress advancementProgress;
|
||||
+
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public PlayerAdvancementCriterionGrantEvent(@NotNull Player player, @NotNull Advancement advancement, @NotNull String criterion) {
|
||||
+ public PlayerAdvancementCriterionGrantEvent(final Player player, final Advancement advancement, final String criterion) {
|
||||
+ super(player);
|
||||
+ this.advancement = advancement;
|
||||
+ this.criterion = criterion;
|
||||
@@ -49,7 +50,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return affected advancement
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Advancement getAdvancement() {
|
||||
+ return this.advancement;
|
||||
+ }
|
||||
@@ -59,7 +59,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return granted criterion
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String getCriterion() {
|
||||
+ return this.criterion;
|
||||
+ }
|
||||
@@ -69,7 +68,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return advancement progress
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public AdvancementProgress getAdvancementProgress() {
|
||||
+ return this.advancementProgress;
|
||||
+ }
|
||||
@@ -80,17 +78,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ public void setCancelled(final boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user