Class Cards
java.lang.Object
com.pixelmonmod.tcg.api.accessors.Cards
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableCard
Returns a card of the specified unique card code, non case-sensitivestatic net.minecraft.core.Holder
<ImmutableCard> fromNBT
(net.minecraft.nbt.CompoundTag tag) Gets a card from an NBT tag, mostly used for going from CardItems to an ImmutableCard instancestatic ImmutableCard
fromPokemonID
(int pokemonID) Gets a card based on the Pokemon national dex ID #static Collection
<ImmutableCard> getAll
(net.minecraft.core.HolderLookup.Provider registryAccess) static List
<net.minecraft.core.Holder<ImmutableCard>> getCardsInRarities
(net.minecraft.core.Holder<CardSet> set, net.minecraft.tags.TagKey<CardRarity> rarityTagKey) Gets all the cards in the specified set for the given raritiesstatic net.minecraft.core.Holder
<ImmutableCard> getEnergyCard
(net.minecraft.tags.TagKey<ImmutableCard> energyTag) Gets a card of a specific type of energystatic List
<net.minecraft.core.Holder<ImmutableCard>> Gets a List of all energy cardsstatic net.minecraft.core.Holder
<ImmutableCard> Returns a random, non special energy (e.g.static ImmutableCard
Gets a random card from all cardsstatic net.minecraft.core.Holder
<ImmutableCard> getRandomCardOfRarity
(net.minecraft.core.Holder<CardSet> set, net.minecraft.tags.TagKey<CardRarity> cardRarity) Gets a single random card in a set for a specified raritystatic Optional
<net.minecraft.core.Holder<ImmutableCard>> getRandomEnergyCard
(net.minecraft.tags.TagKey<ImmutableCard> energyTag) Gets a random card of a specific typestatic net.minecraft.core.Holder
<ImmutableCard> getRareOrBetterCard
(net.minecraft.core.Holder<CardSet> set, 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.
-
Constructor Details
-
Cards
public Cards()
-
-
Method Details
-
getAll
public static Collection<ImmutableCard> getAll(net.minecraft.core.HolderLookup.Provider registryAccess) -
getRandomEnergyCard
public static Optional<net.minecraft.core.Holder<ImmutableCard>> getRandomEnergyCard(net.minecraft.tags.TagKey<ImmutableCard> energyTag) Gets a random card of a specific type- Parameters:
energyTag
- - The tag of the energy you want- Returns:
- - A random card of the specified type
-
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 net.minecraft.core.Holder<ImmutableCard> getRareOrBetterCard(net.minecraft.core.Holder<CardSet> set, 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:
set
- - The set to get the card fromweight
- - 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<net.minecraft.core.Holder<ImmutableCard>> getCardsInRarities(net.minecraft.core.Holder<CardSet> set, net.minecraft.tags.TagKey<CardRarity> rarityTagKey) Gets all the cards in the specified set for the given rarities- Parameters:
set
- - ID of the set you want to checkrarityTagKey
- - Set of rarities you want cards of- Returns:
- - List of Cards in the specified rarities
-
getRandomCardOfRarity
public static net.minecraft.core.Holder<ImmutableCard> getRandomCardOfRarity(net.minecraft.core.Holder<CardSet> set, net.minecraft.tags.TagKey<CardRarity> cardRarity) Gets a single random card in a set for a specified rarity- Parameters:
set
- - The set you want the card fromcardRarity
- - The rarity of the card- Returns:
- - The card of the given rarity in the given set
-
getRandomCard
Gets a random card from all cards- Returns:
- A random card from all cards
-
getEnergyCards
Gets a List of all energy cards- Returns:
- A list of all energy Cards
-
getEnergyCard
public static net.minecraft.core.Holder<ImmutableCard> getEnergyCard(net.minecraft.tags.TagKey<ImmutableCard> energyTag) Gets a card of a specific type of energy- Parameters:
energyTag
- - The Energy type you want the card of- Returns:
- - A card of that specific energy.
-
fromPokemonID
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
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
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
-