Interface IServerWorkOrder

All Superinterfaces:
IWorkOrder
All Known Subinterfaces:
IBuilderWorkOrder
All Known Implementing Classes:
AbstractWorkOrder, WorkOrderBuilding, WorkOrderDecoration, WorkOrderMiner, WorkOrderPlantationField

public interface IServerWorkOrder extends IWorkOrder
  • Method Details

    • isDirty

      boolean isDirty()
      Checks if the workOrder has changed.
      Returns:
      true if so.
    • resetChange

      void resetChange()
      Resets the changed variable.
    • isValid

      boolean isValid(IColony colony)
      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

      void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, IWorkManager manager)
      Read the WorkOrder data from the CompoundTag.
      Parameters:
      compound - NBT Tag compound
      manager - 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.FriendlyByteBuf buf)
      Writes the workOrders data to a byte buf for transition.
      Parameters:
      buf - Buffer to write to
    • onAdded

      void onAdded(IColony colony, boolean readingFromNbt)
      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 exist
      readingFromNbt - if being read from NBT.
    • canBuild

      boolean canBuild(IBuilding building)
      Whether the workorder can be built by the given building.
      Parameters:
      building - the building.
      Returns: