From 6818c09a69b44e6fd4d07d310afe395e70bf945c Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Fri, 14 Jun 2024 17:18:59 -0500 Subject: [PATCH] chore: add documentation to CosmeticTypeRegisterEvent --- .../api/events/CosmeticTypeRegisterEvent.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/api/events/CosmeticTypeRegisterEvent.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/api/events/CosmeticTypeRegisterEvent.java index 64452826..4fd7f46c 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/api/events/CosmeticTypeRegisterEvent.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/api/events/CosmeticTypeRegisterEvent.java @@ -1,16 +1,16 @@ package com.hibiscusmc.hmccosmetics.api.events; -import lombok.Getter; import me.lojosho.shaded.configurate.ConfigurationNode; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; +/** + * Called when a cosmetic type not registered with HMCC default cosmetics is attempted to be registered. So if someone puts "test" in the config slot, and it's not a default cosmetic, this event will be called. + */ public class CosmeticTypeRegisterEvent extends Event { private static final HandlerList handlers = new HandlerList(); - @Getter private final String id; - @Getter private final ConfigurationNode config; public CosmeticTypeRegisterEvent(String id, ConfigurationNode config) { @@ -18,6 +18,22 @@ public class CosmeticTypeRegisterEvent extends Event { this.config = config; } + /** + * Returns the id of the cosmetic trying to be registered. For example, "beanie" or "test" + * @return The id. This is the key in the cosmetic config + */ + public String getId() { + return id; + } + + /** + * This will already be in the nested node below the id in the config. + * @return The cosmetic config node in the cosmetic config that was attempted to get registered + */ + public ConfigurationNode getConfig() { + return config; + } + @Override @NotNull public HandlerList getHandlers() {