Class SpriteItemHelper

java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.SpriteItemHelper

public class SpriteItemHelper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.item.ItemStack
    getPhoto(Pokemon pokemon)
    Gets a photo of a certain Pokémon.
    static net.minecraft.world.item.ItemStack
    Gets a photo of a certain Pokémon.
    getPokemon(net.minecraft.world.item.ItemStack stack)
    Gets an instance of a Pokémon depicted by a photo.
    static void
    requestUpdate(net.minecraft.world.item.ItemStack stack)
    Requests the server for an update of a Pokémon photo ItemStack
    static net.minecraft.world.item.ItemStack
    updateSprite(net.minecraft.world.item.ItemStack stack)
    Updates a SpriteItem ItemStack to have a default form/palette if they are missing on serverside

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SpriteItemHelper

      public SpriteItemHelper()
  • Method Details

    • getPhoto

      public static net.minecraft.world.item.ItemStack getPhoto(PixelmonEntity pixelmon)
      Gets a photo of a certain Pokémon.
      Parameters:
      pixelmon - The Pokémon to get a photo of.
      Returns:
      A stack with one photo of the given Pokémon.
    • getPhoto

      public static net.minecraft.world.item.ItemStack getPhoto(Pokemon pokemon)
      Gets a photo of a certain Pokémon.
      Parameters:
      pokemon - The Pokémon to get a photo of.
      Returns:
      A stack with one photo of the given Pokémon.
    • updateSprite

      public static net.minecraft.world.item.ItemStack updateSprite(net.minecraft.world.item.ItemStack stack)
      Updates a SpriteItem ItemStack to have a default form/palette if they are missing on serverside
      Parameters:
      stack - The Pokémon photo.
      Returns:
      The same photo, with added values in case they are missing.
    • requestUpdate

      public static void requestUpdate(net.minecraft.world.item.ItemStack stack)
      Requests the server for an update of a Pokémon photo ItemStack
      Parameters:
      stack - The Pokémon photo.
    • getPokemon

      public static Optional<Pokemon> getPokemon(net.minecraft.world.item.ItemStack stack)
      Gets an instance of a Pokémon depicted by a photo.
      Parameters:
      stack - The Pokémon photo.
      Returns:
      An optional containing an appropriate Pokémon, if possible.