java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.ribbon.Ribbon

public class Ribbon extends Object
This class represents a ribbon that has been given to a Pokemon. For a description of ribbons please see RibbonType This is only used to store data about the ribbon given to a Pokemon.
Since:
20/12/2022
  • Field Details

    • type

      protected final String type
    • receivedDate

      protected final long receivedDate
    • receiver

      protected final net.minecraft.network.chat.Component receiver
    • ribbonData

      protected MutableRibbonData ribbonData
  • Constructor Details

    • Ribbon

      public Ribbon(String type, long receivedDate, net.minecraft.network.chat.Component receiver)
    • Ribbon

      public Ribbon(String type, long receivedDate, net.minecraft.network.chat.Component receiver, MutableRibbonData ribbonData)
  • Method Details

    • getType

      public RegistryValue<RibbonType> getType()
      Returns the ribbon type for the given ribbon
      Returns:
      The ribbon type
    • getTypeNameLocalized

      public String getTypeNameLocalized()
      Returns the ribbon type for the given ribbon
      Returns:
      The ribbon type
    • getReceivedDate

      public long getReceivedDate()
      The date (in milliseconds) that the ribbon was given to the pokemon
      Returns:
      The date
    • getReceiver

      public net.minecraft.network.chat.Component getReceiver()
      The name of the owner of the Pokemon when it was given the ribbon
      Returns:
      The owner
    • getRibbonData

      public MutableRibbonData getRibbonData()
      The mutable data for the ribbon. This is used by the client to know what to render
      Returns:
      The data for the client
    • refreshData

      public void refreshData(Pokemon pokemon)
      Updates the mutable data that will be sent to the client This also marks the Pokemon's ribbon data as "dirty"
      Parameters:
      pokemon - The pokemon to update
    • serialize

      public net.minecraft.nbt.CompoundTag serialize()
      Writes the Ribbon to an NBT compount
      Returns:
      The NBT version of the ribbon
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • fromNbt

      public static Ribbon fromNbt(net.minecraft.nbt.CompoundTag nbt)
      Reads a ribbon from NBT
      Parameters:
      nbt - the nbt being read
      Returns:
      The ribbon
    • builder

      public static Ribbon.Builder builder()
    • builder

      public static Ribbon.Builder builder(Ribbon ribbon)