Class BlockHealth

java.lang.Object
com.hypixel.hytale.server.core.modules.blockhealth.BlockHealth
All Implemented Interfaces:
Cloneable

public class BlockHealth extends Object implements Cloneable
The remaining health of one damaged block and the game time of the last hit.
  • Field Details

  • Constructor Details

    • BlockHealth

      public BlockHealth()
    • BlockHealth

      public BlockHealth(float health, @Nonnull Instant lastDamageGameTime)
  • Method Details

    • isDestroyed

      public static boolean isDestroyed(float health)
    • isDamaged

      public static boolean isDamaged(float health)
      Only a finite health strictly between destroyed and full is a damaged block. NaN fails every comparison, so it is never damaged.
    • getHealth

      public float getHealth()
    • setHealth

      public void setHealth(float health)
    • getLastDamageGameTime

      @Nonnull public Instant getLastDamageGameTime()
    • setLastDamageGameTime

      public void setLastDamageGameTime(@Nonnull Instant lastDamageGameTime)
    • isDestroyed

      public boolean isDestroyed()
    • clone

      @Nonnull public BlockHealth clone()
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object