#804: Added methods to get translation keys for materials, itemstacks and more
By: mfnalex <mfnalex@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Translatable;
|
||||
import org.bukkit.Utility;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@@ -22,7 +23,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* use this class to encapsulate Materials for which {@link Material#isItem()}
|
||||
* returns false.</b>
|
||||
*/
|
||||
public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
public class ItemStack implements Cloneable, ConfigurationSerializable, Translatable {
|
||||
private Material type = Material.AIR;
|
||||
private int amount = 0;
|
||||
private MaterialData data = null;
|
||||
@@ -595,4 +596,10 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getTranslationKey() {
|
||||
return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user