Class PPRestoreItem

java.lang.Object
net.minecraft.world.item.Item
com.pixelmonmod.pixelmon.items.PixelmonItem
com.pixelmonmod.pixelmon.items.PPRestoreItem
All Implemented Interfaces:
net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.ItemLike, net.minecraftforge.common.extensions.IForgeItem
Direct Known Subclasses:
ElixirItem, EtherItem

public abstract class PPRestoreItem extends PixelmonItem
Restores the PP of a Pokémon's move.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.item.Item

    net.minecraft.world.item.Item.Properties
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Whether the item heals all PP.

    Fields inherited from class com.pixelmonmod.pixelmon.items.PixelmonItem

    bewlr

    Fields inherited from class net.minecraft.world.item.Item

    BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZE

    Fields inherited from interface net.minecraft.world.flag.FeatureElement

    FILTERED_REGISTRIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    PPRestoreItem(boolean allPP)
    Initializes a PP-restoring item.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    getMessage(boolean success)
    Gets a message based on whether the item was used successfully.
    static boolean
    restorePP(PokemonLink userPokemon, int moveIndex, boolean allPP)
    Restores a move's PP.
    static boolean
    restorePP(PokemonLink userPokemon, Attack m, int pp, boolean allPP)
    Restores a move's PP.

    Methods inherited from class net.minecraft.world.item.Item

    asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, finishUsingItem, getBarColor, getBarWidth, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getFoodProperties, getId, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getRenderPropertiesInternal, getTooltipImage, getUseDuration, hasCraftingRemainingItem, hurtEnemy, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isFireResistant, isRepairable, isValidRepairItem, mineBlock, onCraftedBy, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, releaseUsing, requiredFeatures, shouldOverrideMultiplayerNbt, toString, use, useOn, useOnRelease, verifyTagAfterLoad

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.flag.FeatureElement

    isEnabled

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeItem

    canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getShareTag, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, initCapabilities, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onInventoryTick, onItemUseFirst, onLeftClickEntity, onStopUsing, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
  • Field Details

    • allPP

      protected boolean allPP
      Whether the item heals all PP.
  • Constructor Details

    • PPRestoreItem

      public PPRestoreItem(boolean allPP)
      Initializes a PP-restoring item.
      Parameters:
      allPP - Whether the item heals all PP.
  • Method Details

    • restorePP

      public static boolean restorePP(PokemonLink userPokemon, int moveIndex, boolean allPP)
      Restores a move's PP.
      Parameters:
      userPokemon - The Pokémon using the item.
      moveIndex - The index of the move being restored.
      allPP - Whether the item heals all PP.
      Returns:
      Whether the move's PP was restored.
    • restorePP

      public static boolean restorePP(PokemonLink userPokemon, Attack m, int pp, boolean allPP)
      Restores a move's PP.
      Parameters:
      userPokemon - The Pokémon using the item.
      m - The move being restored.
      allPP - Whether to restore all PP (true) or 10 PP (false).
      Returns:
      Whether the move's PP was restored.
    • getMessage

      protected String getMessage(boolean success)
      Gets a message based on whether the item was used successfully.
      Parameters:
      success - Whether the item was used successfully.
      Returns:
      A message based on whether the item was used successfully.