public class Potion extends ForgeRegistryEntry<Potion>
delegate
Modifier | Constructor and Description |
---|---|
protected |
Potion(boolean isBadEffectIn,
int liquidColorIn) |
Modifier and Type | Method and Description |
---|---|
void |
affectEntity(Entity source,
Entity indirectSource,
EntityLivingBase entityLivingBaseIn,
int amplifier,
double health) |
void |
applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn,
AbstractAttributeMap attributeMapIn,
int amplifier) |
double |
getAttributeModifierAmount(int amplifier,
AttributeModifier modifier) |
java.util.Map<IAttribute,AttributeModifier> |
getAttributeModifierMap() |
java.util.List<ItemStack> |
getCurativeItems()
Get a fresh list of items that can cure this Potion.
|
ITextComponent |
getDisplayName() |
int |
getGuiSortColor(PotionEffect potionEffect)
Used for determining
PotionEffect sort order in GUIs. |
static int |
getIdFromPotion(Potion potionIn) |
int |
getLiquidColor() |
java.lang.String |
getName() |
protected java.lang.String |
getOrCreateDescriptionId() |
static Potion |
getPotionById(int potionID) |
int |
getStatusIconIndex() |
boolean |
hasStatusIcon() |
boolean |
isBadEffect() |
boolean |
isBeneficial() |
boolean |
isInstant() |
boolean |
isReady(int duration,
int amplifier) |
void |
performEffect(EntityLivingBase entityLivingBaseIn,
int amplifier) |
Potion |
registerPotionAttributeModifier(IAttribute attribute,
java.lang.String uniqueId,
double ammount,
int operation) |
static void |
registerPotions() |
void |
removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn,
AbstractAttributeMap attributeMapIn,
int amplifier) |
void |
renderHUDEffect(PotionEffect effect,
Gui gui,
int x,
int y,
float z,
float alpha)
Called to draw the this Potion onto the player's ingame HUD when it's active.
|
void |
renderInventoryEffect(PotionEffect effect,
Gui gui,
int x,
int y,
float z)
Called to draw the this Potion onto the player's inventory when it's active.
|
Potion |
setBeneficial() |
protected Potion |
setEffectiveness(double effectivenessIn) |
protected Potion |
setIconIndex(int p_76399_1_,
int p_76399_2_) |
boolean |
shouldRender(PotionEffect effect)
If the Potion effect should be displayed in the players inventory
|
boolean |
shouldRenderHUD(PotionEffect effect)
If the Potion effect should be displayed in the player's ingame HUD
|
boolean |
shouldRenderInvText(PotionEffect effect)
If the standard PotionEffect text (name and duration) should be drawn when this potion is active.
|
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
@Nullable public static Potion getPotionById(int potionID)
public static int getIdFromPotion(Potion potionIn)
protected Potion setIconIndex(int p_76399_1_, int p_76399_2_)
public void performEffect(EntityLivingBase entityLivingBaseIn, int amplifier)
public void affectEntity(@Nullable Entity source, @Nullable Entity indirectSource, EntityLivingBase entityLivingBaseIn, int amplifier, double health)
public boolean isReady(int duration, int amplifier)
public boolean isInstant()
protected java.lang.String getOrCreateDescriptionId()
public java.lang.String getName()
public ITextComponent getDisplayName()
public boolean hasStatusIcon()
public int getStatusIconIndex()
public boolean isBadEffect()
protected Potion setEffectiveness(double effectivenessIn)
public int getLiquidColor()
public Potion registerPotionAttributeModifier(IAttribute attribute, java.lang.String uniqueId, double ammount, int operation)
public java.util.Map<IAttribute,AttributeModifier> getAttributeModifierMap()
public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, AbstractAttributeMap attributeMapIn, int amplifier)
public void applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn, AbstractAttributeMap attributeMapIn, int amplifier)
public double getAttributeModifierAmount(int amplifier, AttributeModifier modifier)
public boolean isBeneficial()
public Potion setBeneficial()
public static void registerPotions()
public boolean shouldRender(PotionEffect effect)
effect
- the active PotionEffectpublic boolean shouldRenderInvText(PotionEffect effect)
effect
- the active PotionEffectpublic boolean shouldRenderHUD(PotionEffect effect)
effect
- the active PotionEffectpublic void renderInventoryEffect(PotionEffect effect, Gui gui, int x, int y, float z)
effect
- the active PotionEffectgui
- the gui instancex
- the x coordinatey
- the y coordinatez
- the z levelpublic void renderHUDEffect(PotionEffect effect, Gui gui, int x, int y, float z, float alpha)
effect
- the active PotionEffectgui
- the gui instancex
- the x coordinatey
- the y coordinatez
- the z levelalpha
- the alpha value, blinks when the potion is about to run outpublic java.util.List<ItemStack> getCurativeItems()
PotionEffect.getCurativeItems()
public int getGuiSortColor(PotionEffect potionEffect)
PotionEffect
sort order in GUIs.
Defaults to the PotionEffect
's liquid color.potionEffect
- the PotionEffect
instance containing the potionPotionEffect
s in GUIs