Skip to content

Commit

Permalink
javadoc for mount health bar event
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDeathlyCow committed Apr 5, 2024
1 parent 507501a commit 11635bd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loader_version=0.15.7


# Mod Properties
mod_version=2.3-SNAPSHOT
mod_version=2.3
maven_group=com.github.thedeathlycow
archives_base_name=thermoo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ public class StatusBarOverlayRenderEvents {
}
);

/**
* Invoked after the players mount health is drawn.
* <p>
* Is not integrated with Colorful Hearts or Overflowing Bars by default, however these mods do not override the mount
* health.
* <p>
* Note that indexes are backwards from the regular health: index 0 is the heart on the far RIGHT of the screen.
* Adjust half-hearts accordingly.
*/
public static final Event<RenderMountHealthBarCallback> AFTER_MOUNT_HEALTH_BAR = EventFactory.createArrayBacked(
RenderMountHealthBarCallback.class,
callbacks -> (context, player, mount, mountHeartPositions, displayMountHealth, maxDisplayMountHealth) -> {
Expand Down Expand Up @@ -73,6 +82,15 @@ void render(
@FunctionalInterface
public interface RenderMountHealthBarCallback {

/**
* @param context Draw context
* @param player The main player
* @param mount The animal the player is riding (ex: pig, horse, camel)
* @param mountHeartPositions The positions of the hearts. Elements may be null, indicating that a heart
* should not be rendered at this index.
* @param displayMountHealth How many half hearts are to be displayed
* @param maxDisplayMountHealth The maximum number of half hearts to be displayed
*/
void render(
DrawContext context,
PlayerEntity player,
Expand Down

0 comments on commit 11635bd

Please sign in to comment.