Interface IBuilderWorkOrder
- All Superinterfaces:
IServerWorkOrder,IWorkOrder
- All Known Implementing Classes:
AbstractWorkOrder,WorkOrderBuilding,WorkOrderDecoration,WorkOrderMiner,WorkOrderPlantationField
-
Field Summary
Fields inherited from interface com.minecolonies.api.colony.workorders.IWorkOrder
WORK_ORDER_COMPARATOR -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBeResolved(IColony colony, int level) Check if this workOrder can be resolved by an existing builder.booleancanBuildIgnoringDistance(@NotNull IBuilding building, @NotNull net.minecraft.core.BlockPos builderLocation, int builderLevel) Checks if a builder may accept this workOrder while ignoring the distance to the builder.intGet the amount of resources this work order still requires.Get the iterator type (method of construction) of the work order.booleanWhether the area of the work order has been cleared out or not.booleanSet whether the resources for this work order have been requested.voidonCompleted(IColony colony, ICitizenData citizen) Executed when a work order is completed.voidExecuted when a work order is removed.voidsetAmountOfResources(int newQuantity) Set the amount of resources this work order still requires.voidsetCleared(boolean cleared) Set whether the area of the work order has been cleared out or not.voidsetIteratorType(String iteratorType) Set the iterator type (method of construction) of the work order.voidsetRequested(boolean requested) Set whether the building has been cleared.voidsetStage(BuildingProgressStage stage) Sets the building stage of the workorderbooleantooFarFromAnyBuilder(IColony colony, int level) Check if this workOrder can be resolved by an existing builder by distance.Methods inherited from interface com.minecolonies.api.colony.workorders.IServerWorkOrder
canBuild, isDirty, isValid, onAdded, read, resetChange, serializeViewNetworkData, writeMethods inherited from interface com.minecolonies.api.colony.workorders.IWorkOrder
clearBlueprint, getBlueprint, getBoundingBox, getClaimedBy, getColony, getCurrentLevel, getDisplayName, getFileName, getID, getLocation, getPriority, getRotationMirror, getStage, getStructurePack, getStructurePath, getTargetLevel, getTranslationKey, getWorkOrderType, isClaimed, loadBlueprint, setBlueprint, setClaimedBy, setColony, setID, setPriority
-
Method Details
-
getAmountOfResources
int getAmountOfResources()Get the amount of resources this work order still requires.- Returns:
- the amount of resources.
-
setAmountOfResources
void setAmountOfResources(int newQuantity) Set the amount of resources this work order still requires.- Parameters:
newQuantity- the new amount of resources.
-
getIteratorType
String getIteratorType()Get the iterator type (method of construction) of the work order.- Returns:
- the iterator type.
-
setIteratorType
Set the iterator type (method of construction) of the work order.- Parameters:
iteratorType- the new iterator type.
-
isCleared
boolean isCleared()Whether the area of the work order has been cleared out or not.- Returns:
- true if the area is cleared.
-
setCleared
void setCleared(boolean cleared) Set whether the area of the work order has been cleared out or not.- Parameters:
cleared- the new cleared state.
-
setRequested
void setRequested(boolean requested) Set whether the building has been cleared.- Parameters:
requested- true if the building has been cleared.
-
isRequested
boolean isRequested()Set whether the resources for this work order have been requested.- Returns:
- true when the resources are requested.
-
onCompleted
Executed when a work order is completed.Override this when something need to be done when the work order is completed
- Parameters:
colony- in which the work order existcitizen- citizen that completed the work order
-
onRemoved
Executed when a work order is removed.Override this when something need to be done when the work order is removed
- Parameters:
colony- in which the work order exist
-
canBeResolved
Check if this workOrder can be resolved by an existing builder.- Parameters:
colony- the colony to check in.level- the new level of the building.- Returns:
- true if so.
-
tooFarFromAnyBuilder
Check if this workOrder can be resolved by an existing builder by distance.- Parameters:
colony- the colony to check in.level- the new level of the building.- Returns:
- true if so.
-
canBuildIgnoringDistance
boolean canBuildIgnoringDistance(@NotNull @NotNull IBuilding building, @NotNull @NotNull net.minecraft.core.BlockPos builderLocation, int builderLevel) Checks if a builder may accept this workOrder while ignoring the distance to the builder.- Parameters:
builderLocation- position of the builders own hut.builderLevel- level of the builders hut.- Returns:
- true if so.
-
setStage
Sets the building stage of the workorder- Parameters:
stage-
-