public class PotionEffect extends java.lang.Object implements java.lang.Comparable<PotionEffect>
Modifier and Type | Field and Description |
---|---|
private int |
amplifier |
private java.util.List<ItemStack> |
curativeItems
List of ItemStack that can cure the potion effect
|
private int |
duration |
private boolean |
isAmbient |
private boolean |
isPotionDurationMax |
private boolean |
isSplashPotion |
private static org.apache.logging.log4j.Logger |
LOGGER |
private Potion |
potion |
private boolean |
showParticles |
Constructor and Description |
---|
PotionEffect(Potion potionIn) |
PotionEffect(PotionEffect other) |
PotionEffect(Potion potionIn,
int durationIn) |
PotionEffect(Potion potionIn,
int durationIn,
int amplifierIn) |
PotionEffect(Potion potionIn,
int durationIn,
int amplifierIn,
boolean ambientIn,
boolean showParticlesIn) |
Modifier and Type | Method and Description |
---|---|
void |
addCurativeItem(ItemStack stack)
Adds the given stack to the list of curative items for this PotionEffect
|
void |
combine(PotionEffect other) |
int |
compareTo(PotionEffect p_compareTo_1_) |
private int |
deincrementDuration() |
boolean |
doesShowParticles() |
boolean |
equals(java.lang.Object p_equals_1_) |
int |
getAmplifier() |
java.util.List<ItemStack> |
getCurativeItems()
Returns a list of curative items for the potion effect
By default, this list is initialized using
Potion.getCurativeItems() |
int |
getDuration() |
java.lang.String |
getEffectName() |
boolean |
getIsAmbient() |
boolean |
getIsPotionDurationMax() |
Potion |
getPotion() |
private Potion |
getPotionRaw() |
int |
hashCode() |
boolean |
isCurativeItem(ItemStack stack)
Checks the given ItemStack to see if it is in the list of curative items for the potion effect
|
boolean |
onUpdate(EntityLivingBase entityIn) |
void |
performEffect(EntityLivingBase entityIn) |
private static PotionEffect |
readCurativeItems(PotionEffect effect,
NBTTagCompound nbt) |
static PotionEffect |
readCustomPotionEffectFromNBT(NBTTagCompound nbt) |
void |
setCurativeItems(java.util.List<ItemStack> curativeItems)
Sets the list of curative items for this potion effect, overwriting any already present
|
void |
setPotionDurationMax(boolean maxDuration) |
java.lang.String |
toString() |
private void |
writeCurativeItems(NBTTagCompound nbt) |
NBTTagCompound |
writeCustomPotionEffectToNBT(NBTTagCompound nbt) |
private static final org.apache.logging.log4j.Logger LOGGER
private final Potion potion
private int duration
private int amplifier
private boolean isSplashPotion
private boolean isAmbient
private boolean isPotionDurationMax
private boolean showParticles
private java.util.List<ItemStack> curativeItems
public PotionEffect(Potion potionIn)
public PotionEffect(Potion potionIn, int durationIn)
public PotionEffect(Potion potionIn, int durationIn, int amplifierIn)
public PotionEffect(Potion potionIn, int durationIn, int amplifierIn, boolean ambientIn, boolean showParticlesIn)
public PotionEffect(PotionEffect other)
public void combine(PotionEffect other)
public Potion getPotion()
private Potion getPotionRaw()
public int getDuration()
public int getAmplifier()
public boolean getIsAmbient()
public boolean doesShowParticles()
public boolean onUpdate(EntityLivingBase entityIn)
private int deincrementDuration()
public void performEffect(EntityLivingBase entityIn)
public java.lang.String getEffectName()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object p_equals_1_)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound nbt)
public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound nbt)
public void setPotionDurationMax(boolean maxDuration)
public int compareTo(PotionEffect p_compareTo_1_)
compareTo
in interface java.lang.Comparable<PotionEffect>
public boolean getIsPotionDurationMax()
public java.util.List<ItemStack> getCurativeItems()
Potion.getCurativeItems()
public boolean isCurativeItem(ItemStack stack)
stack
- The ItemStack being checked against the list of curative items for this PotionEffectpublic void setCurativeItems(java.util.List<ItemStack> curativeItems)
curativeItems
- The list of ItemStacks being set to the potion effectpublic void addCurativeItem(ItemStack stack)
stack
- The ItemStack being added to the curative item listprivate void writeCurativeItems(NBTTagCompound nbt)
private static PotionEffect readCurativeItems(PotionEffect effect, NBTTagCompound nbt)