3333import net .fabricmc .api .Environment ;
3434
3535public interface IForgeEffect {
36-
3736 default StatusEffect getEffect () {
3837 return (StatusEffect ) this ;
3938 }
4039
4140 /**
42- * If the Potion effect should be displayed in the players inventory
43- * @param effect the active PotionEffect
41+ * Returns true if the {@link StatusEffectInstance} should be displayed in the player's inventory.
42+ *
43+ * @param effect the active {@link StatusEffectInstance}
4444 * @return true to display it (default), false to hide it.
4545 */
46- default boolean shouldRender (StatusEffectInstance effect ) { return true ; }
46+ default boolean shouldRender (StatusEffectInstance effect ) {
47+ return true ;
48+ }
4749
4850 /**
49- * If the standard PotionEffect text (name and duration) should be drawn when this potion is active.
50- * @param effect the active PotionEffect
51+ * Returns true if the {@link StatusEffectInstance} text (name and duration) should be drawn when this {@link StatusEffect} is active.
52+ *
53+ * @param effect the active {@link StatusEffectInstance}
5154 * @return true to draw the standard text
5255 */
53- default boolean shouldRenderInvText (StatusEffectInstance effect ) { return true ; }
56+ default boolean shouldRenderInvText (StatusEffectInstance effect ) {
57+ return true ;
58+ }
5459
5560 /**
56- * If the Potion effect should be displayed in the player's ingame HUD
57- * @param effect the active PotionEffect
61+ * Returns true if the {@link StatusEffectInstance} should be displayed in the player's {@link net.minecraft.client.gui.hud.InGameHud}.
62+ *
63+ * @param effect the active {@link StatusEffectInstance}
5864 * @return true to display it (default), false to hide it.
5965 */
60- default boolean shouldRenderHUD (StatusEffectInstance effect ) { return true ; }
66+ default boolean shouldRenderHUD (StatusEffectInstance effect ) {
67+ return true ;
68+ }
6169
6270 /**
63- * Called to draw the this Potion onto the player's inventory when it's active.
64- * This can be used to e.g. render Potion icons from your own texture.
71+ * Called to draw the {@link StatusEffectInstance} onto the player's inventory when it's active.
72+ * This can be used to e.g. render {@link StatusEffect} icons from your own texture.
6573 *
66- * @param effect the active PotionEffect
67- * @param gui the gui instance
68- * @param x the x coordinate
69- * @param y the y coordinate
70- * @param z the z level
74+ * @param effect the active {@link StatusEffectInstance}
75+ * @param gui the gui instance
76+ * @param x the x coordinate
77+ * @param y the y coordinate
78+ * @param z the z level
7179 */
7280 @ Environment (EnvType .CLIENT )
73- default void renderInventoryEffect (StatusEffectInstance effect , AbstractInventoryScreen <?> gui , int x , int y , float z ) { }
81+ default void renderInventoryEffect (StatusEffectInstance effect , AbstractInventoryScreen <?> gui , int x , int y , float z ) {
82+ }
7483
7584 /**
76- * Called to draw the this Potion onto the player's ingame HUD when it's active.
77- * This can be used to e.g. render Potion icons from your own texture.
78- * @param effect the active PotionEffect
79- * @param gui the gui instance
80- * @param x the x coordinate
81- * @param y the y coordinate
82- * @param z the z level
83- * @param alpha the alpha value, blinks when the potion is about to run out
85+ * Called to draw the {@link StatusEffectInstance} onto the player's {@link net.minecraft.client.gui.hud.InGameHud} when it's active.
86+ * This can be used to e.g. render {@link StatusEffect} icons from your own texture.
87+ *
88+ * @param effect the active {@link StatusEffectInstance}
89+ * @param gui the gui instance
90+ * @param x the x coordinate
91+ * @param y the y coordinate
92+ * @param z the z level
93+ * @param alpha the alpha value, blinks when the {@link StatusEffect} is about to run out
8494 */
8595 @ Environment (EnvType .CLIENT )
86- default void renderHUDEffect (StatusEffectInstance effect , DrawableHelper gui , int x , int y , float z , float alpha ) { }
96+ default void renderHUDEffect (StatusEffectInstance effect , DrawableHelper gui , int x , int y , float z , float alpha ) {
97+ }
8798
8899 /**
89- * Get a fresh list of items that can cure this Potion.
90- * All new PotionEffects created from this Potion will call this to initialize the default curative items
91- * @return A list of items that can cure this Potion
100+ * Returns a fresh list of items that can cure this {@link StatusEffect}.
101+ * All new {@link StatusEffectInstance}s created from this {@link StatusEffect} will call this to initialize the default curative items.
102+ *
103+ * @return A list of items that can cure this {@link StatusEffect}
92104 */
93105 default List <ItemStack > getCurativeItems () {
94106 ArrayList <ItemStack > ret = new ArrayList <ItemStack >();
@@ -97,12 +109,13 @@ default List<ItemStack> getCurativeItems() {
97109 }
98110
99111 /**
100- * Used for determining {@code PotionEffect} sort order in GUIs.
101- * Defaults to the {@code PotionEffect}'s liquid color.
102- * @param potionEffect the {@code PotionEffect} instance containing the potion
103- * @return a value used to sort {@code PotionEffect}s in GUIs
112+ * Used for determining {@link StatusEffectInstance} sort order in GUIs.
113+ * Defaults to the {@link StatusEffectInstance}'s liquid color.
114+ *
115+ * @param effect the {@link StatusEffectInstance} containing the {@link StatusEffect}
116+ * @return a value used to sort {@link StatusEffectInstance}s in GUIs
104117 */
105- default int getGuiSortColor (StatusEffectInstance potionEffect ) {
118+ default int getGuiSortColor (StatusEffectInstance effect ) {
106119 return getEffect ().getColor ();
107120 }
108121}
0 commit comments