Package net.minecraftforge.client
Class EffectRenderer
java.lang.Object
net.minecraftforge.client.EffectRenderer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
renderHUDEffect
(MobEffectInstance effectInstance, GuiComponent gui, PoseStack poseStack, int x, int y, float z, float alpha) Called to draw the this Potion onto the player's ingame HUD when it's active.abstract void
renderInventoryEffect
(MobEffectInstance effectInstance, EffectRenderingInventoryScreen<?> gui, PoseStack poseStack, int x, int y, float z) Called to draw the this Potion onto the player's inventory when it's active.boolean
shouldRender
(MobEffectInstance effect) If the Potion effect should be displayed in the players inventoryboolean
shouldRenderHUD
(MobEffectInstance effect) If the Potion effect should be displayed in the player's ingame HUDboolean
shouldRenderInvText
(MobEffectInstance effect) If the standard PotionEffect text (name and duration) should be drawn when this potion is active.
-
Field Details
-
DUMMY
-
-
Constructor Details
-
EffectRenderer
public EffectRenderer()
-
-
Method Details
-
shouldRender
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
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
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
public abstract void renderInventoryEffect(MobEffectInstance effectInstance, EffectRenderingInventoryScreen<?> gui, PoseStack poseStack, 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:
effectInstance
- the effect instancegui
- the gui instanceposeStack
- the pose stackx
- the x coordinatey
- the y coordinatez
- the z level
-
renderHUDEffect
public abstract void renderHUDEffect(MobEffectInstance effectInstance, GuiComponent gui, PoseStack poseStack, 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:
effectInstance
- the active PotionEffectgui
- the gui instanceposeStack
- the pose stackx
- the x coordinatey
- the y coordinatez
- the z levelalpha
- the alpha value, blinks when the potion is about to run out
-