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

chore: add documentation to CosmeticTypeRegisterEvent

This commit is contained in:
LoJoSho
2024-06-14 17:18:59 -05:00
parent dc72b677de
commit 6818c09a69

View File

@@ -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() {