public interface IMagicHelper
Interface for magic related helper methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    awardLevel(net.minecraft.world.entity.player.Player player, int levels)
    Awards the given amount of magic levels to the given player.
    void
    awardXp(net.minecraft.world.entity.player.Player player, float amount)
    Awards the given amount of magic xp to the given player.
    int
    getLevel(net.minecraft.world.entity.player.Player player)
     
    float
    getXp(net.minecraft.world.entity.player.Player player)
     
    float
    getXpForNextLevel(int level)
     
    boolean
    knowsMagic(net.minecraft.world.entity.player.Player player)
     
    void
    setLevel(net.minecraft.world.entity.player.Player player, int level)
    Sets the given magic level for the given player.
    void
    setXp(net.minecraft.world.entity.player.Player player, float amount)
    Sets the given amount of magic xp for the given player.
  • Method Details

    • getLevel

      int getLevel(net.minecraft.world.entity.player.Player player)
      Parameters:
      player - The player to get the magic level for.
      Returns:
      The magic level of the given player.
    • getXp

      float getXp(net.minecraft.world.entity.player.Player player)
      Parameters:
      player - The player to get the magic xp for.
      Returns:
      The magic xp of the given player.
    • getXpForNextLevel

      float getXpForNextLevel(int level)
      Parameters:
      level - The current magic level.
      Returns:
      The magic xp required to level from the given level to the next magic level.
    • awardXp

      void awardXp(net.minecraft.world.entity.player.Player player, float amount)
      Awards the given amount of magic xp to the given player. Also handles leveling.
      Parameters:
      player - The player to award the magic xp to.
      amount - The amount of magic xp to award.
    • setXp

      void setXp(net.minecraft.world.entity.player.Player player, float amount)
      Sets the given amount of magic xp for the given player. Also handles leveling.
      Parameters:
      player - The player to set the magic xp for.
      amount - The amount of magic xp to set.
    • awardLevel

      void awardLevel(net.minecraft.world.entity.player.Player player, int levels)
      Awards the given amount of magic levels to the given player. Also handles leveling.
      Parameters:
      player - The player to award the magic levels to.
      levels - The amount of magic levels to award.
    • setLevel

      void setLevel(net.minecraft.world.entity.player.Player player, int level)
      Sets the given magic level for the given player. Also handles leveling.
      Parameters:
      player - The player to set the magic level for.
      level - The magic level to set.
    • knowsMagic

      boolean knowsMagic(net.minecraft.world.entity.player.Player player)
      Parameters:
      player - The player to check.
      Returns:
      True if the player knows magic, false otherwise.