Class BuildingBasedRequester
java.lang.Object
com.minecolonies.core.colony.requestsystem.requesters.BuildingBasedRequester
- All Implemented Interfaces:
IRequester,IBuildingBasedRequester
A class that functions as the connection between a building and the request system.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BuildingBasedRequesterdeserialize(IFactoryController controller, net.minecraft.network.RegistryFriendlyByteBuf buffer) static BuildingBasedRequesterdeserialize(net.minecraft.core.HolderLookup.Provider provider, IFactoryController controller, net.minecraft.nbt.CompoundTag compound) getBuilding(@NotNull IRequestManager manager, @NotNull IToken<?> token) Get the building.IToken<?> getId()Method to get the ID of a given requester.@NotNull ILocationMethod to get the location of this locatable.@NotNull net.minecraft.network.chat.MutableComponentgetRequesterDisplayName(@NotNull IRequestManager manager, @NotNull IRequest<?> request) Gets the name of the requester that requested the request given by the token.voidonRequestedRequestCancelled(@NotNull IRequestManager manager, @NotNull IRequest<?> request) Method called by the request system to notify this requester that a request has been overruled.voidonRequestedRequestComplete(@NotNull IRequestManager manager, @NotNull IRequest<?> request) Method called by the request system to notify this requester that a request is complete.voidserialize(IFactoryController controller, net.minecraft.network.RegistryFriendlyByteBuf buffer) net.minecraft.nbt.CompoundTagserialize(net.minecraft.core.HolderLookup.Provider provider, IFactoryController controller)
-
Constructor Details
-
BuildingBasedRequester
-
-
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
Description copied from interface:IRequesterMethod to get the ID of a given requester.- Specified by:
getIdin interfaceIRequester- Returns:
- The id of this requester.
-
getLocation
Description copied from interface:IRequesterMethod to get the location of this locatable.- Specified by:
getLocationin interfaceIRequester- Returns:
- the location.
-
onRequestedRequestComplete
public void onRequestedRequestComplete(@NotNull @NotNull IRequestManager manager, @NotNull @NotNull IRequest<?> request) Description copied from interface:IRequesterMethod called by the request system to notify this requester that a request is complete.- Specified by:
onRequestedRequestCompletein interfaceIRequester- Parameters:
manager- the request manager.request- the request.
-
onRequestedRequestCancelled
public void onRequestedRequestCancelled(@NotNull @NotNull IRequestManager manager, @NotNull @NotNull IRequest<?> request) Description copied from interface:IRequesterMethod called by the request system to notify this requester that a request has been overruled.- Specified by:
onRequestedRequestCancelledin interfaceIRequester- 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:IRequesterGets the name of the requester that requested the request given by the token.- Specified by:
getRequesterDisplayNamein interfaceIRequester- 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:IBuildingBasedRequesterGet the building.- Specified by:
getBuildingin interfaceIBuildingBasedRequester- Parameters:
manager- the manager.token- the token.- Returns:
- the IRequester or empty.
-