public class Buff
extends java.lang.Object
| Constructor and Description |
|---|
Buff(java.lang.String potionName,
boolean isBad,
int color)
A very basic constructor, which allows for you to expand upon this and make your own
Buffs.
|
Buff(java.lang.String potionName,
boolean isBad,
int color,
net.minecraft.item.ItemStack iconStack)
Constructs a new instance of Buff.
|
Buff(java.lang.String potionName,
boolean isBad,
int color,
net.minecraft.util.ResourceLocation icon)
Constructs a new instance of Buff.
|
Buff(java.lang.String potionName,
boolean isBad,
int color,
net.minecraft.util.ResourceLocation iconMap,
int iconIndex)
Constructs a new instance of Buff.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canUpdate()
A check to see if this Buff should call the onBuffTick ever tick.
|
int |
getColor()
Retrieves the color associated with this effect.
|
net.minecraft.util.ResourceLocation |
getIconMap()
Retrieves the ResourceLocation for the iconMap used by this buff.
|
net.minecraft.item.ItemStack |
getIconStack()
Retrieves the iconStack used as this Buffs icon.
|
java.lang.String |
getPotionName()
Retrieves the basic name of the Buff, not translated, or the unlocalized key.
|
net.minecraft.util.ResourceLocation |
getStatusIcon()
Retrieves the ResourceLocation for the icon of this Buff.
|
int |
getStatusIconIndex()
Retrieves the statusIconIndex for this effect.
|
java.lang.String |
getTranslatedName()
Provides the translated name for this effect.
|
boolean |
hasStatusIcon()
A check to see if this effect has an Icon which can be rendered.
|
boolean |
isEffectBad()
Determines whether or not this effect is negative.
|
void |
onBuffTick(net.minecraft.world.World world,
net.minecraft.entity.EntityLivingBase entity,
int duration,
int power)
This method is called every time an inflicted entity updates, provided that canUpdate is
true.
|
void |
onEffectEnded() |
void |
renderInventoryEffect(int x,
int y,
BuffEffect effect,
net.minecraft.client.Minecraft mc)
A render call which is used to render this effect within the inventory, and possible
other places.
|
boolean |
shouldBeCured(net.minecraft.entity.EntityLivingBase entity,
net.minecraft.item.ItemStack stack)
A check to see whether or not this effect can be cured.
|
boolean |
shouldRenderInvText(BuffEffect effect)
A check to determine whether or not the text for this effect should be rendered in the
inventory.
|
public Buff(java.lang.String potionName,
boolean isBad,
int color,
net.minecraft.util.ResourceLocation icon)
potionName: - The name of the potionisBad: - Whether or not this potion effect has a negative effect.color: - An integer representation of an RGB color. Look into Color.getRGB for more
info on this.icon: - A ResourceLocation that points to a 18x icon texture that represents this
potion.public Buff(java.lang.String potionName,
boolean isBad,
int color,
net.minecraft.util.ResourceLocation iconMap,
int iconIndex)
potionName: - The name of the potionisBad: - Whether or not this potion effect has a negative effect.color: - An integer representation of an RGB color. Look into Color.getRGB for more
info on this.iconMap: - A ResourceLocation that points to a 144x texture map, which contains 64
18x sprites.iconIndex: - The sprite to use on the map. 0 is the first sprite, and 64 is the
last. The formula used when rendering is X = index % 8 * 18 and Y = index / 8
* 18. The appropriate indexes are also labeled in the example map.public Buff(java.lang.String potionName,
boolean isBad,
int color,
net.minecraft.item.ItemStack iconStack)
potionName: - The name of the potionisBad: - Whether or not this potion effect has a negative effect.color: - An integer representation of an RGB color. Look into Color.getRGB for more
info on this.iconStack: - An ItemStack that is used to grab an icon, which will be used when
rendering the potion in the status HUD.public Buff(java.lang.String potionName,
boolean isBad,
int color)
potionName: - The name of the potionisBad: - Whether or not this potion effect has a negative effect.color: - An integer representation of an RGB color. Look into Color.getRGB for more
info on this.public boolean canUpdate()
public void onBuffTick(net.minecraft.world.World world,
net.minecraft.entity.EntityLivingBase entity,
int duration,
int power)
world: - An instance of the World that this is taking place in.entity: - The entity that has the effect.duration: - The remaining duration of the effect.power: - The power of the effect.public void onEffectEnded()
public boolean shouldBeCured(net.minecraft.entity.EntityLivingBase entity,
net.minecraft.item.ItemStack stack)
entity: - The entity being cured.stack: - The ItemStack being used to cure the entity.public boolean shouldRenderInvText(BuffEffect effect)
effect: - An instance of the BuffEffect in place.public int getStatusIconIndex()
public java.lang.String getPotionName()
public java.lang.String getTranslatedName()
public boolean hasStatusIcon()
public net.minecraft.util.ResourceLocation getStatusIcon()
public net.minecraft.util.ResourceLocation getIconMap()
public net.minecraft.item.ItemStack getIconStack()
public boolean isEffectBad()
public int getColor()
public void renderInventoryEffect(int x,
int y,
BuffEffect effect,
net.minecraft.client.Minecraft mc)
x: - The X coordinate to render at. An offset of 6 is recommended for most
situations.y: - The Y coordinate to render at. An offset of 7 is recommended for most
situations.effect: - An instance of the BuffEffect object.mc: - An instance of Minecraft, for convenience.