Class BroomModifier

java.lang.Object
org.cyclops.evilcraft.api.broom.BroomModifier

public class BroomModifier extends Object
Modifier for brooms
  • Constructor Details

    • BroomModifier

      public BroomModifier(net.minecraft.resources.ResourceLocation id, BroomModifier.Type type, float defaultValue, float tierValue, int maxTiers, boolean baseModifier, List<net.minecraft.ChatFormatting> tooltipFormats, int modelColor)
    • BroomModifier

      public BroomModifier(net.minecraft.resources.ResourceLocation id, BroomModifier.Type type, float defaultValue, float tierValue, int maxTiers, boolean baseModifier, net.minecraft.ChatFormatting singleFormat, int modelColor)
  • Method Details

    • prepareColor

      protected static int prepareColor(int modelColor, boolean baseModifier)
    • getId

      public net.minecraft.resources.ResourceLocation getId()
    • getName

      public String getName()
    • getType

      public BroomModifier.Type getType()
    • apply

      public float apply(float baseValue, List<Float> values)
    • getDefaultValue

      public float getDefaultValue()
    • getTierValue

      public float getTierValue()
    • getMaxTiers

      public int getMaxTiers()
    • getMaxTierValue

      public float getMaxTierValue()
    • getTranslationKey

      public String getTranslationKey()
    • showTooltip

      public boolean showTooltip()
    • getTooltipLine

      public net.minecraft.network.chat.Component getTooltipLine(String prefix, float value, float bonusValue)
    • getTooltipLine

      public net.minecraft.network.chat.Component getTooltipLine(String prefix, float value, float bonusValue, boolean showMaxValue)
    • toString

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

      public boolean isBaseModifier()
    • getTooltipFormats

      public List<net.minecraft.ChatFormatting> getTooltipFormats()
    • getModelColor

      public int getModelColor()
    • getBakedQuadModelColor

      public int getBakedQuadModelColor()
    • addTickListener

      public void addTickListener(BroomModifier.ITickListener listener)
    • addCollisionListener

      public void addCollisionListener(BroomModifier.ICollisionListener listener)
    • getTickListeners

      public List<BroomModifier.ITickListener> getTickListeners()
    • getCollisionListeners

      public List<BroomModifier.ICollisionListener> getCollisionListeners()
    • getTier

      public static int getTier(BroomModifier modifier, float value)
      Get the tier for the given modifier value.
      Parameters:
      modifier - The modifier type.
      value - The modifier value.
      Returns:
      The tier.
    • getAverageColor

      public static org.apache.commons.lang3.tuple.Triple<Float,Float,Float> getAverageColor(Map<BroomModifier,Float> modifiers)
      Calculate a weighted average color of the given modifiers.
      Parameters:
      modifiers - The modifiers.
      Returns:
      The weighted average color.