Fixes some warnings, and updates dependencies
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
This commit is contained in:
@ -123,7 +123,14 @@ public class BlacksmithPlugin extends JavaPlugin {
|
||||
translator.registerMessageCategory(TranslatableTimeUnit.UNIT_SECOND);
|
||||
translator.registerMessageCategory(BlacksmithTranslatableMessage.ITEM_TYPE_ENCHANTMENT);
|
||||
translator.loadLanguages(this.getDataFolder(), "en", fileConfiguration.getString("language", "en"));
|
||||
BlacksmithPlugin.stringFormatter = new StringFormatter(this.getDescription().getPrefix(), translator);
|
||||
PluginDescriptionFile description = this.getDescription();
|
||||
String prefix;
|
||||
if (description.getPrefix() == null) {
|
||||
prefix = "Blacksmith";
|
||||
} else {
|
||||
prefix = description.getPrefix();
|
||||
}
|
||||
BlacksmithPlugin.stringFormatter = new StringFormatter(prefix, translator);
|
||||
|
||||
//Set up Vault integration
|
||||
if (!setUpVault()) {
|
||||
|
@ -56,7 +56,7 @@ public final class TimeFormatter {
|
||||
String text = BlacksmithPlugin.getTranslator().getTranslatedMessage(BlacksmithTranslatableMessage.valueOf(interval.name()));
|
||||
|
||||
//Choose a random entry if a comma-separated list is provided
|
||||
if (text != null && text.contains(",")) {
|
||||
if (text.contains(",")) {
|
||||
String[] parts = text.split(",");
|
||||
String randomPart = parts[new Random().nextInt(parts.length)];
|
||||
if (randomPart != null) {
|
||||
@ -65,7 +65,7 @@ public final class TimeFormatter {
|
||||
}
|
||||
|
||||
//Use the set message, or use the default
|
||||
if (text != null && !text.trim().isEmpty()) {
|
||||
if (!text.trim().isEmpty()) {
|
||||
return text;
|
||||
} else {
|
||||
return interval.getDefaultText();
|
||||
|
@ -38,7 +38,6 @@ public class PlayerListener implements Listener {
|
||||
ItemStack usedItem = event.getPlayer().getInventory().getItem(event.getHand());
|
||||
if (usedItem != null && isArmor(usedItem)) {
|
||||
event.setUseItemInHand(Event.Result.DENY);
|
||||
event.getPlayer().updateInventory();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user