Class WorkOrderMiner

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

public class WorkOrderMiner extends AbstractWorkOrder
A work order that the build can take to build mine.
  • Constructor Details

    • WorkOrderMiner

      public WorkOrderMiner()
      Unused constructor for reflection.
    • WorkOrderMiner

      public WorkOrderMiner(String packName, String structureName, String workOrderName, int rotation, net.minecraft.core.BlockPos location, boolean mirror, net.minecraft.core.BlockPos minerBuilding)
      Create a new work order telling the miner to build a mine.
      Parameters:
      packName - The name of the pack.
      structureName - The path of the blueprint.
      workOrderName - The user friendly name of the mine.
      rotation - The number of times the mine was rotated.
      location - The location where the mine should be built.
      mirror - Is the mine mirrored?
      minerBuilding - The id of the building of the miner.
  • Method Details

    • loadBlueprint

      public void loadBlueprint(net.minecraft.world.level.Level world, Consumer<com.ldtteam.structurize.blueprints.v1.Blueprint> afterLoad)
      Description copied from interface: IWorkOrder
      Loads the blueprint if necessary
      Specified by:
      loadBlueprint in interface IWorkOrder
      Overrides:
      loadBlueprint in class AbstractWorkOrder
      Parameters:
      world - world to use
      afterLoad - consumes the loaded blueprint or null
    • 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 assigned building.
      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
    • read

      public void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound, IWorkManager manager)
      Read the WorkOrder data from the CompoundTag.
      Specified by:
      read in interface IServerWorkOrder
      Overrides:
      read in class AbstractWorkOrder
      Parameters:
      compound - NBT Tag compound.
      manager - the work manager.
    • write

      public void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Save the Work Order to an CompoundTag.
      Specified by:
      write in interface IServerWorkOrder
      Overrides:
      write in class AbstractWorkOrder
      Parameters:
      compound - NBT tag compound.
    • getMinerBuilding

      public net.minecraft.core.BlockPos getMinerBuilding()
      Get the miner building position assigned to this request.
      Returns:
      the BlockPos.