Class WorkOrderMiner
java.lang.Object
com.minecolonies.core.colony.workorders.AbstractWorkOrder
com.minecolonies.core.colony.workorders.WorkOrderMiner
- All Implemented Interfaces:
IBuilderWorkOrder,IServerWorkOrder,IWorkOrder
A work order that the build can take to build mine.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionUnused constructor for reflection.WorkOrderMiner(String packName, String structureName, String workOrderName, com.ldtteam.structurize.api.RotationMirror rotMir, net.minecraft.core.BlockPos location, boolean keepMirror, net.minecraft.core.BlockPos minerBuilding) Create a new work order telling the miner to build a mine. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the work order can be built or not.booleancanBuildIgnoringDistance(@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.net.minecraft.core.BlockPosGet the miner building position assigned to this request.booleanIs this WorkOrder still valid? If not, it will be deleted.voidloadBlueprint(net.minecraft.world.level.Level world, Consumer<com.ldtteam.structurize.blueprints.v1.Blueprint> afterLoad) Loads the blueprint if necessaryvoidread(@NotNull net.minecraft.nbt.CompoundTag compound, IWorkManager manager) Read the WorkOrder data from the CompoundTag.voidwrite(@NotNull net.minecraft.nbt.CompoundTag compound) Save the Work Order to an CompoundTag.Methods inherited from class com.minecolonies.core.colony.workorders.AbstractWorkOrder
canBeResolved, clearBlueprint, createFromNBT, createWorkOrderView, getAmountOfResources, getBlueprint, getBoundingBox, getClaimedBy, getColony, getCurrentLevel, getDisplayName, getID, getIteratorType, getLocation, getPriority, getRotationMirror, getStage, getStructurePack, getStructurePath, getTargetLevel, getTranslationKey, getWorkOrderType, isClaimed, isCleared, isDirty, isRequested, onAdded, onCompleted, onRemoved, resetChange, serializeViewNetworkData, setAmountOfResources, setBlueprint, setClaimedBy, setCleared, setColony, setID, setIteratorType, setPriority, setRequested, setStage, tooFarFromAnyBuilderMethods 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
getFileName
-
Constructor Details
-
WorkOrderMiner
public WorkOrderMiner()Unused constructor for reflection. -
WorkOrderMiner
public WorkOrderMiner(String packName, String structureName, String workOrderName, com.ldtteam.structurize.api.RotationMirror rotMir, net.minecraft.core.BlockPos location, boolean keepMirror, 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.rotMir- The the mine rotation and mirror.location- The location where the mine should be built.keepMirror- Whether should keep mirror in rotMir parameter, usually false.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:IWorkOrderLoads the blueprint if necessary- Specified by:
loadBlueprintin interfaceIWorkOrder- Overrides:
loadBlueprintin classAbstractWorkOrder- Parameters:
world- world to useafterLoad- consumes the loaded blueprint or null
-
canBuild
Description copied from class:AbstractWorkOrderWhether the work order can be built or not.- Specified by:
canBuildin interfaceIServerWorkOrder- Specified by:
canBuildin classAbstractWorkOrder- 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
Description copied from class:AbstractWorkOrderIs 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:
isValidin interfaceIServerWorkOrder- Overrides:
isValidin classAbstractWorkOrder- 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
Read the WorkOrder data from the CompoundTag.- Specified by:
readin interfaceIServerWorkOrder- Overrides:
readin classAbstractWorkOrder- 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:
writein interfaceIServerWorkOrder- Overrides:
writein classAbstractWorkOrder- Parameters:
compound- NBT tag compound.
-
getMinerBuilding
public net.minecraft.core.BlockPos getMinerBuilding()Get the miner building position assigned to this request.- Returns:
- the BlockPos.
-