Record Class BossBarView

java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.bossbar.BossBarView
Record Components:
event - the bar as the game keeps it: name, colour, overlay, the server's progress
style - the style it is drawn in
entity - the entity it belongs to, while it is loaded here; null if none was given, or it is out of sight
progress - how full it is, 0 to 1, eased smoothly towards the server's
trail - what it was a moment ago, 0 to 1, at least progress: hold it a moment after a hit, then drain it, to show what was lost
hurt - how freshly it was hit, 1 the moment of a hit falling to 0 over half a second
time - ticks since the bar appeared, with the partial tick, for animating it

public record BossBarView(net.minecraft.world.BossEvent event, net.minecraft.resources.Identifier style, @Nullable net.minecraft.world.entity.Entity entity, float progress, float trail, float hurt, float time) extends Record
A boss bar as a BossBarRenderer draws it this frame: what the game knows of it, and what CoolCatLib keeps for drawing it well.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BossBarView(net.minecraft.world.BossEvent event, net.minecraft.resources.Identifier style, @Nullable net.minecraft.world.entity.Entity entity, float progress, float trail, float hurt, float time)
    Creates an instance of a BossBarView record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.world.entity.Entity
    Returns the value of the entity record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.world.BossEvent
    Returns the value of the event record component.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the hurt record component.
    net.minecraft.network.chat.Component
     
    float
    Returns the value of the progress record component.
    net.minecraft.resources.Identifier
    Returns the value of the style record component.
    float
    Returns the value of the time record component.
    final String
    Returns a string representation of this record class.
    float
    Returns the value of the trail record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BossBarView

      public BossBarView(net.minecraft.world.BossEvent event, net.minecraft.resources.Identifier style, @Nullable @Nullable net.minecraft.world.entity.Entity entity, float progress, float trail, float hurt, float time)
      Creates an instance of a BossBarView record class.
      Parameters:
      event - the value for the event record component
      style - the value for the style record component
      entity - the value for the entity record component
      progress - the value for the progress record component
      trail - the value for the trail record component
      hurt - the value for the hurt record component
      time - the value for the time record component
  • Method Details

    • name

      public net.minecraft.network.chat.Component name()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • event

      public net.minecraft.world.BossEvent event()
      Returns the value of the event record component.
      Returns:
      the value of the event record component
    • style

      public net.minecraft.resources.Identifier style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • entity

      @Nullable public @Nullable net.minecraft.world.entity.Entity entity()
      Returns the value of the entity record component.
      Returns:
      the value of the entity record component
    • progress

      public float progress()
      Returns the value of the progress record component.
      Returns:
      the value of the progress record component
    • trail

      public float trail()
      Returns the value of the trail record component.
      Returns:
      the value of the trail record component
    • hurt

      public float hurt()
      Returns the value of the hurt record component.
      Returns:
      the value of the hurt record component
    • time

      public float time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component