Contents
Class ResourceView
java.lang.Object
com.hypixel.hytale.server.npc.blackboard.view.BlockRegionView<ResourceView>
com.hypixel.hytale.server.npc.blackboard.view.resource.ResourceView
- All Implemented Interfaces:
IBlackboardView<ResourceView>
Created on 11/10/2018
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class BlockRegionView
BITS, BITS2, SIZE, SIZE_MASK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Perform whatever cleanup is necessary in this view at a regular intervalvoidclearReservation(Ref<EntityStore> ref) longgetIndex()getUpdatedView(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.booleanisBlockReserved(int x, int y, int z) booleanisOutdated(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 removedvoidreserveBlock(Ref<EntityStore> ref, int x, int y, int z) Called to reserve a block for an NPC entity.
-
Constructor Details
-
ResourceView
public ResourceView(long index)
-
-
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- Parameters:
ref- The entity reference of the NPCstore- The entity store for component access- Returns:
- whether they need to query for a new view
-
getUpdatedView
@Nonnull public ResourceView 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
-
cleanup
public void cleanup()Description copied from interface:IBlackboardViewPerform whatever cleanup is necessary in this view at a regular interval -
onWorldRemoved
public void onWorldRemoved()Description copied from interface:IBlackboardViewPerform any final cleanup when the world is removed -
isBlockReserved
public boolean isBlockReserved(int x, int y, int z) -
reserveBlock
Called to reserve a block for an NPC entity.- Parameters:
ref- The entity reference of the NPC entity.x- The X coordinate of the block to reserve.y- The Y coordinate of the block to reserve.z- The Z coordinate of the block to reserve.
-
clearReservation
-
getIndex
public long getIndex() -
getReservationsByEntity
-