From f456ddf8a484d5ea8150d225e5f2bb8dd653c8f3 Mon Sep 17 00:00:00 2001 From: Craftinators Date: Wed, 15 Mar 2023 01:39:00 -0400 Subject: [PATCH] docs(PlayerCosmeticShowEvent): documented class --- .../api/PlayerCosmeticShowEvent.java | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/api/PlayerCosmeticShowEvent.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/api/PlayerCosmeticShowEvent.java index 6218fcff..ef805893 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/api/PlayerCosmeticShowEvent.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/api/PlayerCosmeticShowEvent.java @@ -6,39 +6,44 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; -public class PlayerCosmeticShowEvent extends Event implements Cancellable { +/** + * Called when cosmetics are shown from a player + */ +public class PlayerCosmeticShowEvent extends CosmeticUserEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancel = false; - private final CosmeticUser user; - private boolean isCancelled; - - public PlayerCosmeticShowEvent(CosmeticUser user) { - this.user = user; - this.isCancelled = false; + public PlayerCosmeticShowEvent(@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 showing cosmetics + *

+ * + * @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; - } } \ No newline at end of file