Initial commit

This commit is contained in:
Scifi9902
2026-10-12 13:57:05 -03:00
commit 4bde3b176a
2576 changed files with 212659 additions and 0 deletions
@@ -0,0 +1,32 @@
package net.crankedpvp.slotbot;
import de.tr7zw.nbtapi.NBTItem;
import net.crankedpvp.crankedutils.utils.CustomItemUtils;
import net.crankedpvp.crankedutils.utils.items.ItemUtils;
import net.crankedpvp.loottable.LootTableAPI;
import net.crankedpvp.loottable.struct.LootTableType;
import net.crankedpvp.slotbot.struct.SlotBotType;
import org.bukkit.inventory.ItemStack;
import java.util.List;
public class SlotBotAPI {
public static boolean isSlotBot(final ItemStack itemStack) {
return CustomItemUtils.getCrankedCustomItem(itemStack).equals("slotBotTicket");
}
public static SlotBotType getSlotBotType(ItemStack itemStack) {
if(ItemUtils.isAirOrNull(itemStack)) return null;
if(!isSlotBot(itemStack)) return null;
NBTItem nbtItem = new NBTItem(itemStack);
if (nbtItem.getString("slotBotType") == null) return SlotBotType.SLOT_BOT;
if (nbtItem.getString("slotBotType").equals("")) return SlotBotType.SLOT_BOT;
return SlotBotType.valueOf(nbtItem.getString("slotBotType"));
}
public static List<ItemStack> getRewards() {
return LootTableAPI.getAllLootFromLootTable(LootTableType.SLOTBOT);
}
}