Add methods to get translation keys

Co-authored-by: MeFisto94 <MeFisto94@users.noreply.github.com>
This commit is contained in:
Jake Potrebic
2020-08-11 19:17:46 +02:00
parent a3e3ba54a0
commit f610d0b477
18 changed files with 186 additions and 30 deletions

View File

@@ -181,7 +181,7 @@ public interface Villager extends AbstractVillager {
* Represents the various different Villager professions there may be.
* Villagers have different trading options depending on their profession,
*/
interface Profession extends OldEnum<Profession>, Keyed {
interface Profession extends OldEnum<Profession>, Keyed, net.kyori.adventure.translation.Translatable {
Profession NONE = getProfession("none");
/**
@@ -282,6 +282,13 @@ public interface Villager extends AbstractVillager {
static Profession[] values() {
return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]);
}
// Paper start
@Override
default @NotNull String translationKey() {
return "entity.minecraft.villager." + this.getKey().getKey();
}
// Paper end
}
// Paper start - Add villager reputation API