Class WorkOrderPlantationField

java.lang.Object
com.minecolonies.core.colony.workorders.AbstractWorkOrder
com.minecolonies.core.colony.workorders.WorkOrderPlantationField
All Implemented Interfaces:
IBuilderWorkOrder, IServerWorkOrder, IWorkOrder

public class WorkOrderPlantationField extends AbstractWorkOrder
A work order that the build can take to build plantation fields.
  • Constructor Details

    • WorkOrderPlantationField

      public WorkOrderPlantationField()
      Unused constructor for reflection.
  • Method Details

    • create

      public static WorkOrderPlantationField create(@NotNull @NotNull WorkOrderType type, String packName, String path, String translationKey, net.minecraft.core.BlockPos location, int rotation, boolean mirror, int currentLevel)
    • canBuild

      public boolean canBuild(IBuilding building)
      Description copied from class: AbstractWorkOrder
      Whether the work order can be built or not.
      Specified by:
      canBuild in interface IServerWorkOrder
      Specified by:
      canBuild in class AbstractWorkOrder
      Parameters:
      building - the citizen attempting to perform the work order
      Returns:
      true if it can be built
    • canBuildIgnoringDistance

      public boolean canBuildIgnoringDistance(@NotNull @NotNull IBuilding building, net.minecraft.core.BlockPos position, int level)
      Check if a citizen may accept this workOrder while ignoring the distance to the build location.

      Parameters:
      building - the building that is assigned.
      position - the position of the citizen's work hut.
      level - the level of that work hut.
      Returns:
      true if the citizen may accept this work order.
    • isValid

      public boolean isValid(IColony colony)
      Description copied from class: AbstractWorkOrder
      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

      Specified by:
      isValid in interface IServerWorkOrder
      Overrides:
      isValid in class AbstractWorkOrder
      Parameters:
      colony - The colony that owns the Work Order
      Returns:
      True if the WorkOrder is still valid, or False if it should be deleted
    • onAdded

      public void onAdded(IColony colony, boolean readingFromNbt)
      Description copied from class: AbstractWorkOrder
      Executed when a work order is added.

      Override this when something need to be done when the work order is added

      Specified by:
      onAdded in interface IServerWorkOrder
      Overrides:
      onAdded in class AbstractWorkOrder
      Parameters:
      colony - in which the work order exist
      readingFromNbt - if being read from NBT.
    • onRemoved

      public void onRemoved(IColony colony)
      Description copied from class: AbstractWorkOrder
      Executed when a work order is removed.

      Override this when something need to be done when the work order is removed

      Specified by:
      onRemoved in interface IBuilderWorkOrder
      Overrides:
      onRemoved in class AbstractWorkOrder
      Parameters:
      colony - in which the work order exist