Interface IGuardBuilding
- All Superinterfaces:
IBuilding,IBuildingContainer,IBuildingModuleContainer,net.minecraftforge.common.capabilities.ICapabilityProvider,ICommonBuilding,IModuleContainer<IBuildingModule>,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>,IRequester,IRequestResolverProvider,ISchematicProvider
- All Known Implementing Classes:
AbstractBuildingGuards,BuildingBarracksTower,BuildingGateHouse,BuildingGuardTower,BuildingStable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intWorker gets this distance times building level away from his/her hut to patrol.Fields inherited from interface com.minecolonies.api.colony.buildings.IBuilding
WOOD_HUT_LEVEL -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPatrolTarget(net.minecraft.core.BlockPos target) Adds new patrolTargets.voidCalled when a guard is at the current patrol pointvoidPopulates the mobs list from the ForgeRegistries.static booleancheckIfGuardShouldTakeDamage(AbstractEntityCitizen citizen, net.minecraft.world.entity.player.Player player) Check if a guard should take damage by a player..intGet the Vision bonus range for the building levelnet.minecraft.core.BlockPosgetGuardPos(@NotNull AbstractEntityCitizen worker) Get the position the guard should guard.net.minecraft.core.BlockPosGet the position of the assigned mine@Nullable net.minecraft.core.BlockPosgetNextPatrolTarget(boolean newTarget) Returns a patrolTarget to patrol to.intGetter for the patrol distance the guard currently has.net.minecraft.world.entity.player.PlayerEntity of player to follow or rally.net.minecraft.core.BlockPosGets the position to follow.Location to to rally to.getTask()Get the guard's task.booleanReturns whether tight grouping in Follow mode is being used.booleanIf we have to calculate a new target manually.voidResets the patrolTargets list.voidsetGuardPos(net.minecraft.core.BlockPos guardPos) Set where the guard should guard.voidsetPlayerToFollow(net.minecraft.world.entity.player.Player player) Sets the player to follow.voidsetRallyLocation(ILocation location) Sets the location to rally.voidsetTempNextPatrolPoint(net.minecraft.core.BlockPos pos) Sets a one time consumed temporary next position to patrol towardsbooleanGet whether the guard should patrol manually.booleanGet the guard's RetrieveOnLowHeath.Methods inherited from interface com.minecolonies.api.colony.buildings.IBuilding
asyncPrestigeRecalc, buildingRequiresCertainAmountOfItem, buildingRequiresCertainAmountOfItem, calculateCorners, calculatePrestige, canAssignCitizens, canBeBuiltByBuilder, canBeGathered, cancelAllRequestsOfCitizenOrBuilding, canEat, canSort, createPickupRequest, createRequest, createRequest, createResolvers, deconstruct, destroy, forceTransferStack, getAllAssignedCitizen, getBuildingDisplayName, getCitizenForRequest, getClaimRadius, getCompletedRequestsOfCitizenOrBuilding, getCompletedRequestsOfType, getCompletedRequestsOfTypeFiltered, getCustomName, getHandlers, getLocationsFromTag, getMaxEquipmentLevel, getOpenRequests, getOpenRequestsByRequestableType, getOpenRequestsOfType, getOpenRequestsOfTypeFiltered, getRequester, getRequiredItemsAndAmount, getResolvers, getSetting, getSettingValueOrDefault, hasCitizenCompletedRequests, hasCitizenCompletedRequestsToPickup, hasOpenSyncRequest, hasWorkerOpenRequests, hasWorkerOpenRequestsFiltered, hasWorkerOpenRequestsOfType, isBuilt, isGuardBuildingNear, isInBuilding, isItemStackInRequest, isMatchingBlock, isPendingConstruction, markDirty, markRequestAsAccepted, onCleanUp, onColonyTick, onDestroyed, onPlacement, onPlayerEnterBuilding, onPlayerEnterNearby, onRestart, onUpgradeComplete, onWakeUp, overruleNextOpenRequestOfCitizenWithStack, overruleNextOpenRequestWithStack, pickUp, processOfflineTime, removeWorkOrder, requestRemoval, requestRepair, requestUpgrade, reservedStacksExcluding, resetGuardBuildingNear, serializeToView, setBuildingType, setCustomBuildingName, sort, upgradeBuildingLevelToSchematicDataMethods inherited from interface com.minecolonies.api.colony.buildings.IBuildingContainer
addContainerPosition, alterPickUpPriority, deserializeNBT, getCapability, getContainers, getPickUpPriority, getTileEntity, registerBlockPosition, registerBlockPosition, removeContainerPosition, serializeNBT, setTileEntityMethods inherited from interface com.minecolonies.api.colony.modules.IBuildingModuleContainer
getModule, getModule, hasModule, registerModuleMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface com.minecolonies.api.colony.buildings.ICommonBuilding
getBuildingLevel, getBuildingLevelEquivalent, getBuildingType, getColony, getContainers, getPosition, getPrestigeMethods inherited from interface com.minecolonies.api.colony.modules.IModuleContainer
getClassType, getFirstModuleOccurance, getModule, getModule, getModule, getModuleMatching, getModules, getModules, getModules, getModules, getModulesByType, hasModule, hasModule, hasModuleMethods inherited from interface com.minecolonies.api.colony.requestsystem.requester.IRequester
getId, getLocation, getRequesterDisplayName, onRequestedRequestCancelled, onRequestedRequestCompleteMethods inherited from interface com.minecolonies.api.colony.requestsystem.resolver.IRequestResolverProvider
getIdMethods inherited from interface com.minecolonies.api.colony.buildings.ISchematicProvider
clearDirty, getBlueprintPath, getChildren, getCorners, getID, getMaxBuildingLevel, getParent, getRotation, getSchematicName, getStructurePack, hasParent, isDeconstructed, isDirty, isMirrored, onUpgradeSchematicTo, setBlueprintPath, setBuildingLevel, setCorners, setDeconstructed, setIsMirrored, setParent, setStructurePack
-
Field Details
-
PATROL_DISTANCE
static final int PATROL_DISTANCEWorker gets this distance times building level away from his/her hut to patrol.- See Also:
-
-
Method Details
-
checkIfGuardShouldTakeDamage
static boolean checkIfGuardShouldTakeDamage(AbstractEntityCitizen citizen, net.minecraft.world.entity.player.Player player) Check if a guard should take damage by a player..- Parameters:
citizen- the citizen.player- the player.- Returns:
- false if in follow mode and following the player.
-
getTask
String getTask()Get the guard's task.- Returns:
- The task of the guard.
-
getNextPatrolTarget
@Nullable @Nullable net.minecraft.core.BlockPos getNextPatrolTarget(boolean newTarget) Returns a patrolTarget to patrol to.- Parameters:
newTarget- whether to search a new target- Returns:
- the position of the next target.
-
arrivedAtPatrolPoint
Called when a guard is at the current patrol point- Parameters:
guard- guard which arrived
-
getPatrolDistance
int getPatrolDistance()Getter for the patrol distance the guard currently has.- Returns:
- The distance in whole numbers.
-
shallRetrieveOnLowHealth
boolean shallRetrieveOnLowHealth()Get the guard's RetrieveOnLowHeath.- Returns:
- if so.
-
shallPatrolManually
boolean shallPatrolManually()Get whether the guard should patrol manually.- Returns:
- if so.
-
isTightGrouping
boolean isTightGrouping()Returns whether tight grouping in Follow mode is being used.- Returns:
- whether tight grouping is being used.
-
getGuardPos
Get the position the guard should guard.- Returns:
- the
BlockPosof the guard position.
-
setGuardPos
void setGuardPos(net.minecraft.core.BlockPos guardPos) Set where the guard should guard.- Parameters:
guardPos- theBlockPosto guard.
-
getPlayerToFollowOrRally
net.minecraft.world.entity.player.Player getPlayerToFollowOrRally()Entity of player to follow or rally.- Returns:
- the PlayerEntity reference.
-
setPlayerToFollow
void setPlayerToFollow(net.minecraft.world.entity.player.Player player) Sets the player to follow.- Parameters:
player- the player to follow.
-
getRallyLocation
ILocation getRallyLocation()Location to to rally to.- Returns:
- the ILocation reference.
-
setRallyLocation
Sets the location to rally.- Parameters:
location- The location to rally to.
-
getPositionToFollow
net.minecraft.core.BlockPos getPositionToFollow()Gets the position to follow.- Returns:
- the position the guard is supposed to be while following.
-
addPatrolTarget
void addPatrolTarget(net.minecraft.core.BlockPos target) Adds new patrolTargets.- Parameters:
target- the target to add
-
resetPatrolTargets
void resetPatrolTargets()Resets the patrolTargets list. -
getBonusVision
int getBonusVision()Get the Vision bonus range for the building level- Returns:
- an integer for the additional range.
-
calculateMobs
void calculateMobs()Populates the mobs list from the ForgeRegistries. -
requiresManualTarget
boolean requiresManualTarget()If we have to calculate a new target manually.- Returns:
- true if so.
-
setTempNextPatrolPoint
void setTempNextPatrolPoint(net.minecraft.core.BlockPos pos) Sets a one time consumed temporary next position to patrol towards- Parameters:
pos- Position to set
-
getMinePos
net.minecraft.core.BlockPos getMinePos()Get the position of the assigned mine- Returns:
- the coords of the assigned mine
-