Package com.wdiscute.starcatcher.fish
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceLocationstatic final com.mojang.serialization.Codec<FishProperties> static final net.minecraft.resources.ResourceLocationstatic final net.minecraft.resources.ResourceLocationstatic final net.minecraft.resources.ResourceLocationstatic final net.minecraft.resources.ResourceLocationstatic final net.minecraft.resources.ResourceLocationstatic final net.minecraft.resources.ResourceLocationstatic final net.minecraft.resources.ResourceLocationstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, FishProperties> static final net.minecraft.resources.ResourceLocation -
Constructor Summary
ConstructorsConstructorDescriptionFishProperties(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 aFishPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddBait(BaitRestriction bait) addRarityRestriction(RarityCountRestriction.RarityCount... rarityCount) addRestriction(AbstractFishRestriction restriction) addRestrictions(AbstractFishRestriction... restriction) intReturns the value of thebaseChancerecord component.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.static FishPropertiesempty()final booleanIndicates whether some other object is "equal to" this one.extra()net.minecraft.network.chat.ComponentbooleanReturns the value of thehasGuideEntryrecord component.final inthashCode()Returns a hash code value for this object.message()rarity()Returns the value of therarityrecord component.Returns the value of therestrictionsrecord component.Returns the value of thesizeWeightrecord component.booleanReturns the value of theskipMinigamerecord component.net.minecraft.resources.ResourceLocationtextures()Returns the value of thetexturesrecord component.net.minecraft.resources.ResourceLocationtoLoc(net.minecraft.world.level.Level level) @NotNull StringtoString()Returns a string representation of this record class.trophy()withBaseChance(int baseChance) withBucketedFish(com.wdiscute.utils.MaybeStack bucket) withBucketedFish(String namespace, String path) withCatchInfo(CatchInfo catchInfo) withDaytimeRestriction(DaytimeRestriction midnight) withDifficulty(Difficulty dif) withEntityToSpawn(String namespace, String path) withEntityToSpawn(net.minecraft.core.Holder<net.minecraft.world.entity.EntityType<?>> entityTypeHolder) withFish(com.wdiscute.utils.MaybeStack fish) withFish(net.minecraft.world.item.Item fish) withFish(net.minecraft.world.item.ItemStack stack) withFish(net.neoforged.neoforge.registries.DeferredBlock<net.minecraft.world.level.block.Block> fish) withFish(net.neoforged.neoforge.registries.DeferredItem<net.minecraft.world.item.Item> fish) withHasGuideEntry(boolean hasGuideEntry) withItemToOverrideWith(com.wdiscute.utils.MaybeStack override) withMaxLimit(int max) withPercentageChance(float chance) withRarity(Rarity rarity) withRestrictions(List<AbstractFishRestriction> restrictions) withSizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation) withSizeAndWeight(SizeAndWeight sizeAndWeight) withTextures(net.minecraft.resources.ResourceLocation textures)
-
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
-
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 aFishPropertiesrecord class.- Parameters:
catchInfo- the value for thecatchInforecord 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 componenttextures- the value for thetexturesrecord component
-
-
Method Details
-
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. -
getDisplayName
public net.minecraft.network.chat.Component getDisplayName() -
toLoc
public net.minecraft.resources.ResourceLocation toLoc(net.minecraft.world.level.Level level) -
empty
-
withCatchInfo
-
withBaseChance
-
withSizeAndWeight
-
withSizeAndWeight
public FishProperties withSizeAndWeight(float sizeAverage, float sizeDeviation, float weightAverage, float weightDeviation) -
withRarity
-
withTextures
-
withHasGuideEntry
-
withRestrictions
-
withDifficulty
-
withSkipsMinigame
-
addRestriction
-
addRestrictions
-
withEntityToSpawn
public FishProperties withEntityToSpawn(net.minecraft.core.Holder<net.minecraft.world.entity.EntityType<?>> entityTypeHolder) -
withEntityToSpawn
-
withPercentageChance
-
withItemToOverrideWith
-
withMaxLimit
-
trophy
-
message
-
extra
-
withFish
-
withFish
-
withFish
public FishProperties withFish(net.neoforged.neoforge.registries.DeferredBlock<net.minecraft.world.level.block.Block> fish) -
withFish
-
withFish
-
withFish
public FishProperties withFish(net.neoforged.neoforge.registries.DeferredItem<net.minecraft.world.item.Item> fish) -
withBucketedFish
-
withBucketedFish
-
addRarityRestriction
-
withAlwaysSpawnEntity
-
addBait
-
withWeather
-
withDaytimeRestriction
-
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. -
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 '=='. -
catchInfo
Returns the value of thecatchInforecord component.- Returns:
- the value of the
catchInforecord 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
-
textures
public net.minecraft.resources.ResourceLocation textures()Returns the value of thetexturesrecord component.- Returns:
- the value of the
texturesrecord component
-