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

Add HMCCosmetic item hook (get items from cosmetics)

This commit is contained in:
LoJoSho
2022-12-31 13:58:32 -06:00
parent 007597336f
commit dbed2f60ed
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package com.hibiscusmc.hmccosmetics.hooks.items;
import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetics;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
public class HMCCosmeticsHook extends ItemHook implements Listener {
public HMCCosmeticsHook() {
super("HMCCosmetics");
}
@Override
public ItemStack get(String itemid) {
return Cosmetics.getCosmetic(itemid).getItem();
}
}

View File

@@ -12,6 +12,7 @@ public class ItemHooks {
private static HashMap<String, ItemHook> itemHooks = new HashMap<>(); private static HashMap<String, ItemHook> itemHooks = new HashMap<>();
private static OraxenHook ORAXEN_HOOK = new OraxenHook(); private static OraxenHook ORAXEN_HOOK = new OraxenHook();
private static ItemAdderHook ITEMADDER_HOOK = new ItemAdderHook(); private static ItemAdderHook ITEMADDER_HOOK = new ItemAdderHook();
private static HMCCosmeticsHook HMCCOSMETIC_HOOK = new HMCCosmeticsHook();
public static ItemHook getItemHook(String id) { public static ItemHook getItemHook(String id) {
return itemHooks.get(id.toLowerCase()); return itemHooks.get(id.toLowerCase());