Class Cards

java.lang.Object
com.pixelmonmod.tcg.api.accessors.Cards

public class Cards extends Object
  • Field Details

    • GSON

      public static final com.google.gson.Gson GSON
  • Constructor Details

    • Cards

      public Cards()
  • Method Details

    • register

      public static void register(com.google.gson.Gson gson, net.minecraft.resources.ResourceLocation rl, com.google.gson.JsonElement json)
    • register

      public static void register(ImmutableCard card)
    • getAll

      public static List<ImmutableCard> getAll()
    • getRandomCard

      public static ImmutableCard getRandomCard(Energy energy)
    • getRandomBasicEnergyCard

      public static ImmutableCard getRandomBasicEnergyCard()
      Returns a random, non special energy (e.g. fire, grass)
      Returns:
      Returns a random, non special energy (e.g. fire, grass)
    • getRareOrBetterCard

      public static ImmutableCard getRareOrBetterCard(int setID, float weight, boolean isHolo)
      Gets a card with a CardRarity of Rare or better, based on specific weights of the rarity of those cards (e.g. rare is more common than secret rare)
      Parameters:
      setID - - The set to get the card from
      weight - - The weight passed in from the pack (determines what rarity of card gets picked)
      isHolo - - If the card is holographic
      Returns:
      - The given card in the givene set with whatever rarity that gets found by the weight
    • getCardsInRarities

      public static List<ImmutableCard> getCardsInRarities(int setID, Set<CardRarity> rarities)
      Gets all the cards in the specified set for the given rarities
      Parameters:
      setID - - ID of the set you want to check
      rarities - - Set of rarities you want cards of
      Returns:
      - List of Cards in the specified rarities
    • getRandomCardOfRarity

      public static ImmutableCard getRandomCardOfRarity(int setID, CardRarity cardRarity, boolean isHolo)
      Gets a single random card in a set for a specified rarity
      Parameters:
      setID - - The set you want the card from
      cardRarity - - The rarity of the card
      isHolo - - If the card is holographic
      Returns:
      - The card of the given rarity in the given set
    • getRandomCard

      public static ImmutableCard getRandomCard()
      Gets a random card from all cards
      Returns:
      A random card from all cards
    • getEnergyCards

      public static List<ImmutableCard> getEnergyCards()
      Gets a List of all energy cards
      Returns:
      A list of all energy Cards
    • getEnergyCard

      public static ImmutableCard getEnergyCard(Energy energy)
      Gets a card of a specific type of energy
      Parameters:
      energy - - The Energy type you want the card of
      Returns:
      - A card of that specific energy.
    • fromPokemonID

      public static ImmutableCard fromPokemonID(int pokemonID)
      Gets a card based on the Pokemon national dex ID #
      Parameters:
      pokemonID - - The National Dex ID #
      Returns:
      - A card of the specified Pokemon Dex ID
    • fromCode

      public static ImmutableCard fromCode(String code)
      Returns a card of the specified unique card code, non case-sensitive
      Parameters:
      code - - The card code
      Returns:
      - A card of the specified code
    • fromNBT

      public static ImmutableCard fromNBT(net.minecraft.nbt.CompoundTag tag)
      Gets a card from an NBT tag, mostly used for going from CardItems to an ImmutableCard instance
      Parameters:
      tag - - The tag with the card data in it
      Returns:
      - A card of the specified code found in the NBT