Re-implements depreciated enchantment key getting
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
This commit is contained in:
@@ -3,7 +3,6 @@ package net.knarcraft.bookswithoutborders.listener;
|
||||
import net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig;
|
||||
import net.knarcraft.bookswithoutborders.utility.IntegerToRomanConverter;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.ChiseledBookshelf;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -141,12 +140,8 @@ public class BookshelfListener implements Listener {
|
||||
* @return <p>The prettified enchantment name</p>
|
||||
*/
|
||||
private String getEnchantmentName(Enchantment enchantment) {
|
||||
NamespacedKey key = enchantment.getKeyOrNull();
|
||||
if (key != null) {
|
||||
return uppercaseFirst(key.getKey().replace("_", " "));
|
||||
} else {
|
||||
return "Unknown Enchantment";
|
||||
}
|
||||
// Note: While depreciated, changing this is incompatible with Paper
|
||||
return uppercaseFirst(enchantment.getKey().getKey().replace("_", " "));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user