Class SpellTier

java.lang.Object
com.binaris.wizardry.api.content.spell.SpellTier
Direct Known Subclasses:
AdvancedTier, ApprenticeTier, MasterTier, NoviceTier

public class SpellTier extends Object
  • Constructor Details

    • SpellTier

      public SpellTier(int maxCharge, int upgradeLimit, int weight, int level, net.minecraft.ChatFormatting color, int progression)
  • Method Details

    • getWeightedRandomTier

      public static SpellTier getWeightedRandomTier(net.minecraft.util.RandomSource random, SpellTier... tiers)
      Returns a random tier based on the standard weighting. Currently, the standard weighting is: Basic (Novice) 60%, Apprentice 25%, Advanced 10%, Master 5%. If an array of tiers is given, it picks a tier from the array, with the same relative weights for each. For example, if the array contains APPRENTICE and MASTER, then the weighting will become: Apprentice 83.3%, Master 16.7%.
    • next

      public SpellTier next()
      Returns the tier above this one, or the same tier if this is the highest tier.
    • previous

      public SpellTier previous()
      Returns the tier below this one, or the same tier if this is the lowest tier.
    • getDescriptionFormatted

      public net.minecraft.network.chat.Component getDescriptionFormatted()
      Returns the description/name translatable for this tier formatted with the color
    • getOrCreateDescriptionId

      protected String getOrCreateDescriptionId()
    • getDescriptionId

      public String getDescriptionId()
      Will return the description ID for the tier (e.g. "tier.ebwizardry.novice") if you want the location instead, use getOrCreateLocation()
    • getOrCreateLocation

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation getOrCreateLocation()
      Will return the location for the tier, or null if it hasn't been registered yet (e.g. "ebwizardry:novice")
    • getLocation

      public net.minecraft.resources.ResourceLocation getLocation()
      Will return the location for the tier (e.g. "ebwizardry:novice")
    • setLocation

      public void setLocation(net.minecraft.resources.ResourceLocation location)
      Sets the location for this tier. This should only be called during registration.
      Parameters:
      location - The resource location for this tier
    • is

      public final boolean is(net.minecraft.resources.ResourceLocation location)
      Will return true if the tier is registered at the given location
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getColor

      public net.minecraft.ChatFormatting getColor()
    • getLevel

      public int getLevel()
    • getMaxCharge

      public int getMaxCharge()
    • getUpgradeLimit

      public int getUpgradeLimit()
    • getWeight

      public int getWeight()
    • getProgression

      public int getProgression()