1
0
mirror of https://e.coding.net/circlecloud/Residence.git synced 2024-10-31 22:38:48 +00:00

add auto version check...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-05-30 23:22:37 +08:00
parent 1412674a3c
commit dd3baee1b0
2 changed files with 21 additions and 14 deletions

View File

@ -23,7 +23,6 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
@ -55,6 +54,7 @@ import com.bekvon.bukkit.residence.selection.WorldEditSelectionManager;
import com.bekvon.bukkit.residence.text.Language;
import com.bekvon.bukkit.residence.text.help.HelpEntry;
import com.bekvon.bukkit.residence.text.help.InformationPager;
import com.bekvon.bukkit.residence.utils.VersionChecker;
import com.bekvon.bukkit.residence.utils.ZipLibrary;
import com.bekvon.bukkit.residence.vaultinterface.ResidenceVaultAdapter;
import com.earth2me.essentials.Essentials;
@ -82,6 +82,7 @@ public class Residence extends JavaPlugin {
protected static RentManager rentmanager;
protected static ChatManager chatmanager;
protected static Server server;
protected static VersionChecker versionChecker;
protected static HelpEntry helppages;
protected static Language language;
protected static Logger log;
@ -187,6 +188,10 @@ public class Residence extends JavaPlugin {
return tmanager;
}
public static VersionChecker getVersionChecker() {
return versionChecker;
}
public static WorldFlagManager getWorldFlags() {
return wmanager;
}
@ -291,8 +296,13 @@ public class Residence extends JavaPlugin {
}
public void consoleMessage(String message) {
ConsoleCommandSender console = Bukkit.getConsoleSender();
console.sendMessage("[Residence] " + message);
this.getLogger().info(message);
}
public void consoleMessage(String[] msg) {
for (String s : msg) {
consoleMessage(s);
}
}
@Override
@ -579,9 +589,11 @@ public class Residence extends JavaPlugin {
} catch (Exception ex) {
initsuccess = false;
getServer().getPluginManager().disablePlugin(this);
this.getLogger().warning(" - 初始化失败! 卸载插件! 请报告下错误给作者,谢谢!");
this.getLogger().warning(" - 初始化失败! 卸载插件! 请报告下错误给作者,谢谢!");
this.getLogger().warning("错误: " + ex);
}
versionChecker = new VersionChecker(this);
versionChecker.VersionCheck(null);
}
@Override

View File

@ -52,8 +52,7 @@ public class ResidenceCommandListener extends Residence {
}
@SuppressWarnings("deprecation")
private boolean commandRes(String[] args, boolean resadmin, Command command,
CommandSender sender) {
private boolean commandRes(String[] args, boolean resadmin, Command command, CommandSender sender) {
if (args.length > 0 && args[args.length - 1].equalsIgnoreCase("?") || args.length > 1
&& args[args.length - 2].equals("?"))
return commandHelp(args, resadmin, sender);
@ -111,8 +110,7 @@ public class ResidenceCommandListener extends Residence {
sender.sendMessage(ChatColor.DARK_AQUA + "插件命令列表,帮助, 请查看wiki:");
sender.sendMessage(ChatColor.GREEN + "http://residencebukkitmod.wikispaces.com/");
sender.sendMessage(ChatColor.AQUA + "重制版本请查看Jenkins:");
sender.sendMessage(ChatColor.BLUE
+ "http://ci.citycraft.cn:8800/jenkins/job/Residence-Fix/");
sender.sendMessage(ChatColor.BLUE + this.getDescription().getWebsite());
sender.sendMessage(ChatColor.GRAY + "------------------------------------");
return true;
}
@ -629,8 +627,7 @@ public class ResidenceCommandListener extends Residence {
return true;
}
private boolean commandResConfirm(String[] args, boolean resadmin, CommandSender sender,
int page) {
private boolean commandResConfirm(String[] args, boolean resadmin, CommandSender sender, int page) {
Player player = null;
String name = "Console";
if (sender instanceof Player) {
@ -932,8 +929,7 @@ public class ResidenceCommandListener extends Residence {
return false;
}
private boolean commandResMarketAutorenew(String[] args, boolean resadmin, Player player,
int page) {
private boolean commandResMarketAutorenew(String[] args, boolean resadmin, Player player, int page) {
if (!cmanager.enableEconomy()) {
player.sendMessage(ChatColor.RED + language.getPhrase("MarketDisabled"));
return true;
@ -991,8 +987,7 @@ public class ResidenceCommandListener extends Residence {
return true;
}
private boolean commandResMarketRentable(String[] args, boolean resadmin, Player player,
int page) {
private boolean commandResMarketRentable(String[] args, boolean resadmin, Player player, int page) {
if (args.length < 5 || args.length > 6)
return false;
if (!cmanager.enabledRentSystem()) {