From ea4d088b04f46152e059a2cd6e074ffd7385ae50 Mon Sep 17 00:00:00 2001 From: Craftinators Date: Wed, 15 Mar 2023 04:05:39 -0400 Subject: [PATCH] docs(`PlayerWardrobeEnterEvent`): documented class --- .../api/PlayerWardrobeEnterEvent.java | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/api/PlayerWardrobeEnterEvent.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/api/PlayerWardrobeEnterEvent.java index dc19c143..1b5af1d5 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/api/PlayerWardrobeEnterEvent.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/api/PlayerWardrobeEnterEvent.java @@ -2,43 +2,44 @@ package com.hibiscusmc.hmccosmetics.api; import com.hibiscusmc.hmccosmetics.user.CosmeticUser; import org.bukkit.event.Cancellable; -import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; -public class PlayerWardrobeEnterEvent extends Event implements Cancellable { +public class PlayerWardrobeEnterEvent extends CosmeticUserEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancel = false; - private final CosmeticUser user; - private boolean isCancelled; - - public PlayerWardrobeEnterEvent(CosmeticUser user) { - this.user = user; - this.isCancelled = false; + public PlayerWardrobeEnterEvent(@NotNull CosmeticUser who) { + super(who); } @Override public boolean isCancelled() { - return isCancelled; + return cancel; } + /** + * Sets the cancellation state of this event + * + *

+ * Canceling this event will prevent the player from entering their wardrobe + *

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