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

docs(HookHMCCosmetics): documented class

This commit is contained in:
Craftinators
2023-03-16 17:55:53 -04:00
parent 2ea272ee4a
commit 7a32697906

View File

@@ -3,18 +3,23 @@ package com.hibiscusmc.hmccosmetics.hooks.items;
import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetic;
import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetics;
import com.hibiscusmc.hmccosmetics.hooks.Hook;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public class HookHMCCosmetics extends Hook implements Listener {
/**
* A hook that integrates the plugin {@link com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin HMCCosmetics} to provide cosmetic items
*/
public class HookHMCCosmetics extends Hook {
public HookHMCCosmetics() {
super("HMCCosmetics");
setEnabledItemHook(true);
}
/**
* Gets a cosmetic {@link ItemStack} that is associated with the provided id from the plugin {@link com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin HMCCosmetics}
*/
@Override
public ItemStack getItem(String itemId) {
public ItemStack getItem(@NotNull String itemId) {
Cosmetic cosmetic = Cosmetics.getCosmetic(itemId);
if (cosmetic == null) return null;
return cosmetic.getItem();