Add methods to get translation keys
Co-authored-by: MeFisto94 <MeFisto94@users.noreply.github.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* Represents the various type of game modes that {@link HumanEntity}s may
|
||||
* have
|
||||
*/
|
||||
public enum GameMode {
|
||||
public enum GameMode implements net.kyori.adventure.translation.Translatable { // Paper - implement Translatable
|
||||
/**
|
||||
* Creative mode may fly, build instantly, become invulnerable and create
|
||||
* free items.
|
||||
@@ -35,9 +35,18 @@ public enum GameMode {
|
||||
|
||||
private final int value;
|
||||
private static final Map<Integer, GameMode> BY_ID = Maps.newHashMap();
|
||||
// Paper start - translation keys
|
||||
private final String translationKey;
|
||||
|
||||
@Override
|
||||
public @org.jetbrains.annotations.NotNull String translationKey() {
|
||||
return this.translationKey;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
private GameMode(final int value) {
|
||||
this.value = value;
|
||||
this.translationKey = "gameMode." + this.name().toLowerCase(java.util.Locale.ENGLISH); // Paper
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user