Skip to content
This repository has been archived by the owner on Jul 3, 2022. It is now read-only.

Commit

Permalink
Minor updater string changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicofisi committed Mar 25, 2016
1 parent 07bec8f commit ce26113
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
Binary file modified bin/pl/pickaxe/largesk/LargeSk.class
Binary file not shown.
2 changes: 1 addition & 1 deletion lastest.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.2
1.0.2A
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: pl.pickaxe.largesk.LargeSk
name: LargeSk
version: 1.0.2
version: 1.0.2A
description: An addon for Skript with some cool features.
author: Nicofisi
website: http://github.com/Nicofisi/LargeSk
Expand Down
4 changes: 2 additions & 2 deletions src/pl/pickaxe/largesk/LargeSk.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class LargeSk extends JavaPlugin implements Listener {

public static boolean debug = true;
public static boolean debug = false;

public static LargeSk getPlugin() {
return LargeSk.getPlugin(LargeSk.class);
Expand Down Expand Up @@ -48,7 +48,7 @@ public void onEnable() {

//Also obvious
Bukkit.getScheduler().runTaskAsynchronously(this, SkAddons::logAddons);
Xlog.logInfo("I will show you a list of your Skript as soon as everything loads up.");
Xlog.logInfo("I will show you a list of your Skript addons as soon as everything loads up.");

//Announcing how much time enabling took
eTime = System.currentTimeMillis() - eTime;
Expand Down
6 changes: 3 additions & 3 deletions src/pl/pickaxe/largesk/LargeSkCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
}
else if (args[0].equalsIgnoreCase("reload"))
{
sender.sendMessage(ChatColor.GRAY + "This is not implemented yet. (will be soon)");
sender.sendMessage(ChatColor.GRAY + "This is not implemented yet. (Will be soon)");
}
else if (args[0].equalsIgnoreCase("check"))
{
sender.sendMessage("Checking..");
sender.sendMessage(ChatColor.GRAY + "Checking..");
String newVersion = "";
try
{
Expand All @@ -64,7 +64,7 @@ else if (args[0].equalsIgnoreCase("check"))
catch (Exception e)
{
sender.sendMessage(e.getMessage());
sender.sendMessage("Could not check for updates (info above)");
sender.sendMessage(ChatColor.GRAY + "Could not check for updates (info above)");
}
String currentVersion = Bukkit.getPluginManager().getPlugin("LargeSk").getDescription().getVersion();
if ( ! Objects.equals(currentVersion, newVersion))
Expand Down
31 changes: 24 additions & 7 deletions src/pl/pickaxe/largesk/util/Updater.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class Updater
{
public static boolean updateSession = false;
public static String updatedVersion = null;

public void runUpdate()
{
Expand Down Expand Up @@ -86,7 +86,7 @@ public void run()
return;
}
Xlog.logUpdater("The update was downloaded! Just restart your server :)");
updateSession = true;
Updater.updatedVersion = newVersion;
}
});

Expand All @@ -101,7 +101,6 @@ public void removeOld()
//Checking updates, run on server startup and later by the Bukkit scheduler
public void checkUpdates()
{
if (updateSession) return;

Xlog.logUpdater("Checking for updates..");
String newVersion = "";
Expand All @@ -115,15 +114,33 @@ public void checkUpdates()
{
Xlog.logError(e.getCause().getMessage());
}
String currentVersion = LargeSk.getPlugin().getDescription().getVersion();
String currentVersion;
currentVersion = LargeSk.getPlugin().getDescription().getVersion();
if ( ! Objects.equals(currentVersion, newVersion))
{
Xlog.logUpdater("LargeSk " + newVersion + " was released! You are using " + currentVersion + ".");
Xlog.logUpdater("To download the update, just use /lsk update");
if (updatedVersion == null)
{
Xlog.logUpdater("LargeSk " + newVersion + " was released! You are using " + currentVersion + ".");
Xlog.logUpdater("To download the update, just use /lsk update");
}
else
{
Xlog.logUpdater("New version of LargeSk, " + newVersion + ", was found.");
Xlog.logUpdater("I know you downloaded an update in this session already, but the developer published even cooler one");
Xlog.logUpdater("Currently " + currentVersion + "is enabled, and " + updatedVersion + " is downloaded");
Xlog.logUpdater("Use the command /lsk update again!");
}
}
else
{
Xlog.logUpdater("It seems like your using the latest version of the plugin.");
if (updatedVersion == null)
{
Xlog.logUpdater("It seems like your using the latest version of the plugin.");
}
else
{
Xlog.logUpdater("The version of plugin you downloaded is the lastest one (but is still awaiting for a server restart)");
}
}
}
public void scheduleUpdates()
Expand Down

0 comments on commit ce26113

Please sign in to comment.