Class Blackboard

java.lang.Object
com.hypixel.hytale.server.npc.blackboard.Blackboard
All Implemented Interfaces:
Resource<EntityStore>, Cloneable

public class Blackboard extends Object implements Resource<EntityStore>
A class to facilitate caching and sharing expensive-to-retrieve information between NPCs
  • Field Details

  • Constructor Details

    • Blackboard

      public Blackboard()
  • Method Details

    • getResourceType

      public static ResourceType<EntityStore, Blackboard> getResourceType()
    • init

      public void init(@Nonnull World world)
    • onEntityDamageBlock

      public void onEntityDamageBlock(@Nonnull Ref<EntityStore> ref, @Nonnull DamageBlockEvent event)
      Called when an entity damages a block.
      Parameters:
      ref - The entity reference of the instigating entity.
      event - The damage block event.
    • onEntityBreakBlock

      public void onEntityBreakBlock(@Nonnull Ref<EntityStore> ref, @Nonnull BreakBlockEvent event)
      Called when an entity breaks a block.
      Parameters:
      ref - The entity reference of the instigating entity.
      event - The break block event.
    • onEntityUseBlock

      public void onEntityUseBlock(@Nonnull Ref<EntityStore> ref, @Nonnull UseBlockEvent.Post event)
      Called when an entity uses a block.
      Parameters:
      ref - The entity reference of the instigating entity.
      event - The use block event.
    • onEntityUseEntity

      public void onEntityUseEntity(@Nonnull Ref<EntityStore> ref, @Nonnull UseEntityEvent.Post event)
      Called when an entity uses another entity.
      Parameters:
      ref - The entity reference of the instigating entity.
      event - The use entity event.
    • cleanupViews

      public void cleanupViews()
    • clear

      public void clear()
    • onWorldRemoved

      public void onWorldRemoved()
    • forEachView

      public <View extends IBlackboardView<View>> void forEachView(Class<View> viewTypeClass, Consumer<View> consumer)
    • getView

      public <View extends IBlackboardView<View>> View getView(Class<View> viewTypeClass, Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor)
    • getView

      public <View extends IBlackboardView<View>> View getView(Class<View> viewTypeClass, int chunkX, int chunkZ)
    • getView

      public <View extends IBlackboardView<View>> View getView(Class<View> viewTypeClass, long index)
    • getIfExists

      public <View extends IBlackboardView<View>> View getIfExists(Class<View> viewTypeClass, long index)
    • clone

      @Nonnull public Resource<EntityStore> clone()
      Specified by:
      clone in interface Resource<EntityStore>
      Returns:
      a clone instance of the original resource instance.