Add methods to get translation keys
== AT == public org.bukkit.craftbukkit.inventory.CraftMetaFirework public org.bukkit.craftbukkit.inventory.CraftMetaFirework power public org.bukkit.craftbukkit.inventory.CraftMetaFirework getNBT(Lorg/bukkit/FireworkEffect$Type;)Lnet/minecraft/world/item/component/FireworkExplosion$Shape; Co-authored-by: MeFisto94 <MeFisto94@users.noreply.github.com>
This commit is contained in:
@@ -152,6 +152,17 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
|
||||
}
|
||||
// Paper end
|
||||
|
||||
// Paper start - add translationKey methods
|
||||
@Override
|
||||
public String translationKey() {
|
||||
if (!(this.getHandle().description().getContents() instanceof final net.minecraft.network.chat.contents.TranslatableContents translatableContents)) {
|
||||
throw new UnsupportedOperationException("Description isn't translatable!"); // Paper
|
||||
}
|
||||
return translatableContents.getKey();
|
||||
|
||||
}
|
||||
// Paper end - add translationKey methods
|
||||
|
||||
@Override
|
||||
public String getTranslationKey() {
|
||||
return Util.makeDescriptionId("enchantment", this.handle.unwrapKey().get().location());
|
||||
|
||||
Reference in New Issue
Block a user