Package com.minecolonies.core.colony
Class VisitorData
java.lang.Object
com.minecolonies.core.colony.CitizenData
com.minecolonies.core.colony.VisitorData
- All Implemented Interfaces:
ICitizen,ICitizenData,ICivilianData,IVisitorData,IQuestGiver,IQuestParticipant,net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Data for visitors
-
Field Summary
Fields inherited from class com.minecolonies.core.colony.CitizenData
citizenChatOptions, inventory, MAX_HEALTH, SUFFIXESFields inherited from interface com.minecolonies.api.colony.ICitizenData
MAX_SATURATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidApplies the effects of research to the data's entityvoiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag nbtTagCompound) net.minecraft.world.item.ItemStackReturns the recruitment cost stacknet.minecraft.core.BlockPosThe position the visitor is sitting onstatic IVisitorDataloadVisitorFromNBT(IColony colony, net.minecraft.nbt.CompoundTag nbt, @NotNull net.minecraft.core.HolderLookup.Provider provider) Loads this citizen data from nbtnet.minecraft.nbt.CompoundTagserializeNBT(net.minecraft.core.HolderLookup.Provider provider) voidserializeViewNetworkData(@NotNull net.minecraft.network.RegistryFriendlyByteBuf buf) Writes the citizen data to a byte buf for transition.voidsetRecruitCosts(net.minecraft.world.item.ItemStack item) Sets the recruitment cost stackvoidsetSittingPosition(net.minecraft.core.BlockPos pos) Sets the sitting positionvoidUpdatesAbstractCivilianEntityfor the instance.Methods inherited from class com.minecolonies.core.colony.CitizenData
addChildren, addQuestParticipation, addSiblings, assignQuest, clearDirty, createRequest, createRequestAsync, decreaseSaturation, doesLiveWith, equals, generateName, generateName, getBedPos, getChildren, getCitizenDiseaseHandler, getCitizenFoodHandler, getCitizenHappinessHandler, getCitizenMournHandler, getCitizenSkillHandler, getColony, getCustomTexture, getDiseaseModifier, getEntity, getHomeBuilding, getHomePosition, getId, getInventory, getJob, getJob, getJobStatus, getLastPosition, getLeisureTime, getName, getParents, getPartner, getRandom, getSaturation, getSiblings, getStatus, getStatusPosition, getTextureId, getTextureSuffix, getUUID, getVoiceProfile, getWorkBuilding, hasCustomTexture, hashCode, hasQuestAssignment, increaseSaturation, initEntityValues, initForNewCivilian, isAsleep, isChild, isDirty, isFemale, isIdleAtJob, isParticipantOfQuest, isPaused, isRelatedTo, isRequestAsync, isWorking, justAte, loadFromNBT, markDirty, needsBetterFood, onBuildingLoad, onDeath, onGoSleep, onInteractionClosed, onQuestCompletion, onQuestDeletion, onRemoveBuilding, onRequestCancelled, onRequestCompleted, onResponseTriggered, onResurrect, openDialogue, restartDone, scheduleRestart, setAsleep, setBedPos, setCustomTexture, setEntity, setGender, setGenderAndGenerateName, setHomeBuilding, setIdleDays, setInteractedRecently, setIsChild, setJob, setJobStatus, setJustAte, setLastPosition, setName, setNextRespawnPosition, setParents, setPartner, setPaused, setSaturation, setStatusPosition, setSuffix, setVisibleStatus, setVoiceProfile, setWorking, shouldRestart, triggerInteraction, updateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.ICitizen
getColony, getId, getInventory, getName, getSaturation, isChild, isFemale, isPaused, setPausedMethods inherited from interface com.minecolonies.api.colony.ICitizenData
addChildren, addSiblings, doesLiveWith, generateName, getBedPos, getChildren, getCitizenDiseaseHandler, getCitizenFoodHandler, getCitizenHappinessHandler, getCitizenMournHandler, getCitizenSkillHandler, getCustomTexture, getDiseaseModifier, getEntity, getHomeBuilding, getHomePosition, getJob, getJob, getJobStatus, getLastPosition, getLeisureTime, getParents, getPartner, getRandom, getSiblings, getStatus, getStatusPosition, getWorkBuilding, hasCustomTexture, hasQuestAssignment, isAsleep, isIdleAtJob, isRelatedTo, isWorking, justAte, needsBetterFood, onBuildingLoad, onDeath, onGoSleep, onInteractionClosed, onQuestCompletion, onRemoveBuilding, onRequestCompleted, onResurrect, restartDone, scheduleRestart, setAsleep, setBedPos, setCustomTexture, setHomeBuilding, setIdleDays, setInteractedRecently, setIsChild, setJob, setJobStatus, setJustAte, setLastPosition, setNextRespawnPosition, setParents, setPartner, setSaturation, setStatusPosition, setVisibleStatus, setWorking, shouldRestartMethods inherited from interface com.minecolonies.api.colony.ICivilianData
clearDirty, createRequest, createRequestAsync, decreaseSaturation, getTextureId, getTextureSuffix, getUUID, getVoiceProfile, increaseSaturation, initEntityValues, initForNewCivilian, isDirty, isRequestAsync, markDirty, onRequestCancelled, onResponseTriggered, setEntity, setGender, setGenderAndGenerateName, setName, setSuffix, setVoiceProfile, triggerInteraction, updateMethods inherited from interface com.minecolonies.api.quests.IQuestGiver
assignQuestMethods inherited from interface com.minecolonies.api.quests.IQuestParticipant
addQuestParticipation, getName, isParticipantOfQuest, onQuestDeletion, openDialogue
-
Constructor Details
-
VisitorData
Create a CitizenData given an ID. Used as a super-constructor or during loading.- Parameters:
id- ID of the Citizen.colony- Colony the Citizen belongs to.
-
-
Method Details
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
serializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classCitizenData
-
deserializeNBT
public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag nbtTagCompound) - Specified by:
deserializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classCitizenData
-
setRecruitCosts
public void setRecruitCosts(net.minecraft.world.item.ItemStack item) Description copied from interface:IVisitorDataSets the recruitment cost stack- Specified by:
setRecruitCostsin interfaceIVisitorData
-
getRecruitCost
public net.minecraft.world.item.ItemStack getRecruitCost()Description copied from interface:IVisitorDataReturns the recruitment cost stack- Specified by:
getRecruitCostin interfaceIVisitorData- Returns:
- itemstack
-
loadVisitorFromNBT
public static IVisitorData loadVisitorFromNBT(IColony colony, net.minecraft.nbt.CompoundTag nbt, @NotNull net.minecraft.core.HolderLookup.Provider provider) Loads this citizen data from nbt- Parameters:
colony- colony to load fornbt- nbt compound to read fromprovider-- Returns:
- new CitizenData
-
serializeViewNetworkData
public void serializeViewNetworkData(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf) Description copied from interface:ICivilianDataWrites the citizen data to a byte buf for transition.- Specified by:
serializeViewNetworkDatain interfaceICivilianData- Overrides:
serializeViewNetworkDatain classCitizenData- Parameters:
buf- Buffer to write to.
-
getSittingPosition
public net.minecraft.core.BlockPos getSittingPosition()Description copied from interface:IVisitorDataThe position the visitor is sitting on- Specified by:
getSittingPositionin interfaceIVisitorData- Returns:
- sitting pos
-
setSittingPosition
public void setSittingPosition(net.minecraft.core.BlockPos pos) Description copied from interface:IVisitorDataSets the sitting position- Specified by:
setSittingPositionin interfaceIVisitorData- Parameters:
pos- sitting pos
-
updateEntityIfNecessary
public void updateEntityIfNecessary()Description copied from interface:ICivilianDataUpdatesAbstractCivilianEntityfor the instance.- Specified by:
updateEntityIfNecessaryin interfaceICivilianData- Overrides:
updateEntityIfNecessaryin classCitizenData
-
applyResearchEffects
public void applyResearchEffects()Description copied from interface:ICitizenDataApplies the effects of research to the data's entity- Specified by:
applyResearchEffectsin interfaceICitizenData- Overrides:
applyResearchEffectsin classCitizenData
-