public interface IAffinityHelper
Interface for affinity related helper methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyAffinityShift(net.minecraft.world.entity.player.Player player, Affinity affinity, float shift)
    Applies the affinity shift for the given player and affinity.
    void
    applyAffinityShift(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float shift)
    Applies the affinity shift for the given player and affinity.
    void
    decreaseAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount)
     
    void
    decreaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount)
     
    double
    getAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity)
     
    double
    getAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity)
     
    double
    getAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, Affinity affinity, double defaultValue)
     
    double
    getAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, double defaultValue)
     
    getAffinityForStack(net.minecraft.world.item.ItemStack stack)
     
    net.minecraft.world.item.ItemStack
     
    net.minecraft.world.item.ItemStack
    getEssenceForAffinity(net.minecraft.resources.ResourceLocation affinity)
     
    <T extends net.minecraft.world.item.Item & IAffinityItem>
    net.minecraft.world.item.ItemStack
    getStackForAffinity(T item, Affinity affinity)
     
    <T extends net.minecraft.world.item.Item & IAffinityItem>
    net.minecraft.world.item.ItemStack
    getStackForAffinity(T item, net.minecraft.resources.ResourceLocation affinity)
     
    net.minecraft.world.item.ItemStack
     
    net.minecraft.world.item.ItemStack
    getTomeForAffinity(net.minecraft.resources.ResourceLocation affinity)
     
    void
    increaseAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount)
     
    void
    increaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount)
     
    void
    lock(net.minecraft.world.entity.player.Player player)
    Locks the player's affinities.
    void
    setAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount)
     
    void
    setAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount)
     
    void
    unlock(net.minecraft.world.entity.player.Player player)
    Unlocks the player's affinities.
    void
    updateLock(net.minecraft.world.entity.player.Player player)
    Locks or unlocks the player's affinities, depending on whether an affinity is at 1.0 or not.
  • Method Details

    • getEssenceForAffinity

      net.minecraft.world.item.ItemStack getEssenceForAffinity(net.minecraft.resources.ResourceLocation affinity)
      Parameters:
      affinity - The id of the affinity to get the essence stack for.
      Returns:
      An item stack containing the affinity essence.
    • getEssenceForAffinity

      net.minecraft.world.item.ItemStack getEssenceForAffinity(Affinity affinity)
      Parameters:
      affinity - The affinity to get the essence stack for.
      Returns:
      An item stack containing the affinity essence.
    • getTomeForAffinity

      net.minecraft.world.item.ItemStack getTomeForAffinity(net.minecraft.resources.ResourceLocation affinity)
      Parameters:
      affinity - The id of the affinity to get the tome stack for.
      Returns:
      An item stack containing the affinity tome.
    • getTomeForAffinity

      net.minecraft.world.item.ItemStack getTomeForAffinity(Affinity affinity)
      Parameters:
      affinity - The affinity to get the tome stack for.
      Returns:
      An item stack containing the affinity tome.
    • getStackForAffinity

      <T extends net.minecraft.world.item.Item & IAffinityItem> net.minecraft.world.item.ItemStack getStackForAffinity(T item, net.minecraft.resources.ResourceLocation affinity)
      Type Parameters:
      T - The item implementing AffinityItem.
      Parameters:
      item - The item to make the item stack from.
      affinity - The id of the affinity to set on the item stack.
      Returns:
      An item stack of the given item with the given affinity stored in it.
    • getStackForAffinity

      <T extends net.minecraft.world.item.Item & IAffinityItem> net.minecraft.world.item.ItemStack getStackForAffinity(T item, Affinity affinity)
      Type Parameters:
      T - The item implementing AffinityItem.
      Parameters:
      item - The item to make the item stack from.
      affinity - The affinity to set on the item stack.
      Returns:
      An item stack of the given item with the given affinity stored in it.
    • getAffinityForStack

      Affinity getAffinityForStack(net.minecraft.world.item.ItemStack stack)
      Parameters:
      stack - The stack to get the affinity from.
      Returns:
      The affinity stored in the stack, or the NONE affinity if the stack does not contain one.
    • getAffinityDepth

      double getAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity)
      Parameters:
      player - The player to get the affinity depth for.
      affinity - The id of the affinity to get the depth for.
      Returns:
      The depth of the given player in the given affinity.
    • getAffinityDepth

      double getAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity)
      Parameters:
      player - The player to get the affinity depth for.
      affinity - The affinity to get the depth for.
      Returns:
      The depth of the given player in the given affinity.
    • getAffinityDepthOrElse

      double getAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, Affinity affinity, double defaultValue)
      Parameters:
      player - The player to get the affinity depth for.
      affinity - The affinity to get the depth for.
      defaultValue - The default value that will be returned if the affinity depth cannot be retrieved.
      Returns:
      The depth of the given player in the given affinity, or defaultValue if the affinity depth cannot be determined.
    • getAffinityDepthOrElse

      double getAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, double defaultValue)
      Parameters:
      player - The player to get the affinity depth for.
      affinity - The id of the affinity to get the depth for.
      defaultValue - The default value that will be returned if the affinity depth cannot be retrieved.
      Returns:
      The depth of the given player in the given affinity, or defaultValue if the affinity depth cannot be determined.
    • setAffinityDepth

      void setAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount)
      Parameters:
      player - The player to set the affinity depth for.
      affinity - The id of the affinity to set the depth for.
      amount - The amount the affinity should have.
    • setAffinityDepth

      void setAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount)
      Parameters:
      player - The player to set the affinity depth for.
      affinity - The affinity to set the depth for.
      amount - The amount the affinity should have.
    • increaseAffinityDepth

      void increaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount)
      Parameters:
      player - The player to add the affinity depth for.
      affinity - The id of the affinity to add the depth for.
      amount - The amount to add.
    • increaseAffinityDepth

      void increaseAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount)
      Parameters:
      player - The player to add the affinity depth for.
      affinity - The affinity to add the depth for.
      amount - The amount to add.
    • decreaseAffinityDepth

      void decreaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount)
      Parameters:
      player - The player to subtract the affinity depth for.
      affinity - The id of the affinity to subtract the depth for.
      amount - The amount to subtract.
    • decreaseAffinityDepth

      void decreaseAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount)
      Parameters:
      player - The player to subtract the affinity depth for.
      affinity - The affinity to subtract the depth for.
      amount - The amount to subtract.
    • applyAffinityShift

      void applyAffinityShift(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float shift)
      Applies the affinity shift for the given player and affinity.
      Parameters:
      player - The player to shift the affinity for.
      affinity - The affinity to shift.
      shift - The amount to shift.
    • applyAffinityShift

      void applyAffinityShift(net.minecraft.world.entity.player.Player player, Affinity affinity, float shift)
      Applies the affinity shift for the given player and affinity.
      Parameters:
      player - The player to shift the affinity for.
      affinity - The affinity to shift.
      shift - The amount to shift.
    • lock

      void lock(net.minecraft.world.entity.player.Player player)
      Locks the player's affinities.
      Parameters:
      player - The player to lock the affinities for.
    • unlock

      void unlock(net.minecraft.world.entity.player.Player player)
      Unlocks the player's affinities.
      Parameters:
      player - The player to unlock the affinities for.
    • updateLock

      void updateLock(net.minecraft.world.entity.player.Player player)
      Locks or unlocks the player's affinities, depending on whether an affinity is at 1.0 or not.
      Parameters:
      player - The player to lock or unlock the affinities for.