Fix updater, compilation, and improve translation
- Fixed the updater thinking a result of UP_TO_DATE meant that the plugin was outdated. This happened because this system is used like this in BigDoors in case the active BD version is a dev-build. However, AE doesn't used dev-builds. - Fixed resources being placed in the jar twice. - When the provided text file includes ".txt" in the config, the plugin won't add another ".txt" to the filename (ending up as "filename.txt.txt"). This is a bit more user-friendly. - Bumped version number to 2.4.13
This commit is contained in:
parent
93bc2a3072
commit
1053e17b1d
8
pom.xml
8
pom.xml
@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>nl.pim16aap2</groupId>
|
<groupId>nl.pim16aap2</groupId>
|
||||||
<artifactId>ArmoredElytra</artifactId>
|
<artifactId>ArmoredElytra</artifactId>
|
||||||
<version>2.4.12</version>
|
<version>2.4.13</version>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
@ -65,12 +65,6 @@
|
|||||||
<finalName>${project.name}</finalName>
|
<finalName>${project.name}</finalName>
|
||||||
<sourceDirectory>src</sourceDirectory>
|
<sourceDirectory>src</sourceDirectory>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
|
||||||
<directory>src</directory>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/*.java</exclude>
|
|
||||||
</excludes>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
|
@ -99,7 +99,7 @@ public class ConfigLoader
|
|||||||
};
|
};
|
||||||
String[] languageFileComment =
|
String[] languageFileComment =
|
||||||
{
|
{
|
||||||
"Specify a language file to be used. Note that en_US.txt will get regenerated!"
|
"Specify a language file to be used."
|
||||||
};
|
};
|
||||||
String[] allowMultipleProtectionEnchantmentsComment =
|
String[] allowMultipleProtectionEnchantmentsComment =
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package nl.pim16aap2.armoredElytra.util;
|
package nl.pim16aap2.armoredElytra.util;
|
||||||
|
|
||||||
import nl.pim16aap2.armoredElytra.ArmoredElytra;
|
import nl.pim16aap2.armoredElytra.ArmoredElytra;
|
||||||
import nl.pim16aap2.armoredElytra.util.UpdateChecker.UpdateReason;
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
@ -51,15 +50,7 @@ public final class UpdateManager
|
|||||||
if (!checkForUpdates || updater.getLastResult() == null)
|
if (!checkForUpdates || updater.getLastResult() == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// There's a newer version available.
|
return updater.getLastResult().requiresUpdate();
|
||||||
if (updater.getLastResult().requiresUpdate())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// The plugin is "up-to-date", but this is a dev-build, so it must be newer.
|
|
||||||
if (updater.getLastResult().getReason().equals(UpdateReason.UP_TO_DATE))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkForUpdates()
|
public void checkForUpdates()
|
||||||
|
@ -42,7 +42,10 @@ public class Messages
|
|||||||
public Messages(final ArmoredElytra plugin)
|
public Messages(final ArmoredElytra plugin)
|
||||||
{
|
{
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
textFile = new File(plugin.getDataFolder(), plugin.getConfigLoader().languageFile() + ".txt");
|
final String fileName = plugin.getConfigLoader().languageFile();
|
||||||
|
// Only append .txt if the provided name doesn't already have it.
|
||||||
|
textFile = new File(plugin.getDataFolder(), fileName.endsWith(".txt") ? fileName : (fileName + ".txt"));
|
||||||
|
|
||||||
if (!textFile.exists())
|
if (!textFile.exists())
|
||||||
{
|
{
|
||||||
plugin.myLogger(Level.WARNING, "Failed to load language file: \"" + textFile +
|
plugin.myLogger(Level.WARNING, "Failed to load language file: \"" + textFile +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user