Class Ribbon
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.ribbon.Ribbon
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
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final long
protected final net.minecraft.network.chat.Component
protected MutableRibbonData
protected final String
-
Constructor Summary
ConstructorDescriptionRibbon
(String type, long receivedDate, net.minecraft.network.chat.Component receiver, MutableRibbonData ribbonData) -
Method Summary
Modifier and TypeMethodDescriptionstatic Ribbon.Builder
builder()
static Ribbon.Builder
boolean
static Ribbon
fromNbt
(net.minecraft.nbt.CompoundTag nbt) Reads a ribbon from NBTlong
The date (in milliseconds) that the ribbon was given to the pokemonnet.minecraft.network.chat.Component
The name of the owner of the Pokemon when it was given the ribbonThe mutable data for the ribbon.getType()
Returns the ribbon type for the given ribbonReturns the ribbon type for the given ribbonint
hashCode()
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"net.minecraft.nbt.CompoundTag
Writes the Ribbon to an NBT compount
-
Field Details
-
type
-
receivedDate
protected final long receivedDate -
receiver
protected final net.minecraft.network.chat.Component receiver -
ribbonData
-
-
Constructor Details
-
Ribbon
-
Ribbon
public Ribbon(String type, long receivedDate, net.minecraft.network.chat.Component receiver, MutableRibbonData ribbonData)
-
-
Method Details
-
getType
Returns the ribbon type for the given ribbon- Returns:
- The ribbon type
-
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
The mutable data for the ribbon. This is used by the client to know what to render- Returns:
- The data for the client
-
refreshData
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
-
hashCode
public int hashCode() -
fromNbt
Reads a ribbon from NBT- Parameters:
nbt
- the nbt being read- Returns:
- The ribbon
-
builder
-
builder
-