Contents
Class BlockEventView
java.lang.Object
com.hypixel.hytale.server.npc.blackboard.view.event.EventView<BlockEventView, BlockEventType, EventNotification>
com.hypixel.hytale.server.npc.blackboard.view.event.block.BlockEventView
- All Implemented Interfaces:
IBlackboardView<BlockEventView>
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 Summary
ConstructorsConstructorDescriptionBlockEventView(World world) Default Constructor for aBlockEventViewinstance. -
Method Summary
Modifier and TypeMethodDescriptiongetUpdatedView(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Returns the updated view if the current is outdatedvoidinitialiseEntity(Ref<EntityStore> ref, BlackboardSubscription subscription) Initializes the given entity with any data relevant to the view.voidonEntityBreakBlock(Ref<EntityStore> ref, BreakBlockEvent event) Called by the blackboard resource when an entity breaks a block.voidonEntityDamageBlock(Ref<EntityStore> ref, DamageBlockEvent event) Called by the blackboard resource when an entity damages a block.voidonEntityUseBlock(Ref<EntityStore> ref, UseBlockEvent.Post event) Called by the blackboard resource when an entity uses a block.Methods inherited from class EventView
cleanup, forEach, getSetCount, isOutdated, onWorldRemoved
-
Constructor Details
-
BlockEventView
Default Constructor for aBlockEventViewinstance.- 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:IBlackboardViewReturns the updated view if the current is outdated- Parameters:
ref- The NPC seeking a viewcomponentAccessor- TheComponentAccessorfor component access- Returns:
- the updated view
-
initialiseEntity
public void initialiseEntity(@Nonnull Ref<EntityStore> ref, @Nonnull BlackboardSubscription subscription) Description copied from interface:IBlackboardViewInitializes the given entity with any data relevant to the view.- Parameters:
ref- The entity referencesubscription- TheBlackboardSubscriptionholding the entity's subscribed sets
-
onEntityDamageBlock
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
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
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.
-