diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/api/events/PlayerCosmeticHideEvent.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/api/events/PlayerCosmeticHideEvent.java index 5276cd35..78e9bac1 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/api/events/PlayerCosmeticHideEvent.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/api/events/PlayerCosmeticHideEvent.java @@ -6,25 +6,26 @@ import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; /** - * Called when cosmetics are hidden from a player + * Called when cosmetics are hidden from a player. */ public class PlayerCosmeticHideEvent extends PlayerCosmeticEvent implements Cancellable { - private static final HandlerList handlers = new HandlerList(); - private boolean cancel = false; + private static final HandlerList HANDLER_LIST = new HandlerList(); + private final CosmeticUser.HiddenReason reason; + private boolean cancel = false; + public PlayerCosmeticHideEvent(@NotNull CosmeticUser who, @NotNull CosmeticUser.HiddenReason reason) { super(who); this.reason = reason; } /** - * Gets the {@link CosmeticUser.HiddenReason} as to why cosmetics are being hidden for the player + * Gets the {@link CosmeticUser.HiddenReason} as to why cosmetics are being hidden for the player. * - * @return The {@link CosmeticUser.HiddenReason} why cosmetics are being hidden for the player + * @return the {@link CosmeticUser.HiddenReason} why cosmetics are being hidden for the player */ - @NotNull - public CosmeticUser.HiddenReason getReason() { + public @NotNull CosmeticUser.HiddenReason getReason() { return reason; } @@ -33,28 +34,17 @@ public class PlayerCosmeticHideEvent extends PlayerCosmeticEvent implements Canc return cancel; } - /** - * Sets the cancellation state of this event - * - *

- * Canceling this event will prevent the player from hiding cosmetics - *

- * - * @param cancel true if you wish to cancel this event - */ @Override public void setCancelled(boolean cancel) { this.cancel = cancel; } @Override - @NotNull - public HandlerList getHandlers() { - return handlers; + public @NotNull HandlerList getHandlers() { + return HANDLER_LIST; } - @NotNull - public static HandlerList getHandlerList() { - return handlers; + public static @NotNull HandlerList getHandlerList() { + return HANDLER_LIST; } }