Package com.minecolonies.api.colony
Interface ICitizenDataView
- All Superinterfaces:
ICitizen
- All Known Subinterfaces:
IVisitorViewData
- All Known Implementing Classes:
CitizenDataView,VisitorDataView
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(@NotNull net.minecraft.network.FriendlyByteBuf buf) Deserialize the attributes and variables from transition.Get the list of children of a citizen.Get an instance of the skill handler.Returns the visitor's colonyintGet the colony id of the citizen.net.minecraft.resources.ResourceLocationGet the custom texture of the citizen.Get UUID of the custom texture.net.minecraft.world.item.ItemStackgetDisplayArmor(net.minecraft.world.entity.EquipmentSlot equipmentSlot) Get Armor in slot of citizen data view.intEntity Id getter.doubleGets the current Happiness value for the citizenThe citizen happiness handler.double@Nullable net.minecraft.core.BlockPosGet the entities home building.getJob()Entity job getter.net.minecraft.network.chat.MutableComponentGet the job as mutable component.@Nullable IJobViewGet the job view that belongs to this citizen (or null).doubleGet the list of ordered interactions.Get the names of the parents.@Nullable IntegerGet the partner of the citizen.net.minecraft.core.BlockPosGet the last registered position of the citizen.Get the list of children of a citizen.@Nullable IInteractionResponseHandlergetSpecificInteraction(@NotNull net.minecraft.network.chat.Component component) Get a specific interaction by key.net.minecraft.resources.ResourceLocationThe texture to render for interactions@Nullable net.minecraft.core.BlockPosGets a location of interest of this citizen's job.Get the visible citizen status@Nullable net.minecraft.core.BlockPosGet the entities work building.booleanCheck if the citizen has important interactions.booleanCheck if the citizen has any interactions.booleanCheck if the citizen has any visible interactions.booleanisSick()Check if sick.voidsetHomeBuilding(net.minecraft.core.BlockPos position) Set the home building on the client side.voidsetJobView(IJobView view) Force set the job view.voidsetWorkBuilding(net.minecraft.core.BlockPos bp) DEPRECATEDMethods inherited from interface com.minecolonies.api.colony.ICitizen
getId, getInventory, getName, getSaturation, isChild, isFemale, isPaused, setPaused
-
Method Details
-
getEntityId
int getEntityId()Entity Id getter.- Returns:
- entity id.
-
getJob
String getJob()Entity job getter.- Returns:
- the job as a string.
-
getJobComponent
net.minecraft.network.chat.MutableComponent getJobComponent()Get the job as mutable component.- Returns:
- the job desc.
-
getHomeBuilding
@Nullable @Nullable net.minecraft.core.BlockPos getHomeBuilding()Get the entities home building.- Returns:
- the home coordinates.
-
getWorkBuilding
@Nullable @Nullable net.minecraft.core.BlockPos getWorkBuilding()Get the entities work building.- Returns:
- the work coordinates.
-
setWorkBuilding
void setWorkBuilding(net.minecraft.core.BlockPos bp) DEPRECATED- Parameters:
bp- the position.
-
getColonyId
int getColonyId()Get the colony id of the citizen.- Returns:
- unique id of the colony.
-
getHappiness
double getHappiness()Gets the current Happiness value for the citizen- Returns:
- citizens current Happiness value
-
getPosition
net.minecraft.core.BlockPos getPosition()Get the last registered position of the citizen.- Returns:
- the BlockPos.
-
deserialize
void deserialize(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Deserialize the attributes and variables from transition.- Parameters:
buf- Byte buffer to deserialize.
-
getHealth
double getHealth()- Returns:
- current health.
-
getMaxHealth
double getMaxHealth()- Returns:
- max health.
-
getOrderedInteractions
List<IInteractionResponseHandler> getOrderedInteractions()Get the list of ordered interactions.- Returns:
- the list.
-
getSpecificInteraction
@Nullable @Nullable IInteractionResponseHandler getSpecificInteraction(@NotNull @NotNull net.minecraft.network.chat.Component component) Get a specific interaction by key.- Parameters:
component- the key.- Returns:
- the interaction or null.
-
hasBlockingInteractions
boolean hasBlockingInteractions()Check if the citizen has important interactions.- Returns:
- true if so.
-
hasVisibleStatus
boolean hasVisibleStatus()Check if the citizen has any visible interactions.- Returns:
- true if so.
-
hasPendingInteractions
boolean hasPendingInteractions()Check if the citizen has any interactions.- Returns:
- true if so.
-
getCitizenSkillHandler
ICitizenSkillHandler getCitizenSkillHandler()Get an instance of the skill handler.- Returns:
- the instance.
-
getHappinessHandler
ICitizenHappinessHandler getHappinessHandler()The citizen happiness handler.- Returns:
- the handler.
-
getStatusIcon
net.minecraft.resources.ResourceLocation getStatusIcon()The texture to render for interactions- Returns:
- resourcelocation
-
getVisibleStatus
VisibleCitizenStatus getVisibleStatus()Get the visible citizen status- Returns:
- status
-
getStatusPosition
@Nullable @Nullable net.minecraft.core.BlockPos getStatusPosition()Gets a location of interest of this citizen's job.- Returns:
- the location, or null if nowhere is particularly interesting right now.
-
getJobView
Get the job view that belongs to this citizen (or null).- Returns:
- the job.
-
getPartner
Get the partner of the citizen.- Returns:
- the partner or null if non existent.
-
getChildren
Get the list of children of a citizen.- Returns:
- the citizen ids.
-
getSiblings
Get the list of children of a citizen.- Returns:
- the citizen ids.
-
getParents
Get the names of the parents.- Returns:
- the name.
-
getCustomTexture
net.minecraft.resources.ResourceLocation getCustomTexture()Get the custom texture of the citizen.- Returns:
- the res location.
-
setJobView
Force set the job view.- Parameters:
view- the job view to set.
-
setHomeBuilding
void setHomeBuilding(net.minecraft.core.BlockPos position) Set the home building on the client side.- Parameters:
position- the pos of the home building.
-
getCustomTextureUUID
UUID getCustomTextureUUID()Get UUID of the custom texture.- Returns:
- the uuid.
-
getDisplayArmor
net.minecraft.world.item.ItemStack getDisplayArmor(net.minecraft.world.entity.EquipmentSlot equipmentSlot) Get Armor in slot of citizen data view.- Parameters:
equipmentSlot- the equipment slot to get it from.- Returns:
- the armor in the slot.
-
isSick
boolean isSick()Check if sick.- Returns:
- true if so.
-
getColony
IColonyView getColony()Description copied from interface:ICitizenReturns the visitor's colony
-