Class SpellTier
java.lang.Object
com.binaris.wizardry.api.content.spell.SpellTier
- Direct Known Subclasses:
AdvancedTier,ApprenticeTier,MasterTier,NoviceTier
-
Constructor Summary
ConstructorsConstructorDescriptionSpellTier(int maxCharge, int upgradeLimit, int weight, int level, net.minecraft.ChatFormatting color, int progression) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.ChatFormattinggetColor()net.minecraft.network.chat.ComponentReturns the description/name translatable for this tier formatted with the colorWill return the description ID for the tier (e.g.intgetLevel()net.minecraft.resources.ResourceLocationWill return the location for the tier (e.g.intprotected String@Nullable net.minecraft.resources.ResourceLocationWill return the location for the tier, or null if it hasn't been registered yet (e.g.intintintstatic SpellTiergetWeightedRandomTier(net.minecraft.util.RandomSource random, SpellTier... tiers) Returns a random tier based on the standard weighting.final booleanis(net.minecraft.resources.ResourceLocation location) Will return true if the tier is registered at the given locationnext()Returns the tier above this one, or the same tier if this is the highest tier.previous()Returns the tier below this one, or the same tier if this is the lowest tier.voidsetLocation(net.minecraft.resources.ResourceLocation location) Sets the location for this tier.toString()
-
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
Returns the tier above this one, or the same tier if this is the highest tier. -
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
-
getDescriptionId
Will return the description ID for the tier (e.g. "tier.ebwizardry.novice") if you want the location instead, usegetOrCreateLocation() -
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
-
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()
-