Interface ICivilianData

All Superinterfaces:
ICitizen, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
All Known Subinterfaces:
ICitizenData, IVisitorData
All Known Implementing Classes:
CitizenData, VisitorData

public interface ICivilianData extends ICitizen, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Data for all civilians of a colony, can be citizen/trader/visitor etc
  • Method Details

    • setEntity

      void setEntity(@Nullable @Nullable AbstractCivilianEntity civilian)
      Sets the entity of the civilian data.
      Parameters:
      civilian - AbstractCivilianEntity instance of the civilian data.
    • markDirty

      void markDirty(int time)
      Marks the instance dirty.
    • initForNewCivilian

      void initForNewCivilian()
      Initializes a new citizen, when not read from nbt
    • initEntityValues

      void initEntityValues()
      Initializes the entities values from citizen data.
    • setGenderAndGenerateName

      void setGenderAndGenerateName(boolean isFemale)
      Sets a gender and generates a new name
      Parameters:
      isFemale -
    • setGender

      void setGender(boolean isFemale)
      Sets the gender
      Parameters:
      isFemale -
    • getTextureId

      int getTextureId()
      Returns the texture id for the civilian.
      Returns:
      texture ID.
    • isDirty

      boolean isDirty()
      Returns whether or not the instance is dirty.
      Returns:
      true when dirty, otherwise false.
    • clearDirty

      void clearDirty()
      Markt the instance not dirty.
    • updateEntityIfNecessary

      void updateEntityIfNecessary()
      Updates AbstractCivilianEntity for the instance.
    • serializeViewNetworkData

      void serializeViewNetworkData(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf)
      Writes the citizen data to a byte buf for transition.
      Parameters:
      buf - Buffer to write to.
    • increaseSaturation

      void increaseSaturation(double extraSaturation)
      Getter for the saturation.
      Parameters:
      extraSaturation - the extra saturation
    • decreaseSaturation

      void decreaseSaturation(double extraSaturation)
      Getter for the saturation.
      Parameters:
      extraSaturation - the saturation to remove.
    • setName

      void setName(String name)
      Set the citizen name.
      Parameters:
      name - the name to set.
    • createRequest

      <R extends IRequestable> IToken<?> createRequest(@NotNull R requested)
      Create a blocking request.
      Type Parameters:
      R - the Type
      Parameters:
      requested - the request to create.
      Returns:
      the token of the request.
    • createRequestAsync

      <R extends IRequestable> IToken<?> createRequestAsync(@NotNull R requested)
      Create an async request.
      Type Parameters:
      R - the Type
      Parameters:
      requested - the request to create.
      Returns:
      the token of the request.
    • onRequestCancelled

      void onRequestCancelled(@NotNull @NotNull IToken<?> token)
      Called on request canceled.
      Parameters:
      token - the token to be canceled.
    • isRequestAsync

      boolean isRequestAsync(@NotNull @NotNull IToken<?> token)
      Check if a request is async.
      Parameters:
      token - the token to check.
      Returns:
      true if it is.
    • onResponseTriggered

      void onResponseTriggered(@NotNull @NotNull net.minecraft.network.chat.Component key, int responseId, net.minecraft.world.entity.player.Player player)
      Trigger the response on the server side.
      Parameters:
      key - the key of the component.
      responseId - the triggered response.
      player - the world it was triggered in.
    • update

      void update(int tickRate)
      Tick the data to update values.
    • triggerInteraction

      void triggerInteraction(@NotNull @NotNull IInteractionResponseHandler handler)
      Trigger a possible interaction.
      Parameters:
      handler - the new handler.
    • getTextureSuffix

      String getTextureSuffix()
      Get the texture suffix.
      Returns:
      the suffix.
    • setSuffix

      void setSuffix(String suffix)
      Set the texture suffix.
      Parameters:
      suffix - the suffix to set.
    • getEntity

      Optional<? extends AbstractCivilianEntity> getEntity()
      Gets the entity
      Returns:
    • getVoiceProfile

      int getVoiceProfile()
      Get the voice profile of the citizen.
      Returns:
      the profile id.
    • setVoiceProfile

      void setVoiceProfile(int profile)
      Set the voice profile of the citizen.
      Parameters:
      profile - the profile to set.
    • getUUID

      UUID getUUID()
      Get the uuid for the citizen
      Returns:
      uuid