9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-19 15:09:19 +00:00

docs(PlayerCosmeticEquipEvent): improve Javadocs

This commit is contained in:
Craftinators
2025-01-22 10:59:00 -05:00
parent f6a1438299
commit 330723a45c

View File

@@ -6,23 +6,27 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.List;
/** /**
* Called when a player equips a cosmetic * Called when a player equips a {@link Cosmetic}.
*/ */
public class PlayerCosmeticEquipEvent extends PlayerCosmeticEvent implements Cancellable { public class PlayerCosmeticEquipEvent extends PlayerCosmeticEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList HANDLER_LIST = new HandlerList();
private boolean cancel = false;
private Cosmetic cosmetic; private Cosmetic cosmetic;
private boolean cancel = false;
public PlayerCosmeticEquipEvent(@NotNull CosmeticUser who, @NotNull Cosmetic cosmetic) { public PlayerCosmeticEquipEvent(@NotNull CosmeticUser who, @NotNull Cosmetic cosmetic) {
super(who); super(who);
this.cosmetic = cosmetic; this.cosmetic = cosmetic;
} }
/** /**
* Gets the {@link Cosmetic} being equipped in this event * Gets the {@link Cosmetic} being equipped in this event.
* *
* @return The {@link Cosmetic} which is being equipped in this event * @return the {@link Cosmetic} which is being equipped in this event
*/ */
@NotNull @NotNull
public Cosmetic getCosmetic() { public Cosmetic getCosmetic() {
@@ -30,9 +34,9 @@ public class PlayerCosmeticEquipEvent extends PlayerCosmeticEvent implements Can
} }
/** /**
* Sets the {@link Cosmetic} that the player will equip * Sets the {@link Cosmetic} that the player will equip.
* *
* @param cosmetic The {@link Cosmetic} that the player will equip * @param cosmetic the {@link Cosmetic} that the player will equip
*/ */
public void setCosmetic(@NotNull Cosmetic cosmetic) { public void setCosmetic(@NotNull Cosmetic cosmetic) {
this.cosmetic = cosmetic; this.cosmetic = cosmetic;
@@ -43,28 +47,17 @@ public class PlayerCosmeticEquipEvent extends PlayerCosmeticEvent implements Can
return cancel; return cancel;
} }
/**
* Sets the cancellation state of this event
*
* <p>
* Canceling this event will prevent the player from equipping the cosmetic
* </p>
*
* @param cancel true if you wish to cancel this event
*/
@Override @Override
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }
@Override @Override
@NotNull public @NotNull HandlerList getHandlers() {
public HandlerList getHandlers() { return HANDLER_LIST;
return handlers;
} }
@NotNull public static @NotNull HandlerList getHandlerList() {
public static HandlerList getHandlerList() { return HANDLER_LIST;
return handlers;
} }
} }