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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordstatic final recordstatic enumstatic final recordstatic final recordstatic final recordstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<FishProperties> static final FishPropertiesDeprecated.use Builder insteadstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, FishProperties> static final FishProperties -
Constructor Summary
ConstructorsConstructorDescriptionFishProperties(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 aFishPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebaseChancerecord component.static FishProperties.Builderbuilder()intcalculateChance(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack rod, AbstractFishRestriction.Context context) Returns the value of thecatchInforecord component.dif()Returns the value of thedifrecord component.final booleanIndicates whether some other object is "equal to" this one.static List<FishProperties> getAllFPs(net.minecraft.core.RegistryAccess registryAccess) static List<FishProperties> getAllFPs(net.minecraft.world.level.Level level) 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) 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) net.minecraft.network.chat.Componentstatic List<FishProperties> getFishes(net.minecraft.core.RegistryAccess registryAccess) static List<FishProperties> getFishes(net.minecraft.world.level.Level level) static FishPropertiesgetFP(net.minecraft.core.RegistryAccess registryAccess, net.minecraft.resources.Identifier rl) static FishPropertiesgetFP(net.minecraft.world.level.Level level, net.minecraft.resources.Identifier rl) static net.minecraft.resources.IdentifiergetKey(net.minecraft.world.level.Level level, FishProperties fp) static List<FishProperties> getNonFishes(net.minecraft.core.RegistryAccess registryAccess) static List<FishProperties> getNonFishes(net.minecraft.world.level.Level level) static net.minecraft.core.Registry<FishProperties> getRegistry(net.minecraft.world.level.Level level) static List<FishProperties> getSecrets(net.minecraft.core.RegistryAccess registryAccess) static List<FishProperties> getSecrets(net.minecraft.world.level.Level level) static List<FishProperties> getTrophies(net.minecraft.core.RegistryAccess registryAccess) static List<FishProperties> getTrophies(net.minecraft.world.level.Level level) booleanReturns the value of thehasGuideEntryrecord component.final inthashCode()Returns a hash code value for this object.loadTreasure(net.minecraft.server.level.ServerPlayer player) static net.minecraft.world.item.ItemStackmakeItemStack(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) rarity()Returns the value of therarityrecord component.Returns the value of therestrictionsrecord component.Returns the value of thesizeWeightrecord component.static FishProperties.SizeAndWeightsizeWeight(float sizeAvg, float sizeDev, float weightAvg, float weightDev) booleanReturns the value of theskipMinigamerecord component.static voidspawnFishFromPlayerFishing(net.minecraft.server.level.ServerPlayer player, int time, boolean completedTreasure, boolean perfectCatch, int hits) star()Returns the value of thestarrecord component.net.minecraft.resources.IdentifiertoLoc(net.minecraft.world.level.Level level) @NotNull StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, FishProperties> STREAM_CODEC -
DEFAULT
Deprecated.use Builder instead -
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 aFishPropertiesrecord class.- Parameters:
catchInfo- the value for thecatchInforecord componentstar- the value for thestarrecord componentbaseChance- the value for thebaseChancerecord componentsizeWeight- the value for thesizeWeightrecord componentrarity- the value for therarityrecord componentrestrictions- the value for therestrictionsrecord componentdif- the value for thedifrecord componentskipMinigame- the value for theskipMinigamerecord componenthasGuideEntry- the value for thehasGuideEntryrecord component
-
-
Method Details
-
toString
-
getDisplayName
public net.minecraft.network.chat.Component getDisplayName() -
loadTreasure
-
toLoc
public net.minecraft.resources.Identifier toLoc(net.minecraft.world.level.Level level) -
withHideCatch
-
builder
-
getBiomesAsListFromTags
-
getBiomesBlacklistAsList
-
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
-
getFishes
-
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
-
getNonFishes
-
getAllFPs
-
getAllFPs
-
getTrophies
-
getTrophies
-
getSecrets
-
getSecrets
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
catchInfo
Returns the value of thecatchInforecord component.- Returns:
- the value of the
catchInforecord component
-
star
Returns the value of thestarrecord component.- Returns:
- the value of the
starrecord component
-
baseChance
public int baseChance()Returns the value of thebaseChancerecord component.- Returns:
- the value of the
baseChancerecord component
-
sizeWeight
Returns the value of thesizeWeightrecord component.- Returns:
- the value of the
sizeWeightrecord component
-
rarity
Returns the value of therarityrecord component.- Returns:
- the value of the
rarityrecord component
-
restrictions
Returns the value of therestrictionsrecord component.- Returns:
- the value of the
restrictionsrecord component
-
dif
Returns the value of thedifrecord component.- Returns:
- the value of the
difrecord component
-
skipMinigame
public boolean skipMinigame()Returns the value of theskipMinigamerecord component.- Returns:
- the value of the
skipMinigamerecord component
-
hasGuideEntry
public boolean hasGuideEntry()Returns the value of thehasGuideEntryrecord component.- Returns:
- the value of the
hasGuideEntryrecord component
-