mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
#804: Added methods to get translation keys for materials, itemstacks and more
By: mfnalex <mfnalex@gmail.com>
This commit is contained in:
@@ -3,9 +3,11 @@ package org.bukkit.entity;
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Keyed;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Translatable;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.minecart.CommandMinecart;
|
||||
import org.bukkit.entity.minecart.ExplosiveMinecart;
|
||||
@@ -20,7 +22,7 @@ import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public enum EntityType implements Keyed {
|
||||
public enum EntityType implements Keyed, Translatable {
|
||||
|
||||
// These strings MUST match the strings in nms.EntityTypes and are case sensitive.
|
||||
/**
|
||||
@@ -425,4 +427,10 @@ public enum EntityType implements Keyed {
|
||||
public boolean isAlive() {
|
||||
return living;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getTranslationKey() {
|
||||
return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user