java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.value.TierValue
All Implemented Interfaces:
PropertyValue<Tier>

public class TierValue extends Object implements PropertyValue<Tier>
  • Constructor Summary

    Constructors
    Constructor
    Description
    TierValue(Tier value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    decode(net.minecraft.network.FriendlyByteBuf buffer)
    Decodes the data from the given FriendlyByteBuf When being sent to the client the BattleProperty's ID will come first so that when being de-serialized it can get a default value and then call the PropertyValue.decode(FriendlyByteBuf) method
    void
    encode(net.minecraft.network.FriendlyByteBuf buffer)
    Encodes the data to the given FriendlyByteBuf When being sent to the client the BattleProperty's ID will come first so that when being de-serialized it can get a default value and then call the PropertyValue.decode(FriendlyByteBuf) method
    get()
    Gets the current data stored in the value
    void
    read(String key, net.minecraft.nbt.CompoundTag compound)
    Reads a value from the CompoundTag with the specified key Only implement if you want the battle rule/property to be persistent
    void
    update(Tier integer)
    The method used for directly setting the stored value to an instance of the type, T, specified by the class
    void
    write(String key, net.minecraft.nbt.CompoundTag compound)
    Writes the given value to the CompoundTag with the specified key Only implement if you want the battle rule/property to be persistent

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.pixelmonmod.pixelmon.battles.api.rules.PropertyValue

    set
  • Constructor Details

    • TierValue

      public TierValue(Tier value)
  • Method Details

    • get

      public Tier get()
      Description copied from interface: PropertyValue
      Gets the current data stored in the value
      Specified by:
      get in interface PropertyValue<Tier>
      Returns:
      The data
    • update

      public void update(Tier integer)
      Description copied from interface: PropertyValue
      The method used for directly setting the stored value to an instance of the type, T, specified by the class
      Specified by:
      update in interface PropertyValue<Tier>
      Parameters:
      integer - The new value
    • encode

      public void encode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: PropertyValue
      Encodes the data to the given FriendlyByteBuf When being sent to the client the BattleProperty's ID will come first so that when being de-serialized it can get a default value and then call the PropertyValue.decode(FriendlyByteBuf) method
      Specified by:
      encode in interface PropertyValue<Tier>
      Parameters:
      buffer - The packet buffer being written to
    • decode

      public void decode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: PropertyValue
      Decodes the data from the given FriendlyByteBuf When being sent to the client the BattleProperty's ID will come first so that when being de-serialized it can get a default value and then call the PropertyValue.decode(FriendlyByteBuf) method
      Specified by:
      decode in interface PropertyValue<Tier>
      Parameters:
      buffer - The packet buffer being read from
    • write

      public void write(String key, net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: PropertyValue
      Writes the given value to the CompoundTag with the specified key Only implement if you want the battle rule/property to be persistent
      Specified by:
      write in interface PropertyValue<Tier>
      Parameters:
      key - The key being stored under
      compound - The compound being written to
    • read

      public void read(String key, net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: PropertyValue
      Reads a value from the CompoundTag with the specified key Only implement if you want the battle rule/property to be persistent
      Specified by:
      read in interface PropertyValue<Tier>
      Parameters:
      key - The key being stored under
      compound - The compound being read from