Contents
Class EventView<ViewType extends IBlackboardView<ViewType>, EventType extends Enum<EventType>, NotificationType extends EventNotification>
java.lang.Object
com.hypixel.hytale.server.npc.blackboard.view.event.EventView<ViewType, EventType, NotificationType>
- All Implemented Interfaces:
IBlackboardView<ViewType>
- Direct Known Subclasses:
BlockEventView, EntityEventView
public abstract class EventView<ViewType extends IBlackboardView<ViewType>, EventType extends Enum<EventType>, NotificationType extends EventNotification>
extends Object
implements IBlackboardView<ViewType>
A blackboard view which handles the translation of events (such as damage, destruction, opening chests, etc)
into a format that can be understood by NPCs.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Perform whatever cleanup is necessary in this view at a regular intervalvoidforEach(IntObjectConsumer<EventType> setConsumer, Consumer<Ref<EntityStore>> npcConsumer) intbooleanisOutdated(Ref<EntityStore> ref, Store<EntityStore> store) Checks whether the current view is outdated for the given NPC and if they need to fetch a new onevoidPerform any final cleanup when the world is removedMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IBlackboardView
getUpdatedView, initialiseEntity
-
Method Details
-
isOutdated
Description copied from interface:IBlackboardViewChecks whether the current view is outdated for the given NPC and if they need to fetch a new one- Specified by:
isOutdatedin interfaceIBlackboardView<ViewType extends IBlackboardView<ViewType>>- Parameters:
ref- The entity reference of the NPCstore- The entity store for component access- Returns:
- whether they need to query for a new view
-
onWorldRemoved
public void onWorldRemoved()Description copied from interface:IBlackboardViewPerform any final cleanup when the world is removed- Specified by:
onWorldRemovedin interfaceIBlackboardView<ViewType extends IBlackboardView<ViewType>>
-
cleanup
public void cleanup()Description copied from interface:IBlackboardViewPerform whatever cleanup is necessary in this view at a regular interval- Specified by:
cleanupin interfaceIBlackboardView<ViewType extends IBlackboardView<ViewType>>
-
getSetCount
public int getSetCount() -
forEach
public void forEach(@Nonnull IntObjectConsumer<EventType> setConsumer, @Nonnull Consumer<Ref<EntityStore>> npcConsumer)
-