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

feat: add MMOItems hook

This commit is contained in:
LoJoSho
2023-08-27 13:31:59 -05:00
parent 3be4bdeb6f
commit 01c62bc94e
4 changed files with 28 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ public class Hooks {
private static final HookCMI CMI_HOOK = new HookCMI();
private static final HookLibsDisguises LIBS_DISGUISES_HOOK = new HookLibsDisguises();
private static final HookModelEngine MODEL_ENGINE_HOOK = new HookModelEngine();
private static final HookMMOItems MMO_ITEMS_HOOK = new HookMMOItems();
public static Hook getHook(@NotNull String id) {
return hooks.get(id.toLowerCase());

View File

@@ -0,0 +1,22 @@
package com.hibiscusmc.hmccosmetics.hooks.items;
import com.hibiscusmc.hmccosmetics.hooks.Hook;
import net.Indyuce.mmoitems.MMOItems;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public class HookMMOItems extends Hook {
public HookMMOItems() {
super("MMOItems");
setEnabledItemHook(true);
}
@Override
public ItemStack getItem(@NotNull String itemId) {
String[] split = itemId.split(":", 2);
if (split.length == 2) {
return MMOItems.plugin.getItem(split[0], split[1]);
}
return null;
}
}