Interface IServerWorkOrder
- All Superinterfaces:
IWorkOrder
- All Known Subinterfaces:
IBuilderWorkOrder
- 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 TypeMethodDescriptionbooleanWhether the workorder can be built by the given building.booleanisDirty()Checks if the workOrder has changed.booleanIs this WorkOrder still valid? If not, it will be deleted.voidExecuted when a work order is added.voidread(@NotNull net.minecraft.nbt.CompoundTag compound, IWorkManager manager) Read the WorkOrder data from the CompoundTag.voidResets the changed variable.voidserializeViewNetworkData(@NotNull net.minecraft.network.RegistryFriendlyByteBuf buf) Writes the workOrders data to a byte buf for transition.voidwrite(@NotNull net.minecraft.nbt.CompoundTag compound) Save the Work Order to an CompoundTag.Methods 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
-
isDirty
boolean isDirty()Checks if the workOrder has changed.- Returns:
- true if so.
-
resetChange
void resetChange()Resets the changed variable. -
isValid
Is this WorkOrder still valid? If not, it will be deleted.Suppressing Sonar Rule squid:S1172 This rule does " Unused method parameters should be removed" But in this case extending class may need to use the colony parameter
- Parameters:
colony- The colony that owns the Work Order- Returns:
- True if the WorkOrder is still valid, or False if it should be deleted
-
read
Read the WorkOrder data from the CompoundTag.- Parameters:
compound- NBT Tag compoundmanager- the workManager calling this method.
-
write
void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Save the Work Order to an CompoundTag.- Parameters:
compound- NBT tag compount
-
serializeViewNetworkData
void serializeViewNetworkData(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf) Writes the workOrders data to a byte buf for transition.- Parameters:
buf- Buffer to write to
-
onAdded
Executed when a work order is added.Override this when something need to be done when the work order is added
- Parameters:
colony- in which the work order existreadingFromNbt- if being read from NBT.
-
canBuild
Whether the workorder can be built by the given building.- Parameters:
building- the building.- Returns:
-