From 502cb533f8c9832d71d1ba9dc11c726dacf7ddd1 Mon Sep 17 00:00:00 2001 From: Boy Date: Sun, 5 Nov 2023 01:05:38 +0100 Subject: [PATCH] fix: drop runOnOrAfter for GearyHook --- build.gradle.kts | 2 +- .../hmccosmetics/hooks/items/HookGeary.java | 22 +++---------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 32d00f2b..70c2cd68 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -75,7 +75,7 @@ allprojects { compileOnly("com.ticxo.modelengine:ModelEngine:R4.0.2") compileOnly("com.github.oraxen:oraxen:1.160.0") compileOnly("com.github.LoneDev6:API-ItemsAdder:3.2.5") - compileOnly("com.mineinabyss:geary-papermc:0.26.2") + compileOnly("com.mineinabyss:geary-papermc:0.27.0") compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT") compileOnly("it.unimi.dsi:fastutil:8.5.11") compileOnly("com.github.LeonMangler:SuperVanish:6.2.17") diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/items/HookGeary.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/items/HookGeary.java index 7fbb5514..5a928211 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/items/HookGeary.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/items/HookGeary.java @@ -1,12 +1,8 @@ package com.hibiscusmc.hmccosmetics.hooks.items; -import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; import com.hibiscusmc.hmccosmetics.hooks.Hook; -import com.mineinabyss.geary.addons.GearyPhase; -import com.mineinabyss.geary.modules.GearyModuleKt; import com.mineinabyss.geary.papermc.tracking.items.ItemTrackingKt; import com.mineinabyss.geary.prefabs.PrefabKey; -import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -14,31 +10,19 @@ import org.jetbrains.annotations.NotNull; * A hook that integrates the plugin {@link com.mineinabyss.geary.papermc.GearyPlugin Geary} to provide custom items */ public class HookGeary extends Hook { - private boolean enabled = false; public HookGeary() { super("geary"); setEnabledItemHook(true); } - @Override - public void load() { - if (!enabled) GearyModuleKt.getGeary().getPipeline().runOnOrAfter(GearyPhase.INIT_ENTITIES, () -> { - enabled = true; - HMCCosmeticsPlugin.setup(); - return null; - }); - } - /** * Gets a cosmetic {@link ItemStack} that is associated with the provided id from the plugin {@link com.mineinabyss.geary.papermc.GearyPlugin Geary} */ @Override public ItemStack getItem(@NotNull String itemId) { - if (enabled) { - PrefabKey prefabKey = PrefabKey.Companion.ofOrNull(itemId); - if (prefabKey == null) return null; - return ItemTrackingKt.getGearyItems().createItem(prefabKey, null); - } else return new ItemStack(Material.AIR); + PrefabKey prefabKey = PrefabKey.Companion.ofOrNull(itemId); + if (prefabKey == null) return null; + return ItemTrackingKt.getGearyItems().createItem(prefabKey, null); } }