Record Class FishProperties

java.lang.Object
java.lang.Record
com.wdiscute.starcatcher.registry.FishProperties

public record FishProperties(FishProperties.CatchInfo catchInfo, FishProperties.Star star, int baseChance, FishProperties.SizeAndWeight sizeWeight, FishProperties.Rarity rarity, List<AbstractFishRestriction> restrictions, FishProperties.Difficulty dif, boolean skipMinigame, boolean hasGuideEntry) extends Record
  • Field Details

    • CODEC

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

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, FishProperties> STREAM_CODEC
    • DEFAULT

      @Deprecated public static final FishProperties DEFAULT
      Deprecated.
      use Builder instead
    • VANILLA_FISH

      public static final FishProperties VANILLA_FISH
  • Constructor Details

    • FishProperties

      public FishProperties(FishProperties.CatchInfo catchInfo, FishProperties.Star star, int baseChance, FishProperties.SizeAndWeight sizeWeight, FishProperties.Rarity rarity, List<AbstractFishRestriction> restrictions, FishProperties.Difficulty dif, boolean skipMinigame, boolean hasGuideEntry)
      Creates an instance of a FishProperties record class.
      Parameters:
      catchInfo - the value for the catchInfo record component
      star - the value for the star record component
      baseChance - the value for the baseChance record component
      sizeWeight - the value for the sizeWeight record component
      rarity - the value for the rarity record component
      restrictions - the value for the restrictions record component
      dif - the value for the dif record component
      skipMinigame - the value for the skipMinigame record component
      hasGuideEntry - the value for the hasGuideEntry record component
  • Method Details

    • toString

      @NotNull public @NotNull 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
    • getDisplayName

      public net.minecraft.network.chat.Component getDisplayName()
    • loadTreasure

      public FishProperties loadTreasure(net.minecraft.server.level.ServerPlayer player)
    • toLoc

      public net.minecraft.resources.Identifier toLoc(net.minecraft.world.level.Level level)
    • withHideCatch

      public FishProperties withHideCatch()
    • builder

      public static FishProperties.Builder builder()
    • getBiomesAsListFromTags

      public static List<net.minecraft.resources.Identifier> getBiomesAsListFromTags(List<net.minecraft.resources.Identifier> biomes, List<net.minecraft.resources.Identifier> tags, net.minecraft.world.level.Level level)
    • getBiomesBlacklistAsList

      public static List<net.minecraft.resources.Identifier> getBiomesBlacklistAsList(List<net.minecraft.resources.Identifier> biomesBlacklist, List<net.minecraft.resources.Identifier> biomesBlacklistTags, net.minecraft.world.level.Level level)
    • calculateChance

      public int calculateChance(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack rod, AbstractFishRestriction.Context context)
    • sizeWeight

      public static FishProperties.SizeAndWeight sizeWeight(float sizeAvg, float sizeDev, float weightAvg, float weightDev)
    • makeItemStack

      public static net.minecraft.world.item.ItemStack makeItemStack(net.minecraft.world.item.ItemStack rod, FishProperties fp, int size, int weight, float percentile, boolean golden, net.minecraft.world.entity.player.Player player, boolean perfectCatch)
    • spawnFishFromPlayerFishing

      public static void spawnFishFromPlayerFishing(net.minecraft.server.level.ServerPlayer player, int time, boolean completedTreasure, boolean perfectCatch, int hits)
    • getKey

      public static net.minecraft.resources.Identifier getKey(net.minecraft.world.level.Level level, FishProperties fp)
    • getFishes

      public static List<FishProperties> getFishes(net.minecraft.core.RegistryAccess registryAccess)
    • getFishes

      public static List<FishProperties> getFishes(net.minecraft.world.level.Level level)
    • getRegistry

      public static net.minecraft.core.Registry<FishProperties> getRegistry(net.minecraft.world.level.Level level)
    • getFP

      public static FishProperties getFP(net.minecraft.core.RegistryAccess registryAccess, net.minecraft.resources.Identifier rl)
    • getFP

      public static FishProperties getFP(net.minecraft.world.level.Level level, net.minecraft.resources.Identifier rl)
    • getNonFishes

      public static List<FishProperties> getNonFishes(net.minecraft.core.RegistryAccess registryAccess)
    • getNonFishes

      public static List<FishProperties> getNonFishes(net.minecraft.world.level.Level level)
    • getAllFPs

      public static List<FishProperties> getAllFPs(net.minecraft.world.level.Level level)
    • getAllFPs

      public static List<FishProperties> getAllFPs(net.minecraft.core.RegistryAccess registryAccess)
    • getTrophies

      public static List<FishProperties> getTrophies(net.minecraft.world.level.Level level)
    • getTrophies

      public static List<FishProperties> getTrophies(net.minecraft.core.RegistryAccess registryAccess)
    • getSecrets

      public static List<FishProperties> getSecrets(net.minecraft.world.level.Level level)
    • getSecrets

      public static List<FishProperties> getSecrets(net.minecraft.core.RegistryAccess registryAccess)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • catchInfo

      public FishProperties.CatchInfo catchInfo()
      Returns the value of the catchInfo record component.
      Returns:
      the value of the catchInfo record component
    • star

      public FishProperties.Star star()
      Returns the value of the star record component.
      Returns:
      the value of the star record component
    • baseChance

      public int baseChance()
      Returns the value of the baseChance record component.
      Returns:
      the value of the baseChance record component
    • sizeWeight

      public FishProperties.SizeAndWeight sizeWeight()
      Returns the value of the sizeWeight record component.
      Returns:
      the value of the sizeWeight record component
    • rarity

      public FishProperties.Rarity rarity()
      Returns the value of the rarity record component.
      Returns:
      the value of the rarity record component
    • restrictions

      public List<AbstractFishRestriction> restrictions()
      Returns the value of the restrictions record component.
      Returns:
      the value of the restrictions record component
    • dif

      Returns the value of the dif record component.
      Returns:
      the value of the dif record component
    • skipMinigame

      public boolean skipMinigame()
      Returns the value of the skipMinigame record component.
      Returns:
      the value of the skipMinigame record component
    • hasGuideEntry

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