Interface EntityGossipContainer
public interface EntityGossipContainer
Represents a Gossip Container Manager for a Villager
-
Method Summary
Modifier and TypeMethodDescriptionvoid
decay()
Forcefully decays all the gossip types by their daily decay rate.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
Removes this Entity from all GossipTypes.
-
Method Details
-
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 theGossipType
array passed, and then adding all of theirGossipType.getPriority()
methods together (negatives have negative priority, positives have positive priority).- Parameters:
en
- Entity to get the reputation oftypes
- 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 GossipTypetype
- 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 GossipTypetype
- GossipType to put tomaxCap
- 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 removetype
- Gossip Type to remove from- Throws:
IllegalArgumentException
- if entity or gossip type is null
-
removeAll
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
Removes all Entities with this Gossip Type from this Gossip Container.- Parameters:
type
- Gossip Type to remove- Throws:
IllegalArgumentException
- if gossip type is null
-