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

ItemsAdder Support

This commit is contained in:
LoJoSho
2022-12-08 12:38:36 -06:00
parent ff2d7ad41e
commit d9acf2eb53
3 changed files with 20 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
package com.hibiscusmc.hmccosmetics.hooks.items;
import dev.lone.itemsadder.api.CustomStack;
import org.bukkit.inventory.ItemStack;
public class ItemAdderHook extends ItemHook {
public ItemAdderHook() {
super("itemsadder");
}
@Override
public ItemStack get(String itemid) {
return CustomStack.getInstance(itemid).getItemStack();
}
}

View File

@@ -11,6 +11,7 @@ public class ItemHooks {
private static HashMap<String, ItemHook> itemHooks = new HashMap<>();
private static OraxenHook ORAXEN_HOOK = new OraxenHook();
private static ItemAdderHook ITEMADDER_HOOK = new ItemAdderHook();
public static ItemHook getItemHook(String id) {
return itemHooks.get(id.toLowerCase());
@@ -31,7 +32,6 @@ public class ItemHooks {
HMCCosmeticsPlugin.getInstance().getLogger().info("Successfully hooked into " + itemHook.getId());
}
}
}
public static ItemStack getItem(String raw) {
@@ -43,7 +43,7 @@ public class ItemHooks {
// Ex. Oraxen:BigSword
// split[0] is the plugin name
// split[1] is the item name
String[] split = raw.split(":");
String[] split = raw.split(":", 2);
if (!isItemHook(split[0])) return null;
ItemHook itemHook = getItemHook(split[0]);