public class Potion extends IForgeRegistryEntry.Impl<Potion>
IForgeRegistryEntry.Impl<T extends IForgeRegistryEntry<T>>
Modifier and Type | Field and Description |
---|---|
static RegistryNamespaced<ResourceLocation,Potion> |
REGISTRY |
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)
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)
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
@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 PotionEffectpublic 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 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 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()