Package org.cyclops.evilcraft.api.broom
Class BroomModifier
java.lang.Object
org.cyclops.evilcraft.api.broom.BroomModifier
Modifier for brooms
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic enum -
Constructor Summary
ConstructorsConstructorDescriptionBroomModifier(net.minecraft.resources.ResourceLocation id, BroomModifier.Type type, float defaultValue, float tierValue, int maxTiers, boolean baseModifier, List<net.minecraft.ChatFormatting> tooltipFormats, int modelColor) BroomModifier(net.minecraft.resources.ResourceLocation id, BroomModifier.Type type, float defaultValue, float tierValue, int maxTiers, boolean baseModifier, net.minecraft.ChatFormatting singleFormat, int modelColor) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddTickListener(BroomModifier.ITickListener listener) floatgetAverageColor(Map<BroomModifier, Float> modifiers) Calculate a weighted average color of the given modifiers.intfloatnet.minecraft.resources.ResourceLocationgetId()intfloatintgetName()static intgetTier(BroomModifier modifier, float value) Get the tier for the given modifier value.floatList<net.minecraft.ChatFormatting>net.minecraft.network.chat.ComponentgetTooltipLine(String prefix, float value, float bonusValue) net.minecraft.network.chat.ComponentgetTooltipLine(String prefix, float value, float bonusValue, boolean showMaxValue) getType()booleanprotected static intprepareColor(int modelColor, boolean baseModifier) booleantoString()
-
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
-
getType
-
apply
-
getDefaultValue
public float getDefaultValue() -
getTierValue
public float getTierValue() -
getMaxTiers
public int getMaxTiers() -
getMaxTierValue
public float getMaxTierValue() -
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
-
isBaseModifier
public boolean isBaseModifier() -
getTooltipFormats
-
getModelColor
public int getModelColor() -
getBakedQuadModelColor
public int getBakedQuadModelColor() -
addTickListener
-
addCollisionListener
-
getTickListeners
-
getCollisionListeners
-
getTier
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, getAverageColorFloat> (Map<BroomModifier, Float> modifiers) Calculate a weighted average color of the given modifiers.- Parameters:
modifiers- The modifiers.- Returns:
- The weighted average color.
-