Class BuildingBasedRequester

java.lang.Object
com.minecolonies.core.colony.requestsystem.requesters.BuildingBasedRequester
All Implemented Interfaces:
IRequester, IBuildingBasedRequester

public class BuildingBasedRequester extends Object implements IBuildingBasedRequester
A class that functions as the connection between a building and the request system.
  • Constructor Details

    • BuildingBasedRequester

      public BuildingBasedRequester(ILocation location, IToken<?> requesterId)
  • Method Details

    • deserialize

      public static BuildingBasedRequester deserialize(@NotNull net.minecraft.core.HolderLookup.Provider provider, IFactoryController controller, net.minecraft.nbt.CompoundTag compound)
    • serialize

      public net.minecraft.nbt.CompoundTag serialize(@NotNull net.minecraft.core.HolderLookup.Provider provider, IFactoryController controller)
    • serialize

      public void serialize(IFactoryController controller, net.minecraft.network.RegistryFriendlyByteBuf buffer)
    • deserialize

      public static BuildingBasedRequester deserialize(IFactoryController controller, net.minecraft.network.RegistryFriendlyByteBuf buffer)
    • getId

      public IToken<?> getId()
      Description copied from interface: IRequester
      Method to get the ID of a given requester.
      Specified by:
      getId in interface IRequester
      Returns:
      The id of this requester.
    • getLocation

      @NotNull public @NotNull ILocation getLocation()
      Description copied from interface: IRequester
      Method to get the location of this locatable.
      Specified by:
      getLocation in interface IRequester
      Returns:
      the location.
    • onRequestedRequestComplete

      public void onRequestedRequestComplete(@NotNull @NotNull IRequestManager manager, @NotNull @NotNull IRequest<?> request)
      Description copied from interface: IRequester
      Method called by the request system to notify this requester that a request is complete.
      Specified by:
      onRequestedRequestComplete in interface IRequester
      Parameters:
      manager - the request manager.
      request - the request.
    • onRequestedRequestCancelled

      public void onRequestedRequestCancelled(@NotNull @NotNull IRequestManager manager, @NotNull @NotNull IRequest<?> request)
      Description copied from interface: IRequester
      Method called by the request system to notify this requester that a request has been overruled.
      Specified by:
      onRequestedRequestCancelled in interface IRequester
      Parameters:
      manager - the request manager.
      request - the request.
    • getRequesterDisplayName

      @NotNull public @NotNull net.minecraft.network.chat.MutableComponent getRequesterDisplayName(@NotNull @NotNull IRequestManager manager, @NotNull @NotNull IRequest<?> request)
      Description copied from interface: IRequester
      Gets the name of the requester that requested the request given by the token.
      Specified by:
      getRequesterDisplayName in interface IRequester
      Parameters:
      manager - the request manager.
      request - the request for which the name of the requester is retrieved
      Returns:
      The display name of the requester.
    • getBuilding

      public Optional<IRequester> getBuilding(@NotNull @NotNull IRequestManager manager, @NotNull @NotNull IToken<?> token)
      Description copied from interface: IBuildingBasedRequester
      Get the building.
      Specified by:
      getBuilding in interface IBuildingBasedRequester
      Parameters:
      manager - the manager.
      token - the token.
      Returns:
      the IRequester or empty.