mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-19 23:19:22 +00:00
chore: add documentation to CosmeticTypeRegisterEvent
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
package com.hibiscusmc.hmccosmetics.api.events;
|
package com.hibiscusmc.hmccosmetics.api.events;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import me.lojosho.shaded.configurate.ConfigurationNode;
|
import me.lojosho.shaded.configurate.ConfigurationNode;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.jetbrains.annotations.NotNull;
|
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 {
|
public class CosmeticTypeRegisterEvent extends Event {
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
@Getter
|
|
||||||
private final String id;
|
private final String id;
|
||||||
@Getter
|
|
||||||
private final ConfigurationNode config;
|
private final ConfigurationNode config;
|
||||||
|
|
||||||
public CosmeticTypeRegisterEvent(String id, ConfigurationNode config) {
|
public CosmeticTypeRegisterEvent(String id, ConfigurationNode config) {
|
||||||
@@ -18,6 +18,22 @@ public class CosmeticTypeRegisterEvent extends Event {
|
|||||||
this.config = config;
|
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
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
|
|||||||
Reference in New Issue
Block a user