Record Class FishCaughtCounter

java.lang.Object
java.lang.Record
com.wdiscute.starcatcher.io.FishCaughtCounter

public record FishCaughtCounter(int count, int fastestTicks, float averageTicks, int size, int weight, float percentile, long firstCatch, boolean caughtGolden, boolean perfectCatch, boolean hasGuideNotification) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<FishCaughtCounter>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,FishCaughtCounter>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    FishCaughtCounter(int count, int fastestTicks, float averageTicks, int size, int weight, float percentile, long firstCatch, boolean caughtGolden, boolean perfectCatch, boolean hasGuideNotification)
    Creates an instance of a FishCaughtCounter record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returns the value of the averageTicks record component.
    static void
    awardFishCaughtCounter(FishProperties fpCaught, net.minecraft.resources.ResourceLocation rl, net.minecraft.world.entity.player.Player player, int ticks, int size, int weight, float percentile, boolean perfectCatch, boolean awardToTeam, boolean golden)
     
    static void
    awardFishCaughtCounter(FishProperties fpCaught, net.minecraft.world.entity.player.Player player, int ticks, int size, int weight, float percentile, boolean perfectCatch, boolean awardToTeam, boolean golden)
     
    static boolean
    canCatchGolden(FishProperties fp, net.minecraft.server.level.ServerPlayer player)
     
    boolean
    Returns the value of the caughtGolden record component.
    int
    Returns the value of the count record component.
    create(int ticks, int size, int weight, float percentile, boolean perfectCatch, boolean golden, boolean hasGuideNotification)
     
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the fastestTicks record component.
    long
    Returns the value of the firstCatch record component.
    get(net.minecraft.world.entity.player.Player player, FishProperties loc)
     
    get(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation loc)
     
    getUpdated(int ticks, int size, int weight, float percentile, boolean perfectCatch, boolean goldenCatch, boolean hasGuideNotification)
     
    boolean
    Returns the value of the hasGuideNotification record component.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the percentile record component.
    boolean
    Returns the value of the perfectCatch record component.
     
    int
    Returns the value of the size record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the weight record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<FishCaughtCounter> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,FishCaughtCounter> STREAM_CODEC
  • Constructor Details

    • FishCaughtCounter

      public FishCaughtCounter(int count, int fastestTicks, float averageTicks, int size, int weight, float percentile, long firstCatch, boolean caughtGolden, boolean perfectCatch, boolean hasGuideNotification)
      Creates an instance of a FishCaughtCounter record class.
      Parameters:
      count - the value for the count record component
      fastestTicks - the value for the fastestTicks record component
      averageTicks - the value for the averageTicks record component
      size - the value for the size record component
      weight - the value for the weight record component
      percentile - the value for the percentile record component
      firstCatch - the value for the firstCatch record component
      caughtGolden - the value for the caughtGolden record component
      perfectCatch - the value for the perfectCatch record component
      hasGuideNotification - the value for the hasGuideNotification record component
  • Method Details

    • get

      public static FishCaughtCounter get(net.minecraft.world.entity.player.Player player, FishProperties loc)
    • get

      public static FishCaughtCounter get(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation loc)
    • createHacked

      public static FishCaughtCounter createHacked()
    • canCatchGolden

      public static boolean canCatchGolden(FishProperties fp, net.minecraft.server.level.ServerPlayer player)
    • removeNotification

      public FishCaughtCounter removeNotification()
    • create

      @Nonnull public static FishCaughtCounter create(int ticks, int size, int weight, float percentile, boolean perfectCatch, boolean golden, boolean hasGuideNotification)
    • getUpdated

      public FishCaughtCounter getUpdated(int ticks, int size, int weight, float percentile, boolean perfectCatch, boolean goldenCatch, boolean hasGuideNotification)
    • awardFishCaughtCounter

      public static void awardFishCaughtCounter(FishProperties fpCaught, net.minecraft.world.entity.player.Player player, int ticks, int size, int weight, float percentile, boolean perfectCatch, boolean awardToTeam, boolean golden)
    • awardFishCaughtCounter

      public static void awardFishCaughtCounter(FishProperties fpCaught, net.minecraft.resources.ResourceLocation rl, net.minecraft.world.entity.player.Player player, int ticks, int size, int weight, float percentile, boolean perfectCatch, boolean awardToTeam, boolean golden)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • count

      public int count()
      Returns the value of the count record component.
      Returns:
      the value of the count record component
    • fastestTicks

      public int fastestTicks()
      Returns the value of the fastestTicks record component.
      Returns:
      the value of the fastestTicks record component
    • averageTicks

      public float averageTicks()
      Returns the value of the averageTicks record component.
      Returns:
      the value of the averageTicks record component
    • size

      public int size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • weight

      public int weight()
      Returns the value of the weight record component.
      Returns:
      the value of the weight record component
    • percentile

      public float percentile()
      Returns the value of the percentile record component.
      Returns:
      the value of the percentile record component
    • firstCatch

      public long firstCatch()
      Returns the value of the firstCatch record component.
      Returns:
      the value of the firstCatch record component
    • caughtGolden

      public boolean caughtGolden()
      Returns the value of the caughtGolden record component.
      Returns:
      the value of the caughtGolden record component
    • perfectCatch

      public boolean perfectCatch()
      Returns the value of the perfectCatch record component.
      Returns:
      the value of the perfectCatch record component
    • hasGuideNotification

      public boolean hasGuideNotification()
      Returns the value of the hasGuideNotification record component.
      Returns:
      the value of the hasGuideNotification record component