mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-30 12:29:16 +00:00
Merge remote-tracking branch 'origin/remapped' into remapped
This commit is contained in:
@@ -11,6 +11,7 @@ public class ItemHooks {
|
||||
|
||||
private static HashMap<String, ItemHook> itemHooks = new HashMap<>();
|
||||
private static OraxenHook ORAXEN_HOOK = new OraxenHook();
|
||||
private static LootyHook LOOTY_HOOK = new LootyHook();
|
||||
private static ItemAdderHook ITEMADDER_HOOK = new ItemAdderHook();
|
||||
private static MythicHook MYTHIC_HOOK = new MythicHook();
|
||||
private static HMCCosmeticsHook HMCCOSMETIC_HOOK = new HMCCosmeticsHook();
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.hibiscusmc.hmccosmetics.hooks.items;
|
||||
|
||||
import com.mineinabyss.geary.prefabs.PrefabKey;
|
||||
import com.mineinabyss.looty.LootyFactory;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class LootyHook extends ItemHook implements Listener {
|
||||
|
||||
public LootyHook() {
|
||||
super("looty");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(String itemid) {
|
||||
PrefabKey prefabKey = PrefabKey.Companion.ofOrNull(itemid);
|
||||
if (prefabKey == null) return null;
|
||||
return LootyFactory.INSTANCE.createFromPrefab(prefabKey);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.hibiscusmc.hmccosmetics.hooks.items;
|
||||
|
||||
import io.th0rgal.oraxen.api.OraxenItems;
|
||||
import io.th0rgal.oraxen.items.ItemBuilder;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@@ -12,6 +13,8 @@ public class OraxenHook extends ItemHook implements Listener {
|
||||
|
||||
@Override
|
||||
public ItemStack get(String itemid) {
|
||||
return OraxenItems.getItemById(itemid).build();
|
||||
ItemBuilder builder = OraxenItems.getItemById(itemid);
|
||||
if (builder == null) return null;
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user