9
0
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:
lojosho
2025-04-21 17:27:28 -05:00
parent 739362fc37
commit c617bae0c4
3 changed files with 30 additions and 0 deletions

View File

@@ -61,6 +61,9 @@ allprojects {
// Oraxen
maven("https://repo.oraxen.com/releases")
// Craft Engine
maven("https://repo.momirealms.net/releases/")
// Needed for brigadier for dependencies (I
maven("https://libraries.minecraft.net/")
@@ -99,6 +102,8 @@ allprojects {
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.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
annotationProcessor("org.projectlombok:lombok:1.18.36")

View File

@@ -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;

View File

@@ -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();
}
}