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:
parent
191f548f5a
commit
72ea5600fe
4
pom.xml
4
pom.xml
@ -69,7 +69,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.19.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.20.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -87,7 +87,7 @@
|
||||
<dependency>
|
||||
<groupId>net.knarcraft</groupId>
|
||||
<artifactId>knarlib</artifactId>
|
||||
<version>1.1</version>
|
||||
<version>1.2.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ authors: [ EpicKnarvik97, aPunch, jrbudda, HurricanKai ]
|
||||
version: '${project.version}'
|
||||
main: net.knarcraft.blacksmith.BlacksmithPlugin
|
||||
depend: [ Citizens, Vault ]
|
||||
prefix: "Blacksmith"
|
||||
|
||||
api-version: 1.19
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user