Package com.pixelmonmod.tcg.api.card
Class CardProxy
java.lang.Object
com.pixelmonmod.tcg.api.card.CardProxy
Static proxy for accessing
CardFactory
implementation
To change the CardFactory
implementation use the setFactory(CardFactory)
method during
initialization-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Card
createCard
(net.minecraft.core.Holder<ImmutableCard> card) Creates an instance of theImmutableCard
with given random propertiesstatic net.minecraft.world.item.ItemStack
createCardItem
(net.minecraft.core.Holder<ImmutableCard> card) Creates anItemStack
intance of theImmutableCard
type passedstatic Card
readCard
(net.minecraft.world.item.ItemStack itemStack) Gets the instance of a card from the itemstatic void
setFactory
(CardFactory factory) Sets the factory implementation
-
Constructor Details
-
CardProxy
public CardProxy()
-
-
Method Details
-
setFactory
Sets the factory implementation- Parameters:
factory
- The factory implementation
-
createCardItem
public static net.minecraft.world.item.ItemStack createCardItem(net.minecraft.core.Holder<ImmutableCard> card) Creates anItemStack
intance of theImmutableCard
type passed- Parameters:
card
- The type of card to create- Returns:
- The new card item made
-
createCard
Creates an instance of theImmutableCard
with given random properties- Parameters:
card
- The type of card created- Returns:
- The instance of the card
-
readCard
Gets the instance of a card from the item- Parameters:
itemStack
- The card item- Returns:
- The card instance
-