Class AbstractWorkOrderView
java.lang.Object
com.minecolonies.core.colony.workorders.view.AbstractWorkOrderView
- All Implemented Interfaces:
IWorkOrder,IWorkOrderView
- Direct Known Subclasses:
WorkOrderBuildingView,WorkOrderDecorationView,WorkOrderMinerView,WorkOrderPlantationFieldView
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
FieldsModifier and TypeFieldDescriptionprotected com.ldtteam.structurize.blueprints.v1.BlueprintThe blueprint of this workorders schematicprotected net.minecraft.world.phys.AABBThe workorder areaprotected IColonyThe related colonyprotected CompletableFuture<com.ldtteam.structurize.blueprints.v1.Blueprint> The cached blueprint futureFields inherited from interface com.minecolonies.api.colony.workorders.IWorkOrder
WORK_ORDER_COMPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBuildIgnoringDistance(@NotNull net.minecraft.core.BlockPos builderLocation, int builderLevel) Checks if a builder may accept this workOrder while ignoring the distance to the builder.voidClears the stored blueprintvoiddeserialize(@NotNull net.minecraft.network.RegistryFriendlyByteBuf buf) Deserialize the attributes and variables from the given buffercom.ldtteam.structurize.blueprints.v1.BlueprintGet the stored blueprintnet.minecraft.world.phys.AABBGet the blueprints Boundingboxnet.minecraft.core.BlockPosGet the position of the Citizen that the Work Order is claimed by.Get the related colony or viewintGet the current level of the structure of the work order.intgetID()Get the ID of the work order.net.minecraft.core.BlockPosGet the current location of the buildingintGetter for the priority.com.ldtteam.structurize.api.RotationMirrorGet the current rotation and mirror of the buildinggetStage()The buildings stageValue getter.Get the structure this work order should be using, if any.intGet the target level of the structure of the work order.final StringThe name of the work order.The type of the work order.booleanIs the Work Order claimed?voidloadBlueprint(net.minecraft.world.level.Level world, Consumer<com.ldtteam.structurize.blueprints.v1.Blueprint> afterLoad) Loads the blueprint if necessaryvoidsetBlueprint(com.ldtteam.structurize.blueprints.v1.Blueprint blueprint, net.minecraft.world.level.Level world) Store a blueprint referencevoidsetClaimedBy(net.minecraft.core.BlockPos position) Set the Work order as claimed by a given building.voidSet the related colony or viewvoidsetID(int id) Set the ID of the work order.voidsetPriority(int priority) Setter for the priority.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.workorders.IWorkOrder
getDisplayName, getFileNameMethods inherited from interface com.minecolonies.api.colony.workorders.IWorkOrderView
shouldShowIn
-
Field Details
-
box
protected net.minecraft.world.phys.AABB boxThe workorder area -
blueprint
protected com.ldtteam.structurize.blueprints.v1.Blueprint blueprintThe blueprint of this workorders schematic -
colony
The related colony -
future
The cached blueprint future
-
-
Constructor Details
-
AbstractWorkOrderView
public AbstractWorkOrderView()
-
-
Method Details
-
getID
public int getID()Description copied from interface:IWorkOrderGet the ID of the work order.- Specified by:
getIDin interfaceIWorkOrder- Returns:
- ID of the work order
-
setID
public void setID(int id) Description copied from interface:IWorkOrderSet the ID of the work order.- Specified by:
setIDin interfaceIWorkOrder- Parameters:
id- the new ID for the work order
-
getPriority
public int getPriority()Description copied from interface:IWorkOrderGetter for the priority.- Specified by:
getPriorityin interfaceIWorkOrder- Returns:
- the priority of the work order.
-
setPriority
public void setPriority(int priority) Description copied from interface:IWorkOrderSetter for the priority.- Specified by:
setPriorityin interfaceIWorkOrder- Parameters:
priority- the new priority.
-
getClaimedBy
public net.minecraft.core.BlockPos getClaimedBy()Description copied from interface:IWorkOrderGet the position of the Citizen that the Work Order is claimed by.- Specified by:
getClaimedByin interfaceIWorkOrder- 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:IWorkOrderSet the Work order as claimed by a given building.- Specified by:
setClaimedByin interfaceIWorkOrder- 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:IWorkOrderStore a blueprint reference- Specified by:
setBlueprintin interfaceIWorkOrder- Parameters:
blueprint-
-
getBlueprint
public com.ldtteam.structurize.blueprints.v1.Blueprint getBlueprint()Description copied from interface:IWorkOrderGet the stored blueprint- Specified by:
getBlueprintin interfaceIWorkOrder- Returns:
-
clearBlueprint
public void clearBlueprint()Description copied from interface:IWorkOrderClears the stored blueprint- Specified by:
clearBlueprintin interfaceIWorkOrder
-
getBoundingBox
public net.minecraft.world.phys.AABB getBoundingBox()Description copied from interface:IWorkOrderGet the blueprints Boundingbox- Specified by:
getBoundingBoxin interfaceIWorkOrder
-
getColony
Description copied from interface:IWorkOrderGet the related colony or view- Specified by:
getColonyin interfaceIWorkOrder- Returns:
-
setColony
Description copied from interface:IWorkOrderSet the related colony or view- Specified by:
setColonyin interfaceIWorkOrder
-
getStage
Description copied from interface:IWorkOrderThe buildings stage- Specified by:
getStagein interfaceIWorkOrder- Returns:
- stage index
-
getStructurePack
Value getter.- Specified by:
getStructurePackin interfaceIWorkOrder- 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:IWorkOrderLoads the blueprint if necessary- Specified by:
loadBlueprintin interfaceIWorkOrder- Parameters:
world- world to useafterLoad- consumes the loaded blueprint or null
-
getStructurePath
Description copied from interface:IWorkOrderGet the structure this work order should be using, if any.- Specified by:
getStructurePathin interfaceIWorkOrder- Returns:
- the schematic path.
-
getTranslationKey
Description copied from interface:IWorkOrderThe name of the work order.- Specified by:
getTranslationKeyin interfaceIWorkOrder- Returns:
- the work order name.
-
getWorkOrderType
Description copied from interface:IWorkOrderThe type of the work order.- Specified by:
getWorkOrderTypein interfaceIWorkOrder- Returns:
- the work order type.
-
getLocation
public net.minecraft.core.BlockPos getLocation()Description copied from interface:IWorkOrderGet the current location of the building- Specified by:
getLocationin interfaceIWorkOrder- Returns:
- the location
-
getRotationMirror
public com.ldtteam.structurize.api.RotationMirror getRotationMirror()Description copied from interface:IWorkOrderGet the current rotation and mirror of the building- Specified by:
getRotationMirrorin interfaceIWorkOrder- Returns:
- the location
-
isClaimed
public boolean isClaimed()Description copied from interface:IWorkOrderIs the Work Order claimed?- Specified by:
isClaimedin interfaceIWorkOrder- Returns:
- true if the Work Order has been claimed
-
getCurrentLevel
public int getCurrentLevel()Description copied from interface:IWorkOrderGet the current level of the structure of the work order.- Specified by:
getCurrentLevelin interfaceIWorkOrder- Returns:
- the current level.
-
getTargetLevel
public int getTargetLevel()Description copied from interface:IWorkOrderGet the target level of the structure of the work order.- Specified by:
getTargetLevelin interfaceIWorkOrder- Returns:
- the target level.
-
deserialize
public void deserialize(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf) Description copied from interface:IWorkOrderViewDeserialize the attributes and variables from the given buffer- Specified by:
deserializein interfaceIWorkOrderView- Parameters:
buf- Byte buffer to deserialize.
-
canBuildIgnoringDistance
public boolean canBuildIgnoringDistance(@NotNull @NotNull net.minecraft.core.BlockPos builderLocation, int builderLevel) Description copied from interface:IWorkOrderViewChecks if a builder may accept this workOrder while ignoring the distance to the builder.- Specified by:
canBuildIgnoringDistancein interfaceIWorkOrderView- Parameters:
builderLocation- position of the builders own hut.builderLevel- level of the builders hut.- Returns:
- true if so.
-