Interface IForgeEffect

    • Method Detail

      • getEffect

        default Effect getEffect()
      • shouldRender

        default boolean shouldRender​(EffectInstance effect)
        If the Potion effect should be displayed in the players inventory
        Parameters:
        effect - the active PotionEffect
        Returns:
        true to display it (default), false to hide it.
      • shouldRenderInvText

        default boolean shouldRenderInvText​(EffectInstance effect)
        If the standard PotionEffect text (name and duration) should be drawn when this potion is active.
        Parameters:
        effect - the active PotionEffect
        Returns:
        true to draw the standard text
      • shouldRenderHUD

        default boolean shouldRenderHUD​(EffectInstance effect)
        If the Potion effect should be displayed in the player's ingame HUD
        Parameters:
        effect - the active PotionEffect
        Returns:
        true to display it (default), false to hide it.
      • renderInventoryEffect

        default void renderInventoryEffect​(EffectInstance effect,
                                           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:
        effect - the active PotionEffect
        gui - the gui instance
        mStack - The MatrixStack
        x - the x coordinate
        y - the y coordinate
        z - the z level
      • renderHUDEffect

        default void renderHUDEffect​(EffectInstance effect,
                                     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:
        effect - the active PotionEffect
        gui - the gui instance
        mStack - The MatrixStack
        x - the x coordinate
        y - the y coordinate
        z - the z level
        alpha - the alpha value, blinks when the potion is about to run out
      • getCurativeItems

        default java.util.List<ItemStack> getCurativeItems()
        Get a fresh list of items that can cure this Potion. All new PotionEffects created from this Potion will call this to initialize the default curative items
        Returns:
        A list of items that can cure this Potion
        See Also:
        PotionEffect#getCurativeItems
      • getGuiSortColor

        default int getGuiSortColor​(EffectInstance potionEffect)
        Used for determining PotionEffect sort order in GUIs. Defaults to the PotionEffect's liquid color.
        Parameters:
        potionEffect - the PotionEffect instance containing the potion
        Returns:
        a value used to sort PotionEffects in GUIs