Interface IForgeEffectInstance
-
- All Known Implementing Classes:
EffectInstance
public interface IForgeEffectInstance
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
addCurativeItem(ItemStack stack)
Adds the given stack to the list of curative items for this PotionEffectjava.util.List<ItemStack>
getCurativeItems()
Returns a list of curative items for the potion effect By default, this list is initialized usingPotion#getCurativeItems
default EffectInstance
getEffectInstance()
default boolean
isCurativeItem(ItemStack stack)
Checks the given ItemStack to see if it is in the list of curative items for the potion effectdefault void
renderHUDEffect(AbstractGui gui, MatrixStack mStack, int x, int y, float z, float alpha)
Called to draw the this Potion onto the player's ingame HUD when it's active.default void
renderInventoryEffect(DisplayEffectsScreen<?> gui, MatrixStack mStack, int x, int y, float z)
Called to draw the this Potion onto the player's inventory when it's active.void
setCurativeItems(java.util.List<ItemStack> curativeItems)
Sets the list of curative items for this potion effect, overwriting any already presentdefault boolean
shouldRender()
If the Potion effect should be displayed in the players inventorydefault boolean
shouldRenderHUD()
If the Potion effect should be displayed in the player's ingame HUDdefault boolean
shouldRenderInvText()
If the standard PotionEffect text (name and duration) should be drawn when this potion is active.default void
writeCurativeItems(CompoundNBT nbt)
-
-
-
Method Detail
-
getEffectInstance
default EffectInstance getEffectInstance()
-
shouldRender
default boolean shouldRender()
If the Potion effect should be displayed in the players inventory- Returns:
- true to display it (default), false to hide it.
-
shouldRenderInvText
default boolean shouldRenderInvText()
If the standard PotionEffect text (name and duration) should be drawn when this potion is active.- Returns:
- true to draw the standard text
-
shouldRenderHUD
default boolean shouldRenderHUD()
If the Potion effect should be displayed in the player's ingame HUD- Returns:
- true to display it (default), false to hide it.
-
renderInventoryEffect
default void renderInventoryEffect(DisplayEffectsScreen<?> gui, MatrixStack mStack, int x, int y, float z)
Called to draw the this Potion onto the player's inventory when it's active. This can be used to e.g. render Potion icons from your own texture.- Parameters:
gui
- the gui instancemStack
- The MatrixStackx
- the x coordinatey
- the y coordinatez
- the z level
-
renderHUDEffect
default void renderHUDEffect(AbstractGui gui, MatrixStack mStack, int x, int y, float z, float alpha)
Called to draw the this Potion onto the player's ingame HUD when it's active. This can be used to e.g. render Potion icons from your own texture.- Parameters:
gui
- the gui instancemStack
- The MatrixStackx
- the x coordinatey
- the y coordinatez
- the z levelalpha
- the alpha value, blinks when the potion is about to run out
-
getCurativeItems
java.util.List<ItemStack> getCurativeItems()
Returns a list of curative items for the potion effect By default, this list is initialized usingPotion#getCurativeItems
- Returns:
- The list (ItemStack) of curative items for the potion effect
-
isCurativeItem
default boolean isCurativeItem(ItemStack stack)
Checks the given ItemStack to see if it is in the list of curative items for the potion effect- Parameters:
stack
- The ItemStack being checked against the list of curative items for this PotionEffect- Returns:
- true if the given ItemStack is in the list of curative items for this PotionEffect, false otherwise
-
setCurativeItems
void setCurativeItems(java.util.List<ItemStack> curativeItems)
Sets the list of curative items for this potion effect, overwriting any already present- Parameters:
curativeItems
- The list of ItemStacks being set to the potion effect
-
addCurativeItem
default void addCurativeItem(ItemStack stack)
Adds the given stack to the list of curative items for this PotionEffect- Parameters:
stack
- The ItemStack being added to the curative item list
-
writeCurativeItems
default void writeCurativeItems(CompoundNBT nbt)
-
-