Add villager reputation API
This commit is contained in:
@@ -3,6 +3,8 @@ package org.bukkit.entity;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.Locale;
|
||||
import java.util.Map; // Paper
|
||||
import java.util.UUID; // Paper
|
||||
import org.bukkit.Keyed;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.NamespacedKey;
|
||||
@@ -281,4 +283,50 @@ public interface Villager extends AbstractVillager {
|
||||
return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// Paper start - Add villager reputation API
|
||||
/**
|
||||
* Get the {@link com.destroystokyo.paper.entity.villager.Reputation reputation}
|
||||
* for a specific player by {@link UUID}.
|
||||
*
|
||||
* @param uniqueId The {@link UUID} of the player to get the reputation of.
|
||||
* @return The player's copied reputation with this villager.
|
||||
*/
|
||||
@NotNull
|
||||
public com.destroystokyo.paper.entity.villager.Reputation getReputation(@NotNull UUID uniqueId);
|
||||
|
||||
/**
|
||||
* Get all {@link com.destroystokyo.paper.entity.villager.Reputation reputations}
|
||||
* for all players mapped by their {@link UUID unique IDs}.
|
||||
*
|
||||
* @return All {@link com.destroystokyo.paper.entity.villager.Reputation reputations} for all players
|
||||
* in a copied map.
|
||||
*/
|
||||
@NotNull
|
||||
public Map<UUID, com.destroystokyo.paper.entity.villager.Reputation> getReputations();
|
||||
|
||||
/**
|
||||
* Set the {@link com.destroystokyo.paper.entity.villager.Reputation reputation}
|
||||
* for a specific player by {@link UUID}.
|
||||
*
|
||||
* @param uniqueId The {@link UUID} of the player to set the reputation of.
|
||||
* @param reputation The {@link com.destroystokyo.paper.entity.villager.Reputation reputation} to set.
|
||||
*/
|
||||
public void setReputation(@NotNull UUID uniqueId, @NotNull com.destroystokyo.paper.entity.villager.Reputation reputation);
|
||||
|
||||
/**
|
||||
* Set all {@link com.destroystokyo.paper.entity.villager.Reputation reputations}
|
||||
* for all players mapped by their {@link UUID unique IDs}.
|
||||
*
|
||||
* @param reputations All {@link com.destroystokyo.paper.entity.villager.Reputation reputations}
|
||||
* for all players mapped by their {@link UUID unique IDs}.
|
||||
*/
|
||||
public void setReputations(@NotNull Map<UUID, com.destroystokyo.paper.entity.villager.Reputation> reputations);
|
||||
|
||||
/**
|
||||
* Clear all reputations from this villager. This removes every single
|
||||
* reputation regardless of its impact and the player associated.
|
||||
*/
|
||||
public void clearReputations();
|
||||
// Paper end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user