Class Reputation

java.lang.Object
com.destroystokyo.paper.entity.villager.Reputation

public final class Reputation extends Object
A reputation score for a player on a villager.
  • Constructor Details

    • Reputation

      public Reputation()
      Creates an empty reputation.
    • Reputation

      public Reputation(Map<ReputationType, Integer> reputation)
      Creates a reputation backed by the given map, so changes to the reputation are made to the map.
      Parameters:
      reputation - the reputation values by type
  • Method Details

    • getReputation

      public int getReputation(ReputationType type)
      Gets the reputation value for a specific ReputationType.
      Parameters:
      type - The type of reputation to get.
      Returns:
      The value of the type.
    • setReputation

      public void setReputation(ReputationType type, int value)
      Sets the reputation value for a specific ReputationType.
      Parameters:
      type - The type of reputation to set.
      value - The value of the type.
    • hasReputationSet

      public boolean hasReputationSet(ReputationType type)
      Gets if a reputation value is currently set for a specific ReputationType.
      Parameters:
      type - The type to check
      Returns:
      If there is a value for this type set.
    • getReputationsSet

      public @Unmodifiable Set<ReputationType> getReputationsSet()
      Gets a set of all types that have a reputation value set.
      Returns:
      A set of types.