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