Class PokeBall
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.item.pokeball.PokeBall
- All Implemented Interfaces:
ITranslatable
Class representing the look and mechanics of a Poké Ball.
Synced to client via datapacks.
-
Constructor Summary
ConstructorDescriptionPokeBall
(String name, String model, ResourceWithFallback texture, ResourceWithFallback flashingTexture, ResourceWithFallback ballSprite, ResourceWithFallback lidSprite, ResourceWithFallback guiSprite, String logic, String[] bases, String captureMethod, double catchBonus, double breakChance, double velocityModifier, double gravityModifier, boolean particles, boolean hasLid, net.minecraft.world.item.Rarity rarity, String json) Constructs a new Poké Ball. -
Method Summary
Modifier and TypeMethodDescriptionboolean
net.minecraft.world.item.ItemStack
Gets a new ItemStack of count 1 of this Poké Ball.net.minecraft.world.item.ItemStack
getBallItem
(int count) Gets a new ItemStack of this Poké Ball.net.minecraft.resources.ResourceLocation
Gets the sprite ResourceLocation of this Poké Ball.String[]
getBases()
Gets the possible bases for this Poké Ball.Set<net.minecraft.world.item.Item>
Gets a Set of the Poké Ball bases this Poké Ball can have.double
Gets the break chance of this Poké Ball.Gets the capture method used by this Poké Ball.Gets the ID of theCaptureMethod
of this Poké Ball.double
Gets the catch bonus of this Poké Ball.net.minecraft.resources.ResourceLocation
Gets the flashing texture ResourceLocation of this Poké Ball.double
Gets the gravity modifier of this Poké Ball.net.minecraft.resources.ResourceLocation
Gets the GUI sprite ResourceLocation of this Poké Ball.getJson()
Gets this Poké Ball object's JSON representation as a String, if available.net.minecraft.world.item.ItemStack
Gets a new ItemStack of count 1 of this Poké Ball's lid.net.minecraft.world.item.ItemStack
getLidItem
(int count) Gets a new ItemStack of this Poké Ball's lid.net.minecraft.resources.ResourceLocation
Gets the sprite ResourceLocation of this Poké Ball Lid.Gets the translation key of this Poké Ball's Poké Ball Lid item name.getLogic()
Gets the capture logic for this Poké Ball.Gets the classpath of theBallLogic
of this Poké Ball.getModel()
Gets the model type of this Poké Ball.Gets aModelPokeballs
instance for the givenPokeBall
getModelHolder
(boolean animate) Gets aModelPokeballs
instance for the givenPokeBall
net.minecraft.resources.ResourceLocation
Gets the texture ResourceLocation of this Poké Ball.getName()
Gets the name of this Poké Ball.net.minecraft.world.item.Item
Gets a random Poké Ball base this Poké Ball can have.net.minecraft.world.item.Rarity
The item rarity of the ballnet.minecraft.network.chat.Component
Gets the translated name of this Poké Ball's Poké Ball Lid item name.Gets the translation key of this Poké Ball's Poké Ball item name.double
Gets the velocity modifier of this Poké Ball.int
hashCode()
boolean
hasLid()
If the ball has a lid itemboolean
Gets whether this Poké Ball has a special particle trail.final boolean
is
(RegistryValue<PokeBall>... pokeballs) Checks if any of the balls in the given array match the current oneboolean
Checks if any of the balls in the given array match the current oneboolean
Gets whether this Poké Ball is a guaranteed catch or not.boolean
Checks if thePokeBall
is a Hisuian (ancient) balltoString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.pixelmonmod.pixelmon.api.util.ITranslatable
getLocalizedName, getTranslatedName
-
Constructor Details
-
PokeBall
public PokeBall(String name, String model, ResourceWithFallback texture, ResourceWithFallback flashingTexture, ResourceWithFallback ballSprite, ResourceWithFallback lidSprite, ResourceWithFallback guiSprite, String logic, String[] bases, String captureMethod, double catchBonus, double breakChance, double velocityModifier, double gravityModifier, boolean particles, boolean hasLid, net.minecraft.world.item.Rarity rarity, String json) Constructs a new Poké Ball. Generally, this should only be called by the loading of a datapack containing Poké Ball jsons, but they can be constructed manually if so desired.- Parameters:
name
- The unique name of this Poké Ball.model
- The path to the model of this Poké Ball.texture
- The path to the texture for the model of this Poké Ball.flashingTexture
- The path to the texture for the model of the Poké Ball while it is flashing.ballSprite
- The path to the sprite of the Poké Ball item of this Poké Ball.lidSprite
- The path to the sprite of the Poké Ball Lid item of this Poké Ball.guiSprite
- The path to the texture for the party sidebar visual of this Poké Ball.logic
- The classpath of theBallLogic
class of this Poké Ball. Null or empty means no special logic.bases
- Item IDs of what bases this Poké Ball uses.captureMethod
- The registeredCaptureMethod
to use for this Poké Ball.catchBonus
- The base ball bonus of this Poké Ball.breakChance
- The chance, 0-1, that this Poké Ball breaks on a miss.velocityModifier
- The multiplier by which this Poké Ball's thrown velocity is multiplied by.gravityModifier
- The multiplier by which this Poké Ball's gravity acceleration is multiplied by.particles
- Whether this Poké Ball has a rainbow particle trail or not.json
- The JSON representation of this Poké Ball object.
-
-
Method Details
-
getName
Gets the name of this Poké Ball.- Returns:
- This Poké Ball's name.
-
getModel
Gets the model type of this Poké Ball.- Returns:
- This Poké Ball's model type.
-
getBallSprite
public net.minecraft.resources.ResourceLocation getBallSprite()Gets the sprite ResourceLocation of this Poké Ball.- Returns:
- This Poké Ball's sprite ResourceLocation.
-
getLidSprite
public net.minecraft.resources.ResourceLocation getLidSprite()Gets the sprite ResourceLocation of this Poké Ball Lid.- Returns:
- This Poké Ball Lid's sprite ResourceLocation.
-
getModelTexture
public net.minecraft.resources.ResourceLocation getModelTexture()Gets the texture ResourceLocation of this Poké Ball.- Returns:
- This Poké Ball's texture ResourceLocation.
-
getFlashingTexture
public net.minecraft.resources.ResourceLocation getFlashingTexture()Gets the flashing texture ResourceLocation of this Poké Ball.- Returns:
- This Poké Ball's flashing texture ResourceLocation.
-
getGUISprite
public net.minecraft.resources.ResourceLocation getGUISprite()Gets the GUI sprite ResourceLocation of this Poké Ball.- Returns:
- This Poké Ball's GUI sprite ResourceLocation.
-
getLogic
Gets the capture logic for this Poké Ball.- Returns:
- This Poké Ball's capture logic.
-
getBases
Gets the possible bases for this Poké Ball.- Returns:
- This Poké Ball's bases.
-
getCaptureMethod
Gets the capture method used by this Poké Ball.- Returns:
- The Poké Ball's capture method.
-
getCatchBonus
public double getCatchBonus()Gets the catch bonus of this Poké Ball.- Returns:
- This Poké Ball's catch bonus.
-
isGuaranteedCatch
public boolean isGuaranteedCatch()Gets whether this Poké Ball is a guaranteed catch or not.- Returns:
- Whether this Poké Ball is a guaranteed catch.
-
getBreakChance
public double getBreakChance()Gets the break chance of this Poké Ball.- Returns:
- This Poké Ball's break chance.
-
getVelocityModifier
public double getVelocityModifier()Gets the velocity modifier of this Poké Ball.- Returns:
- This Poké Ball's velocity modifier.
-
getGravityModifier
public double getGravityModifier()Gets the gravity modifier of this Poké Ball.- Returns:
- This Poké Ball's gravity modifier.
-
hasParticles
public boolean hasParticles()Gets whether this Poké Ball has a special particle trail.- Returns:
- If this Poké Ball has a particle trail.
-
getTranslationKey
Gets the translation key of this Poké Ball's Poké Ball item name.- Specified by:
getTranslationKey
in interfaceITranslatable
- Returns:
- Poké Ball item name's translation key.
-
getLidTranslationKey
Gets the translation key of this Poké Ball's Poké Ball Lid item name.- Returns:
- Poké Ball Lid item name's translation key.
-
hasLid
public boolean hasLid()If the ball has a lid item- Returns:
- If it has a lid item
-
getTranslatedLidName
public net.minecraft.network.chat.Component getTranslatedLidName()Gets the translated name of this Poké Ball's Poké Ball Lid item name.- Returns:
- Poké Ball Lid item name's translated name.
-
is
Checks if any of the balls in the given array match the current one- Parameters:
pokeballs
- The balls being checked- Returns:
- True if a match is found
-
is
Checks if any of the balls in the given array match the current one- Parameters:
pokeballs
- The balls being checked- Returns:
- True if a match is found
-
getModelHolder
Gets aModelPokeballs
instance for the givenPokeBall
- Returns:
- The model pokeballs
-
getModelHolder
Gets aModelPokeballs
instance for the givenPokeBall
- Returns:
- The model pokeballs
-
getBallItem
public net.minecraft.world.item.ItemStack getBallItem()Gets a new ItemStack of count 1 of this Poké Ball.- Returns:
- A new ItemStack of count 1 of this Poké Ball.
-
getBallItem
public net.minecraft.world.item.ItemStack getBallItem(int count) Gets a new ItemStack of this Poké Ball.- Parameters:
count
- The size of the new ItemStack.- Returns:
- A new ItemStack of this Poké Ball.
-
getBasesAsItems
Gets a Set of the Poké Ball bases this Poké Ball can have.- Returns:
- Set of base Items.
-
getRandomBaseAsItem
public net.minecraft.world.item.Item getRandomBaseAsItem()Gets a random Poké Ball base this Poké Ball can have.- Returns:
- Random base Item.
-
getLidItem
public net.minecraft.world.item.ItemStack getLidItem()Gets a new ItemStack of count 1 of this Poké Ball's lid.- Returns:
- A new ItemStack of count 1 of this Poké Ball's lid.
-
getLidItem
public net.minecraft.world.item.ItemStack getLidItem(int count) Gets a new ItemStack of this Poké Ball's lid.- Parameters:
count
- The size of the new ItemStack.- Returns:
- A new ItemStack of this Poké Ball's lid.
-
getJson
Gets this Poké Ball object's JSON representation as a String, if available.- Returns:
- This Poké Ball's JSON representation.
-
getLogicPath
Gets the classpath of theBallLogic
of this Poké Ball. May be null or empty for no logic.- Returns:
- This Poké Ball's logic classpath.
-
getCaptureMethodID
Gets the ID of theCaptureMethod
of this Poké Ball.- Returns:
- This Poké Ball's capture method ID.
-
isHisuian
public boolean isHisuian()Checks if thePokeBall
is a Hisuian (ancient) ball- Returns:
- If the ball is from the hisui region
-
getRarity
public net.minecraft.world.item.Rarity getRarity()The item rarity of the ball- Returns:
- The rarity of the ball
-
toString
-
hashCode
public int hashCode() -
equals
-