Record Class FishProperties

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

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

    • SURFACE

      public static final net.minecraft.resources.ResourceLocation SURFACE
    • SKY

      public static final net.minecraft.resources.ResourceLocation SKY
    • LAVA_OVERWORLD

      public static final net.minecraft.resources.ResourceLocation LAVA_OVERWORLD
    • NETHER

      public static final net.minecraft.resources.ResourceLocation NETHER
    • CAVE

      public static final net.minecraft.resources.ResourceLocation CAVE
    • ICY

      public static final net.minecraft.resources.ResourceLocation ICY
    • DEEP_DARK

      public static final net.minecraft.resources.ResourceLocation DEEP_DARK
    • END

      public static final net.minecraft.resources.ResourceLocation END
    • END_VOID

      public static final net.minecraft.resources.ResourceLocation END_VOID
    • 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
  • Constructor Details

    • FishProperties

      public FishProperties(CatchInfo catchInfo, int baseChance, SizeAndWeight sizeWeight, Rarity rarity, List<AbstractFishRestriction> restrictions, Difficulty dif, boolean skipMinigame, boolean hasGuideEntry, net.minecraft.resources.ResourceLocation textures)
      Creates an instance of a FishProperties record class.
      Parameters:
      catchInfo - the value for the catchInfo 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
      textures - the value for the textures 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()
    • toLoc

      public net.minecraft.resources.ResourceLocation toLoc(net.minecraft.world.level.Level level)
    • empty

      public static FishProperties empty()
    • withCatchInfo

      public FishProperties withCatchInfo(CatchInfo catchInfo)
    • withBaseChance

      public FishProperties withBaseChance(int baseChance)
    • withSizeAndWeight

      public FishProperties withSizeAndWeight(SizeAndWeight sizeAndWeight)
    • withSizeAndWeight

      public FishProperties withSizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation)
    • withRarity

      public FishProperties withRarity(Rarity rarity)
    • withTextures

      public FishProperties withTextures(net.minecraft.resources.ResourceLocation textures)
    • withHasGuideEntry

      public FishProperties withHasGuideEntry(boolean hasGuideEntry)
    • withRestrictions

      public FishProperties withRestrictions(List<AbstractFishRestriction> restrictions)
    • withDifficulty

      public FishProperties withDifficulty(Difficulty dif)
    • withSkipsMinigame

      public FishProperties withSkipsMinigame()
    • addRestriction

      public FishProperties addRestriction(AbstractFishRestriction restriction)
    • addRestrictions

      public FishProperties addRestrictions(AbstractFishRestriction... restriction)
    • withEntityToSpawn

      public FishProperties withEntityToSpawn(net.minecraft.core.Holder<net.minecraft.world.entity.EntityType<?>> entityTypeHolder)
    • withEntityToSpawn

      public FishProperties withEntityToSpawn(String namespace, String path)
    • withPercentageChance

      public FishProperties withPercentageChance(float chance)
    • withItemToOverrideWith

      public FishProperties withItemToOverrideWith(com.wdiscute.utils.MaybeStack override)
    • withMaxLimit

      public FishProperties withMaxLimit(int max)
    • trophy

      public FishProperties trophy()
    • message

      public FishProperties message()
    • extra

      public FishProperties extra()
    • withFish

      public FishProperties withFish(com.wdiscute.utils.MaybeStack fish)
    • withFish

      public FishProperties withFish(net.minecraft.world.item.ItemStack stack)
    • withFish

      public FishProperties withFish(net.neoforged.neoforge.registries.DeferredBlock<net.minecraft.world.level.block.Block> fish)
    • withFish

      public FishProperties withFish(net.minecraft.world.item.Item fish)
    • withFish

      public FishProperties withFish(String namespace, String path)
    • withFish

      public FishProperties withFish(net.neoforged.neoforge.registries.DeferredItem<net.minecraft.world.item.Item> fish)
    • withBucketedFish

      public FishProperties withBucketedFish(com.wdiscute.utils.MaybeStack bucket)
    • withBucketedFish

      public FishProperties withBucketedFish(String namespace, String path)
    • addRarityRestriction

      public FishProperties addRarityRestriction(RarityCountRestriction.RarityCount... rarityCount)
    • withAlwaysSpawnEntity

      public FishProperties withAlwaysSpawnEntity()
    • addBait

      public FishProperties addBait(BaitRestriction bait)
    • withWeather

      public FishProperties withWeather(WeatherRestriction rain)
    • withDaytimeRestriction

      public FishProperties withDaytimeRestriction(DaytimeRestriction midnight)
    • 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)
    • 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 '=='.
      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 CatchInfo catchInfo()
      Returns the value of the catchInfo record component.
      Returns:
      the value of the catchInfo record component
    • baseChance

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

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

      public 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

      public Difficulty 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
    • textures

      public net.minecraft.resources.ResourceLocation textures()
      Returns the value of the textures record component.
      Returns:
      the value of the textures record component