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:
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user