Class EntityTracker

java.lang.Object
kr.toxicity.model.api.tracker.Tracker
kr.toxicity.model.api.tracker.EntityTracker
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
PlayerTracker

public class EntityTracker extends Tracker
Entity tracker
  • Constructor Details

    • EntityTracker

      @Internal public EntityTracker(@NotNull @NotNull EntityTrackerRegistry registry, @NotNull @NotNull RenderPipeline pipeline, @NotNull @NotNull TrackerModifier modifier, @NotNull @NotNull Consumer<EntityTracker> preUpdateConsumer)
      Creates entity tracker
      Parameters:
      registry - registry
      pipeline - render instance
      modifier - modifier
      preUpdateConsumer - task on pre-update
  • Method Details

    • rotation

      @NotNull public @NotNull ModelRotation rotation()
      Description copied from class: Tracker
      Gets model rotation.
      Overrides:
      rotation in class Tracker
      Returns:
      rotation
    • updateBaseEntity

      public void updateBaseEntity()
      Syncs this tracker to base entity's data.
    • registry

      @NotNull public @NotNull EntityTrackerRegistry registry()
      Gets registry.
      Returns:
      registry
    • createHitBox

      public boolean createHitBox(@Nullable @Nullable HitBoxListener listener, @NotNull @NotNull BonePredicate predicate)
      Creates hit-box
      Parameters:
      listener - listener
      predicate - predicate
      Returns:
      success
    • hitbox

      @Nullable public @Nullable HitBox hitbox(@Nullable @Nullable HitBoxListener listener, @NotNull @NotNull Predicate<RenderedBone> predicate)
      Gets or creates model's hitbox
      Parameters:
      listener - listener
      predicate - predicate
      Returns:
      hitbox or null
    • damageTintValue

      public int damageTintValue()
      Gets damage tint value
      Returns:
      value
    • damageTintValue

      public void damageTintValue(int tint)
      Sets damage tint value
      Parameters:
      tint - hex color
    • damageTint

      public void damageTint()
      Applies damage tint
    • despawn

      public void despawn()
      Description copied from class: Tracker
      Despawns this tracker to all players
      Overrides:
      despawn in class Tracker
    • location

      @NotNull public @NotNull org.bukkit.Location location()
      Description copied from class: Tracker
      Gets location of a model.
      Specified by:
      location in class Tracker
      Returns:
      location
    • sourceEntity

      @NotNull public @NotNull BaseEntity sourceEntity()
      Gets source entity
      Returns:
      source
    • cancelDamageTint

      public void cancelDamageTint()
      Cancels damage tint task
    • refresh

      @Internal public void refresh()
      Refresh this tracker
    • markPlayerForSpawn

      public boolean markPlayerForSpawn(@NotNull @NotNull org.bukkit.OfflinePlayer player)
      Marks specific player for spawning
      Parameters:
      player - player
      Returns:
      success
    • markPlayerForSpawn

      public boolean markPlayerForSpawn(@NotNull @NotNull Set<UUID> uuids)
      Marks specific player for spawning
      Parameters:
      uuids - uuids
      Returns:
      success
    • unmarkPlayerForSpawn

      public boolean unmarkPlayerForSpawn(@NotNull @NotNull org.bukkit.OfflinePlayer player)
      Unmarks specific player for spawning
      Parameters:
      player - player
      Returns:
      success
    • asTrackerData

      @NotNull public @NotNull TrackerData asTrackerData()
      Creates tracker data
      Returns:
      tracker data
    • bodyRotator

      @NotNull public @NotNull EntityBodyRotator bodyRotator()
      Gets body rotator
      Returns:
      body rotator
    • canBeSpawnedAt

      public boolean canBeSpawnedAt(@NotNull @NotNull org.bukkit.OfflinePlayer player)
      Checks this model can be spawned at given player
      Parameters:
      player - target player
      Returns:
      can be spawned
    • hideOption

      @NotNull public @NotNull EntityHideOption hideOption()
      Gets hide option of this tracker
      Returns:
      hide option
    • hideOption

      public void hideOption(@NotNull @NotNull EntityHideOption hideOption)
      Sets hide option of this tracker
      Parameters:
      hideOption - hide option
    • canBeSaved

      public boolean canBeSaved()
      Checks this tracker's data can be saved
      Returns:
      can be saved