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:
@ -99,7 +99,7 @@ public class ConfigLoader
|
||||
};
|
||||
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 =
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
package nl.pim16aap2.armoredElytra.util;
|
||||
|
||||
import nl.pim16aap2.armoredElytra.ArmoredElytra;
|
||||
import nl.pim16aap2.armoredElytra.util.UpdateChecker.UpdateReason;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
@ -51,15 +50,7 @@ public final class UpdateManager
|
||||
if (!checkForUpdates || updater.getLastResult() == null)
|
||||
return false;
|
||||
|
||||
// There's a newer version available.
|
||||
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;
|
||||
return updater.getLastResult().requiresUpdate();
|
||||
}
|
||||
|
||||
public void checkForUpdates()
|
||||
|
@ -42,7 +42,10 @@ public class Messages
|
||||
public Messages(final ArmoredElytra 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())
|
||||
{
|
||||
plugin.myLogger(Level.WARNING, "Failed to load language file: \"" + textFile +
|
||||
|
Reference in New Issue
Block a user