Class AbstractWorkOrderView

java.lang.Object
com.minecolonies.core.colony.workorders.view.AbstractWorkOrderView
All Implemented Interfaces:
IWorkOrder, IWorkOrderView
Direct Known Subclasses:
WorkOrderBuildingView, WorkOrderDecorationView, WorkOrderMinerView, WorkOrderPlantationFieldView

public abstract class AbstractWorkOrderView extends Object implements IWorkOrderView
The WorkOrderView is the client-side representation of a WorkOrders. Views contain the WorkOrder's data that is relevant to a Client, in a more client-friendly form Mutable operations on a View result in a message to the server to perform the operation
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.ldtteam.structurize.blueprints.v1.Blueprint
    The blueprint of this workorders schematic
    protected net.minecraft.world.phys.AABB
    The workorder area
    protected IColony
    The related colony
    protected CompletableFuture<com.ldtteam.structurize.blueprints.v1.Blueprint>
    The cached blueprint future
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canBuildIgnoringDistance(@NotNull net.minecraft.core.BlockPos builderLocation, int builderLevel)
    Checks if a builder may accept this workOrder while ignoring the distance to the builder.
    void
    Clears the stored blueprint
    void
    deserialize(@NotNull net.minecraft.network.RegistryFriendlyByteBuf buf)
    Deserialize the attributes and variables from the given buffer
    com.ldtteam.structurize.blueprints.v1.Blueprint
    Get the stored blueprint
    net.minecraft.world.phys.AABB
    Get the blueprints Boundingbox
    net.minecraft.core.BlockPos
    Get the position of the Citizen that the Work Order is claimed by.
    Get the related colony or view
    int
    Get the current level of the structure of the work order.
    int
    Get the ID of the work order.
    net.minecraft.core.BlockPos
    Get the current location of the building
    int
    Getter for the priority.
    com.ldtteam.structurize.api.RotationMirror
    Get the current rotation and mirror of the building
    The buildings stage
    Value getter.
    Get the structure this work order should be using, if any.
    int
    Get the target level of the structure of the work order.
    final String
    The name of the work order.
    The type of the work order.
    boolean
    Is the Work Order claimed?
    void
    loadBlueprint(net.minecraft.world.level.Level world, Consumer<com.ldtteam.structurize.blueprints.v1.Blueprint> afterLoad)
    Loads the blueprint if necessary
    void
    setBlueprint(com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, net.minecraft.world.level.Level world)
    Store a blueprint reference
    void
    setClaimedBy(net.minecraft.core.BlockPos position)
    Set the Work order as claimed by a given building.
    void
    Set the related colony or view
    void
    setID(int id)
    Set the ID of the work order.
    void
    setPriority(int priority)
    Setter for the priority.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.minecolonies.api.colony.workorders.IWorkOrder

    getDisplayName, getFileName

    Methods inherited from interface com.minecolonies.api.colony.workorders.IWorkOrderView

    shouldShowIn
  • Field Details

    • box

      protected net.minecraft.world.phys.AABB box
      The workorder area
    • blueprint

      protected com.ldtteam.structurize.blueprints.v1.Blueprint blueprint
      The blueprint of this workorders schematic
    • colony

      protected IColony colony
      The related colony
    • future

      protected CompletableFuture<com.ldtteam.structurize.blueprints.v1.Blueprint> future
      The cached blueprint future
  • Constructor Details

    • AbstractWorkOrderView

      public AbstractWorkOrderView()
  • Method Details

    • getID

      public int getID()
      Description copied from interface: IWorkOrder
      Get the ID of the work order.
      Specified by:
      getID in interface IWorkOrder
      Returns:
      ID of the work order
    • setID

      public void setID(int id)
      Description copied from interface: IWorkOrder
      Set the ID of the work order.
      Specified by:
      setID in interface IWorkOrder
      Parameters:
      id - the new ID for the work order
    • getPriority

      public int getPriority()
      Description copied from interface: IWorkOrder
      Getter for the priority.
      Specified by:
      getPriority in interface IWorkOrder
      Returns:
      the priority of the work order.
    • setPriority

      public void setPriority(int priority)
      Description copied from interface: IWorkOrder
      Setter for the priority.
      Specified by:
      setPriority in interface IWorkOrder
      Parameters:
      priority - the new priority.
    • getClaimedBy

      public net.minecraft.core.BlockPos getClaimedBy()
      Description copied from interface: IWorkOrder
      Get the position of the Citizen that the Work Order is claimed by.
      Specified by:
      getClaimedBy in interface IWorkOrder
      Returns:
      ID of citizen the Work Order has been claimed by, BLockpos.ZERO
    • setClaimedBy

      public void setClaimedBy(net.minecraft.core.BlockPos position)
      Description copied from interface: IWorkOrder
      Set the Work order as claimed by a given building.
      Specified by:
      setClaimedBy in interface IWorkOrder
      Parameters:
      position - the building position.
    • setBlueprint

      public void setBlueprint(com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, net.minecraft.world.level.Level world)
      Description copied from interface: IWorkOrder
      Store a blueprint reference
      Specified by:
      setBlueprint in interface IWorkOrder
      Parameters:
      blueprint -
    • getBlueprint

      public com.ldtteam.structurize.blueprints.v1.Blueprint getBlueprint()
      Description copied from interface: IWorkOrder
      Get the stored blueprint
      Specified by:
      getBlueprint in interface IWorkOrder
      Returns:
    • clearBlueprint

      public void clearBlueprint()
      Description copied from interface: IWorkOrder
      Clears the stored blueprint
      Specified by:
      clearBlueprint in interface IWorkOrder
    • getBoundingBox

      public net.minecraft.world.phys.AABB getBoundingBox()
      Description copied from interface: IWorkOrder
      Get the blueprints Boundingbox
      Specified by:
      getBoundingBox in interface IWorkOrder
    • getColony

      public IColony getColony()
      Description copied from interface: IWorkOrder
      Get the related colony or view
      Specified by:
      getColony in interface IWorkOrder
      Returns:
    • setColony

      public void setColony(IColony colony)
      Description copied from interface: IWorkOrder
      Set the related colony or view
      Specified by:
      setColony in interface IWorkOrder
    • getStage

      public BuildingProgressStage getStage()
      Description copied from interface: IWorkOrder
      The buildings stage
      Specified by:
      getStage in interface IWorkOrder
      Returns:
      stage index
    • getStructurePack

      public String getStructurePack()
      Value getter.
      Specified by:
      getStructurePack in interface IWorkOrder
      Returns:
      the value String.
    • 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
      Parameters:
      world - world to use
      afterLoad - consumes the loaded blueprint or null
    • getStructurePath

      public String getStructurePath()
      Description copied from interface: IWorkOrder
      Get the structure this work order should be using, if any.
      Specified by:
      getStructurePath in interface IWorkOrder
      Returns:
      the schematic path.
    • getTranslationKey

      public final String getTranslationKey()
      Description copied from interface: IWorkOrder
      The name of the work order.
      Specified by:
      getTranslationKey in interface IWorkOrder
      Returns:
      the work order name.
    • getWorkOrderType

      public WorkOrderType getWorkOrderType()
      Description copied from interface: IWorkOrder
      The type of the work order.
      Specified by:
      getWorkOrderType in interface IWorkOrder
      Returns:
      the work order type.
    • getLocation

      public net.minecraft.core.BlockPos getLocation()
      Description copied from interface: IWorkOrder
      Get the current location of the building
      Specified by:
      getLocation in interface IWorkOrder
      Returns:
      the location
    • getRotationMirror

      public com.ldtteam.structurize.api.RotationMirror getRotationMirror()
      Description copied from interface: IWorkOrder
      Get the current rotation and mirror of the building
      Specified by:
      getRotationMirror in interface IWorkOrder
      Returns:
      the location
    • isClaimed

      public boolean isClaimed()
      Description copied from interface: IWorkOrder
      Is the Work Order claimed?
      Specified by:
      isClaimed in interface IWorkOrder
      Returns:
      true if the Work Order has been claimed
    • getCurrentLevel

      public int getCurrentLevel()
      Description copied from interface: IWorkOrder
      Get the current level of the structure of the work order.
      Specified by:
      getCurrentLevel in interface IWorkOrder
      Returns:
      the current level.
    • getTargetLevel

      public int getTargetLevel()
      Description copied from interface: IWorkOrder
      Get the target level of the structure of the work order.
      Specified by:
      getTargetLevel in interface IWorkOrder
      Returns:
      the target level.
    • deserialize

      public void deserialize(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf)
      Description copied from interface: IWorkOrderView
      Deserialize the attributes and variables from the given buffer
      Specified by:
      deserialize in interface IWorkOrderView
      Parameters:
      buf - Byte buffer to deserialize.
    • canBuildIgnoringDistance

      public boolean canBuildIgnoringDistance(@NotNull @NotNull net.minecraft.core.BlockPos builderLocation, int builderLevel)
      Description copied from interface: IWorkOrderView
      Checks if a builder may accept this workOrder while ignoring the distance to the builder.
      Specified by:
      canBuildIgnoringDistance in interface IWorkOrderView
      Parameters:
      builderLocation - position of the builders own hut.
      builderLevel - level of the builders hut.
      Returns:
      true if so.