Implement Translatable on villager Profession (#6542)

This commit is contained in:
Jake Potrebic 2021-09-21 21:45:01 -07:00 committed by GitHub
parent f75636b55f
commit d2c2b7a9be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -309,6 +309,33 @@ index 9be5371c7f398d0ec8241403661415ff40661067..d36d314383713bac3b11f18d95b0809d
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index 511b96841f7342d0a6b38d7cff56252ea8ef9bfe..02ecc87a90bbd81e7d21279fac701ba41c74fd9f 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -148,7 +148,7 @@ public interface Villager extends AbstractVillager {
* Represents the various different Villager professions there may be.
* Villagers have different trading options depending on their profession,
*/
- public enum Profession implements Keyed {
+ public enum Profession implements Keyed, net.kyori.adventure.translation.Translatable { // Paper
NONE,
/**
* Armorer profession. Wears a black apron. Armorers primarily trade for
@@ -231,6 +231,13 @@ public interface Villager extends AbstractVillager {
public NamespacedKey getKey() {
return key;
}
+
+ // Paper start
+ @Override
+ public @NotNull String translationKey() {
+ return "entity.minecraft.villager." + this.key.getKey();
+ }
+ // Paper end
}
// Paper start - Add villager reputation API
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index b80ef2e5c23764ee68f809268185492bf5577913..e6eab5d8ca3fea8d2e0ccc1cd1c1a7a110b589db 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java