Package com.wdiscute.starcatcher.fish
Class FishApi
java.lang.Object
com.wdiscute.starcatcher.fish.FishApi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcalculateChance(FishProperties fp, net.minecraft.world.entity.Entity entity, net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack rod, AbstractFishRestriction.Context context) Calculates the chance of catching the specific FP.static List<FishProperties> getAllFPs(net.minecraft.core.RegistryAccess registryAccess) static List<FishProperties> getAllFPs(net.minecraft.world.level.Level level) static List<FishProperties> getFishes(net.minecraft.core.RegistryAccess registryAccess) static List<FishProperties> getFishes(net.minecraft.world.level.Level level) static com.mojang.datafixers.util.Pair<FishProperties, net.minecraft.resources.ResourceLocation> getFP(FishingBobEntity fbe, net.minecraft.world.entity.player.Player player, List<AbstractCatchModifier> modifiers, net.minecraft.world.item.ItemStack rod) Runs all the logic including modifiers to select which FishProperties to catch.static FishPropertiesgetFP(net.minecraft.core.RegistryAccess registryAccess, net.minecraft.resources.ResourceLocation rl) static FishPropertiesgetFP(net.minecraft.world.level.Level level, net.minecraft.resources.ResourceLocation rl) static net.minecraft.resources.ResourceLocationgetKey(net.minecraft.world.level.Level level, FishProperties fp) static List<FishProperties> getMessages(net.minecraft.core.RegistryAccess registryAccess) static List<FishProperties> getMessages(net.minecraft.world.level.Level level) 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 net.minecraft.world.item.ItemStackgetTreasure(net.minecraft.server.level.ServerPlayer player, FishProperties fp, List<AbstractCatchModifier> modifiers) static List<FishProperties> getTrophies(net.minecraft.core.RegistryAccess registryAccess) static List<FishProperties> getTrophies(net.minecraft.world.level.Level level) static net.minecraft.world.item.ItemStackmakeItemStack(net.minecraft.world.item.ItemStack rod, FishProperties fp, float percentile, boolean golden, net.minecraft.world.entity.player.Player player, boolean perfectCatch) Generates the itemstack for fishing taking into account bucketabilitystatic net.minecraft.world.item.ItemStackmakeItemStackNonBucket(FishProperties fp, float percentile, boolean golden, net.minecraft.world.entity.player.Player player, boolean perfectCatch) static voidspawnFishFromPlayerFishing(net.minecraft.server.level.ServerPlayer player, boolean completed, int time, boolean completedTreasure, boolean perfectCatch, int hits) Spawns the fished (item)entity using the FishingBobEntity linked in the player DataAttachment.
-
Constructor Details
-
FishApi
public FishApi()
-
-
Method Details
-
getFP
public static com.mojang.datafixers.util.Pair<FishProperties,net.minecraft.resources.ResourceLocation> getFP(FishingBobEntity fbe, net.minecraft.world.entity.player.Player player, List<AbstractCatchModifier> modifiers, net.minecraft.world.item.ItemStack rod) Runs all the logic including modifiers to select which FishProperties to catch. The ResourceLocation might be MISSINGNO if the FishProperties was created by a modifier, such as player-written Message-in-a-Bottle -
calculateChance
public static int calculateChance(FishProperties fp, net.minecraft.world.entity.Entity entity, net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack rod, AbstractFishRestriction.Context context) Calculates the chance of catching the specific FP. Each restriction may add, remove or modify from the base chance. If a restriction returns -9999 that is considered an impossible catch and all remaining restriction checks are ignored. None of the parameters should be passed as null as different restrictions might check for data in those parameters. -
spawnFishFromPlayerFishing
public static void spawnFishFromPlayerFishing(net.minecraft.server.level.ServerPlayer player, boolean completed, int time, boolean completedTreasure, boolean perfectCatch, int hits) Spawns the fished (item)entity using the FishingBobEntity linked in the player DataAttachment. -
makeItemStackNonBucket
public static net.minecraft.world.item.ItemStack makeItemStackNonBucket(FishProperties fp, float percentile, boolean golden, net.minecraft.world.entity.player.Player player, boolean perfectCatch) -
makeItemStack
public static net.minecraft.world.item.ItemStack makeItemStack(net.minecraft.world.item.ItemStack rod, FishProperties fp, float percentile, boolean golden, net.minecraft.world.entity.player.Player player, boolean perfectCatch) Generates the itemstack for fishing taking into account bucketability -
getTreasure
public static net.minecraft.world.item.ItemStack getTreasure(net.minecraft.server.level.ServerPlayer player, FishProperties fp, List<AbstractCatchModifier> modifiers) -
getKey
public static net.minecraft.resources.ResourceLocation 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.ResourceLocation rl) -
getFP
public static FishProperties getFP(net.minecraft.world.level.Level level, net.minecraft.resources.ResourceLocation rl) -
getNonFishes
-
getNonFishes
-
getAllFPs
-
getAllFPs
-
getTrophies
-
getTrophies
-
getMessages
-
getMessages
-