Package net.minecraft.potion
Class EffectInstance
- java.lang.Object
-
- net.minecraft.potion.EffectInstance
-
- All Implemented Interfaces:
java.lang.Comparable<EffectInstance>
,IForgeEffectInstance
public class EffectInstance extends java.lang.Object implements java.lang.Comparable<EffectInstance>, IForgeEffectInstance
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
ambient
private int
amplifier
private java.util.List<ItemStack>
curativeItems
private int
duration
private Effect
effect
private EffectInstance
hiddenEffect
private static org.apache.logging.log4j.Logger
LOGGER
private boolean
noCounter
private boolean
showIcon
private boolean
splash
private boolean
visible
-
Constructor Summary
Constructors Constructor Description EffectInstance(Effect p_i46811_1_)
EffectInstance(EffectInstance p_i1577_1_)
EffectInstance(Effect p_i46812_1_, int p_i46812_2_)
EffectInstance(Effect p_i46813_1_, int p_i46813_2_, int p_i46813_3_)
EffectInstance(Effect p_i46814_1_, int p_i46814_2_, int p_i46814_3_, boolean p_i46814_4_, boolean p_i46814_5_)
EffectInstance(Effect p_i48980_1_, int p_i48980_2_, int p_i48980_3_, boolean p_i48980_4_, boolean p_i48980_5_, boolean p_i48980_6_)
EffectInstance(Effect p_i230050_1_, int p_i230050_2_, int p_i230050_3_, boolean p_i230050_4_, boolean p_i230050_5_, boolean p_i230050_6_, EffectInstance p_i230050_7_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyEffect(LivingEntity p_76457_1_)
int
compareTo(EffectInstance p_compareTo_1_)
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 usingPotion#getCurativeItems
java.lang.String
getDescriptionId()
int
getDuration()
Effect
getEffect()
int
hashCode()
boolean
isAmbient()
boolean
isNoCounter()
boolean
isVisible()
static EffectInstance
load(CompoundNBT p_82722_0_)
private static EffectInstance
loadSpecifiedEffect(Effect p_230116_0_, CompoundNBT p_230116_1_)
private static EffectInstance
readCurativeItems(EffectInstance effect, CompoundNBT nbt)
CompoundNBT
save(CompoundNBT p_82719_1_)
void
setCurativeItems(java.util.List<ItemStack> curativeItems)
Sets the list of curative items for this potion effect, overwriting any already present(package private) void
setDetailsFrom(EffectInstance p_230117_1_)
void
setNoCounter(boolean p_100012_1_)
boolean
showIcon()
boolean
tick(LivingEntity p_76455_1_, java.lang.Runnable p_76455_2_)
private int
tickDownDuration()
java.lang.String
toString()
boolean
update(EffectInstance p_199308_1_)
private void
writeDetailsTo(CompoundNBT p_230119_1_)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEffectInstance
addCurativeItem, getEffectInstance, isCurativeItem, renderHUDEffect, renderInventoryEffect, shouldRender, shouldRenderHUD, shouldRenderInvText, writeCurativeItems
-
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
effect
private final Effect effect
-
duration
private int duration
-
amplifier
private int amplifier
-
splash
private boolean splash
-
ambient
private boolean ambient
-
noCounter
private boolean noCounter
-
visible
private boolean visible
-
showIcon
private boolean showIcon
-
hiddenEffect
@Nullable private EffectInstance hiddenEffect
-
curativeItems
private java.util.List<ItemStack> curativeItems
-
-
Constructor Detail
-
EffectInstance
public EffectInstance(Effect p_i46811_1_)
-
EffectInstance
public EffectInstance(Effect p_i46812_1_, int p_i46812_2_)
-
EffectInstance
public EffectInstance(Effect p_i46813_1_, int p_i46813_2_, int p_i46813_3_)
-
EffectInstance
public EffectInstance(Effect p_i46814_1_, int p_i46814_2_, int p_i46814_3_, boolean p_i46814_4_, boolean p_i46814_5_)
-
EffectInstance
public EffectInstance(Effect p_i48980_1_, int p_i48980_2_, int p_i48980_3_, boolean p_i48980_4_, boolean p_i48980_5_, boolean p_i48980_6_)
-
EffectInstance
public EffectInstance(Effect p_i230050_1_, int p_i230050_2_, int p_i230050_3_, boolean p_i230050_4_, boolean p_i230050_5_, boolean p_i230050_6_, @Nullable EffectInstance p_i230050_7_)
-
EffectInstance
public EffectInstance(EffectInstance p_i1577_1_)
-
-
Method Detail
-
setDetailsFrom
void setDetailsFrom(EffectInstance p_230117_1_)
-
update
public boolean update(EffectInstance p_199308_1_)
-
getEffect
public Effect getEffect()
-
getDuration
public int getDuration()
-
getAmplifier
public int getAmplifier()
-
isAmbient
public boolean isAmbient()
-
isVisible
public boolean isVisible()
-
showIcon
public boolean showIcon()
-
tick
public boolean tick(LivingEntity p_76455_1_, java.lang.Runnable p_76455_2_)
-
tickDownDuration
private int tickDownDuration()
-
applyEffect
public void applyEffect(LivingEntity p_76457_1_)
-
getDescriptionId
public java.lang.String getDescriptionId()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object p_equals_1_)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
save
public CompoundNBT save(CompoundNBT p_82719_1_)
-
writeDetailsTo
private void writeDetailsTo(CompoundNBT p_230119_1_)
-
load
public static EffectInstance load(CompoundNBT p_82722_0_)
-
loadSpecifiedEffect
private static EffectInstance loadSpecifiedEffect(Effect p_230116_0_, CompoundNBT p_230116_1_)
-
setNoCounter
public void setNoCounter(boolean p_100012_1_)
-
isNoCounter
public boolean isNoCounter()
-
compareTo
public int compareTo(EffectInstance p_compareTo_1_)
- Specified by:
compareTo
in interfacejava.lang.Comparable<EffectInstance>
-
getCurativeItems
public java.util.List<ItemStack> getCurativeItems()
Description copied from interface:IForgeEffectInstance
Returns a list of curative items for the potion effect By default, this list is initialized usingPotion#getCurativeItems
- Specified by:
getCurativeItems
in interfaceIForgeEffectInstance
- Returns:
- The list (ItemStack) of curative items for the potion effect
-
setCurativeItems
public void setCurativeItems(java.util.List<ItemStack> curativeItems)
Description copied from interface:IForgeEffectInstance
Sets the list of curative items for this potion effect, overwriting any already present- Specified by:
setCurativeItems
in interfaceIForgeEffectInstance
- Parameters:
curativeItems
- The list of ItemStacks being set to the potion effect
-
readCurativeItems
private static EffectInstance readCurativeItems(EffectInstance effect, CompoundNBT nbt)
-
-