Interface IDeliverable
- All Superinterfaces:
IRequestable,IRetryable
- All Known Subinterfaces:
IConcreteDeliverable,INonExhaustiveDeliverable
- All Known Implementing Classes:
Burnable,Food,MinimumStack,RequestTag,SmeltableOre,Stack,StackList,Tool
An
IDeliverable is an Requestable that can be delivered.-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanCan this type of request be resolved by the building, or only by external resolvers.copyWithCount(int newCount) Creates a new instance of this requestable with the given count.intgetCount()Method called to get the amount of items that need to be in the stack.intMethod called to get the minimum amount required to fulfill this request.@NotNull net.minecraft.world.item.ItemStackMethod to get the result of the delivery.booleanmatches(@NotNull net.minecraft.world.item.ItemStack stack) Method called to check if a given stack matches this deliverable.voidsetResult(@NotNull net.minecraft.world.item.ItemStack result) Method to set the result of a delivery.Methods inherited from interface com.minecolonies.api.colony.requestsystem.requestable.IRequestable
getSuperClasses
-
Method Details
-
matches
boolean matches(@NotNull @NotNull net.minecraft.world.item.ItemStack stack) Method called to check if a given stack matches this deliverable. The first stack that returns true from this method is returned as a Deliverable.- Parameters:
stack- The stack to test.- Returns:
- true when the stack matches. False when not.
-
getCount
int getCount()Method called to get the amount of items that need to be in the stack.- Returns:
- The amount of items.
-
getMinimumCount
int getMinimumCount()Method called to get the minimum amount required to fulfill this request.- Returns:
- the minimum amount.
-
getResult
@NotNull @NotNull net.minecraft.world.item.ItemStack getResult()Method to get the result of the delivery.- Returns:
- The result of the delivery.
-
setResult
void setResult(@NotNull @NotNull net.minecraft.world.item.ItemStack result) Method to set the result of a delivery.- Parameters:
result- The result of the delivery.
-
copyWithCount
Creates a new instance of this requestable with the given count.- Parameters:
newCount- The new requestable, with the requested count.- Returns:
- the deliverable.
-
canBeResolvedByBuilding
default boolean canBeResolvedByBuilding()Can this type of request be resolved by the building, or only by external resolvers.- Returns:
- true if so.
-