Class FishApi

java.lang.Object
com.wdiscute.starcatcher.fish.FishApi

public class FishApi extends Object
  • 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

      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.ResourceLocation rl)
    • getFP

      public static FishProperties getFP(net.minecraft.world.level.Level level, net.minecraft.resources.ResourceLocation 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)
    • getMessages

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

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