public class Potion extends IForgeRegistryEntry.Impl<Potion>
IForgeRegistryEntry.Impl<T extends IForgeRegistryEntry<T>>
Modifier and Type | Field and Description |
---|---|
private java.util.Map<IAttribute,AttributeModifier> |
attributeModifierMap |
private boolean |
beneficial |
private double |
effectiveness |
private boolean |
isBadEffect |
private int |
liquidColor |
private java.lang.String |
name |
static RegistryNamespaced<ResourceLocation,Potion> |
REGISTRY |
private int |
statusIconIndex |
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.
|
int |
getGuiSortColor(PotionEffect potionEffect)
Used for determining
PotionEffect sort order in GUIs. |
static int |
getIdFromPotion(Potion potionIn) |
int |
getLiquidColor() |
java.lang.String |
getName() |
static Potion |
getPotionById(int potionID) |
static java.lang.String |
getPotionDurationString(PotionEffect effect,
float durationFactor) |
static Potion |
getPotionFromResourceLocation(java.lang.String location) |
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(int x,
int y,
PotionEffect effect,
Minecraft mc,
float alpha)
|
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(int x,
int y,
PotionEffect effect,
Minecraft mc)
|
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_) |
Potion |
setPotionName(java.lang.String nameIn) |
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
public static final RegistryNamespaced<ResourceLocation,Potion> REGISTRY
private final java.util.Map<IAttribute,AttributeModifier> attributeModifierMap
private final boolean isBadEffect
private final int liquidColor
private java.lang.String name
private int statusIconIndex
private double effectiveness
private boolean beneficial
@Nullable public static Potion getPotionById(int potionID)
public static int getIdFromPotion(Potion potionIn)
@Nullable public static Potion getPotionFromResourceLocation(java.lang.String location)
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()
public Potion setPotionName(java.lang.String nameIn)
public java.lang.String getName()
protected Potion setEffectiveness(double effectivenessIn)
public boolean hasStatusIcon()
public int getStatusIconIndex()
public boolean isBadEffect()
public static java.lang.String getPotionDurationString(PotionEffect effect, float durationFactor)
public int getLiquidColor()
public Potion registerPotionAttributeModifier(IAttribute attribute, java.lang.String uniqueId, double ammount, int operation)
public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, AbstractAttributeMap attributeMapIn, int amplifier)
public java.util.Map<IAttribute,AttributeModifier> getAttributeModifierMap()
public void applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn, AbstractAttributeMap attributeMapIn, int amplifier)
public double getAttributeModifierAmount(int amplifier, AttributeModifier modifier)
public boolean shouldRender(PotionEffect effect)
effect
- the active PotionEffectpublic boolean shouldRenderInvText(PotionEffect effect)
effect
- the active PotionEffectpublic boolean shouldRenderHUD(PotionEffect effect)
effect
- the active PotionEffect@Deprecated public void renderInventoryEffect(int x, int y, PotionEffect effect, Minecraft mc)
x
- the x coordinatey
- the y coordinateeffect
- the active PotionEffectmc
- the Minecraft instance, for conveniencepublic 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 level@Deprecated public void renderHUDEffect(int x, int y, PotionEffect effect, Minecraft mc, float alpha)
x
- the x coordinatey
- the y coordinateeffect
- the active PotionEffectmc
- the Minecraft instance, for conveniencealpha
- the alpha value, blinks when the potion is about to run outpublic 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 GUIspublic boolean isBeneficial()
public Potion setBeneficial()
public static void registerPotions()