Interface EntityGossipContainer


public interface EntityGossipContainer
Represents a Gossip Container Manager for a Villager
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Forcefully decays all the gossip types by their daily decay rate.
    @NotNull Villager
    Fetches this Gossip Container's Villager.
    int
    getReputation(@NotNull Entity en, @Nullable GossipType... types)
    Gets the reputation of this entity.
    default void
    put(@NotNull Entity en, @NotNull GossipType type)
    Puts this Entity to a GossipType.
    void
    put(@NotNull Entity en, @NotNull GossipType type, int maxCap)
    Puts this Entity to a GossipType with a custom decay max.
    void
    remove(@NotNull Entity en, @NotNull GossipType type)
    Removes this Entity from a GossipType.
    void
    removeAll(@NotNull GossipType type)
    Removes all Entities with this Gossip Type from this Gossip Container.
    default void
    removeAll(@NotNull Entity en)
    Removes this Entity from all GossipTypes.
  • Method Details

    • getEntity

      @NotNull @NotNull Villager getEntity()
      Fetches this Gossip Container's Villager.
      Returns:
      Villager
    • decay

      void decay()
      Forcefully decays all the gossip types by their daily decay rate.
    • getReputation

      int getReputation(@NotNull @NotNull Entity en, @Nullable @Nullable GossipType... types) throws IllegalArgumentException
      Gets the reputation of this entity.

      The reputation is evaluated by filtering the GossipType array passed, and then adding all of their GossipType.getPriority() methods together (negatives have negative priority, positives have positive priority).
      Parameters:
      en - Entity to get the reputation of
      types - Gossip types to filter by, null for all gossip types
      Returns:
      Reputation of the entity
      Throws:
      IllegalArgumentException - if entity is null
    • put

      default void put(@NotNull @NotNull Entity en, @NotNull @NotNull GossipType type) throws IllegalArgumentException
      Puts this Entity to a GossipType.
      Parameters:
      en - Entity to put to the GossipType
      type - GossipType to put to
      Throws:
      IllegalArgumentException - if entity or gossip type is null
    • put

      void put(@NotNull @NotNull Entity en, @NotNull @NotNull GossipType type, int maxCap) throws IllegalArgumentException
      Puts this Entity to a GossipType with a custom decay max.
      Parameters:
      en - Entity to put to the GossipType
      type - GossipType to put to
      maxCap - Maximum decay of this GossipType
      Throws:
      IllegalArgumentException - if entity or gossip type is null
    • remove

      void remove(@NotNull @NotNull Entity en, @NotNull @NotNull GossipType type) throws IllegalArgumentException
      Removes this Entity from a GossipType. If the entity does not have this gossip type, it will do nothing.
      Parameters:
      en - Entity to remove
      type - Gossip Type to remove from
      Throws:
      IllegalArgumentException - if entity or gossip type is null
    • removeAll

      default void removeAll(@NotNull @NotNull Entity en) throws IllegalArgumentException
      Removes this Entity from all GossipTypes. If the entity has no gossip type, it will do nothing.
      Parameters:
      en - Entity to remove
      Throws:
      IllegalArgumentException - if entity is null
    • removeAll

      void removeAll(@NotNull @NotNull GossipType type) throws IllegalArgumentException
      Removes all Entities with this Gossip Type from this Gossip Container.
      Parameters:
      type - Gossip Type to remove
      Throws:
      IllegalArgumentException - if gossip type is null