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>

public class ResourceView extends BlockRegionView<ResourceView>
Created on 11/10/2018
  • Constructor Details

    • ResourceView

      public ResourceView(long index)
  • Method Details

    • isOutdated

      public boolean isOutdated(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store)
      Description copied from interface: IBlackboardView
      Checks 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 NPC
      store - 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: 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
    • cleanup

      public void cleanup()
      Description copied from interface: IBlackboardView
      Perform whatever cleanup is necessary in this view at a regular interval
    • onWorldRemoved

      public void onWorldRemoved()
      Description copied from interface: IBlackboardView
      Perform any final cleanup when the world is removed
    • isBlockReserved

      public boolean isBlockReserved(int x, int y, int z)
    • reserveBlock

      public void reserveBlock(@Nonnull Ref<EntityStore> ref, int x, int y, int z)
      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

      public void clearReservation(@Nonnull Ref<EntityStore> ref)
    • getIndex

      public long getIndex()
    • getReservationsByEntity

      @Nonnull public Map<Ref<EntityStore>, ResourceView.BlockReservation> getReservationsByEntity()