Class EntityCache

java.lang.Object
org.geysermc.geyser.session.cache.EntityCache

public class EntityCache extends Object
Each session has its own EntityCache in the occasion that an entity packet is sent specifically for that player (e.g. seeing vanished players from /vanish)
  • Constructor Details

  • Method Details

    • spawnEntity

      public void spawnEntity(Entity entity)
    • cacheEntity

      public boolean cacheEntity(Entity entity)
    • removeEntity

      public void removeEntity(Entity entity)
    • removeAllEntities

      public void removeAllEntities()
    • getEntityByGeyserId

      public Entity getEntityByGeyserId(long geyserId)
    • getEntityByJavaId

      public Entity getEntityByJavaId(int javaId)
    • addPlayerEntity

      public void addPlayerEntity(PlayerEntity entity)
    • getPlayerEntity

      public PlayerEntity getPlayerEntity(UUID uuid)
    • getPlayersByName

      public List<PlayerEntity> getPlayersByName(String name)
    • removePlayerEntity

      public PlayerEntity removePlayerEntity(UUID uuid)
    • forEachPlayerEntity

      public void forEachPlayerEntity(Consumer<PlayerEntity> player)
      Run a specific bit of code for each cached player entity. As usual with synchronized, try to minimize the amount of work you because you block the PlayerList collection.
    • removeAllPlayerEntities

      public void removeAllPlayerEntities()
    • addBossBar

      public void addBossBar(UUID uuid, BossBar bossBar)
    • getBossBar

      public BossBar getBossBar(UUID uuid)
    • removeBossBar

      public void removeBossBar(UUID uuid)
    • updateBossBars

      public void updateBossBars()
    • getTickableEntities

      public List<Tickable> getTickableEntities()
    • removeAllBossBars

      public void removeAllBossBars()
    • getEntities

      public it.unimi.dsi.fastutil.longs.Long2ObjectMap<Entity> getEntities()
    • getNextEntityId

      public AtomicLong getNextEntityId()