mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-19 15:09:26 +00:00
feat: add CraftEngine hook
This commit is contained in:
@@ -41,6 +41,7 @@ public class Hooks {
|
||||
private static final HookPlaceholderAPI PAPI_HOOK = new HookPlaceholderAPI();
|
||||
private static final HookCustomFishing CF_HOOK = new HookCustomFishing();
|
||||
private static final HookGSit GSIT_HOOK = new HookGSit();
|
||||
private static final HookCraftEngine CRAFT_ENGINE_HOOK = new HookCraftEngine();
|
||||
|
||||
private static boolean allHooksActive = false;
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package me.lojosho.hibiscuscommons.hooks.items;
|
||||
|
||||
import me.lojosho.hibiscuscommons.hooks.Hook;
|
||||
import me.lojosho.hibiscuscommons.hooks.HookFlag;
|
||||
import net.momirealms.craftengine.bukkit.api.CraftEngineItems;
|
||||
import net.momirealms.craftengine.core.item.CustomItem;
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class HookCraftEngine extends Hook {
|
||||
|
||||
public HookCraftEngine() {
|
||||
super("CraftEngine", HookFlag.ITEM_SUPPORT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItem(@NotNull String itemId) {
|
||||
Key craftEngineKey = Key.of(itemId);
|
||||
CustomItem<ItemStack> itemStack = CraftEngineItems.byId(craftEngineKey);
|
||||
if (itemStack == null) return null;
|
||||
return itemStack.buildItemStack();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user