mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-22 00:21:33 +00:00
feat: add CraftEngine hook
This commit is contained in:
@@ -61,6 +61,9 @@ allprojects {
|
|||||||
// Oraxen
|
// Oraxen
|
||||||
maven("https://repo.oraxen.com/releases")
|
maven("https://repo.oraxen.com/releases")
|
||||||
|
|
||||||
|
// Craft Engine
|
||||||
|
maven("https://repo.momirealms.net/releases/")
|
||||||
|
|
||||||
// Needed for brigadier for dependencies (I
|
// Needed for brigadier for dependencies (I
|
||||||
maven("https://libraries.minecraft.net/")
|
maven("https://libraries.minecraft.net/")
|
||||||
|
|
||||||
@@ -99,6 +102,8 @@ allprojects {
|
|||||||
compileOnly("org.joml:joml:1.10.8")
|
compileOnly("org.joml:joml:1.10.8")
|
||||||
compileOnly("com.google.guava:guava:33.4.0-jre") // Sometimes just not included in compile time???
|
compileOnly("com.google.guava:guava:33.4.0-jre") // Sometimes just not included in compile time???
|
||||||
compileOnly("com.github.Gecolay.GSit:core:2.0.0")
|
compileOnly("com.github.Gecolay.GSit:core:2.0.0")
|
||||||
|
compileOnly("net.momirealms:craft-engine-core:0.0.49")
|
||||||
|
compileOnly("net.momirealms:craft-engine-bukkit:0.0.49")
|
||||||
|
|
||||||
// Lombok <3
|
// Lombok <3
|
||||||
annotationProcessor("org.projectlombok:lombok:1.18.36")
|
annotationProcessor("org.projectlombok:lombok:1.18.36")
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public class Hooks {
|
|||||||
private static final HookPlaceholderAPI PAPI_HOOK = new HookPlaceholderAPI();
|
private static final HookPlaceholderAPI PAPI_HOOK = new HookPlaceholderAPI();
|
||||||
private static final HookCustomFishing CF_HOOK = new HookCustomFishing();
|
private static final HookCustomFishing CF_HOOK = new HookCustomFishing();
|
||||||
private static final HookGSit GSIT_HOOK = new HookGSit();
|
private static final HookGSit GSIT_HOOK = new HookGSit();
|
||||||
|
private static final HookCraftEngine CRAFT_ENGINE_HOOK = new HookCraftEngine();
|
||||||
|
|
||||||
private static boolean allHooksActive = false;
|
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