Class BlockEventView

All Implemented Interfaces:
IBlackboardView<BlockEventView>

public class BlockEventView extends EventView<BlockEventView, BlockEventType, EventNotification>
A blackboard view which handles the translation of block events (such as damage, destruction, opening chests, etc) into a format that can be understood by NPCs.
  • Constructor Details

    • BlockEventView

      public BlockEventView(@Nonnull World world)
      Default Constructor for a BlockEventView instance.
      Parameters:
      world - The world this view is associated with.
  • Method Details

    • getUpdatedView

      public BlockEventView getUpdatedView(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Description copied from interface: IBlackboardView
      Returns the updated view if the current is outdated
      Parameters:
      ref - The NPC seeking a view
      componentAccessor - The ComponentAccessor for component access
      Returns:
      the updated view
    • initialiseEntity

      public void initialiseEntity(@Nonnull Ref<EntityStore> ref, @Nonnull BlackboardSubscription subscription)
      Description copied from interface: IBlackboardView
      Initializes the given entity with any data relevant to the view.
      Parameters:
      ref - The entity reference
      subscription - The BlackboardSubscription holding the entity's subscribed sets
    • onEntityDamageBlock

      public void onEntityDamageBlock(@Nonnull Ref<EntityStore> ref, @Nonnull DamageBlockEvent event)
      Called by the blackboard resource 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 by the blackboard resource 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 by the blackboard resource when an entity uses a block.
      Parameters:
      ref - The entity reference of the instigating entity.
      event - The use block event.