mirror of
https://e.coding.net/circlecloud/Residence.git
synced 2025-11-24 21:46:16 +00:00
2
pom.xml
2
pom.xml
@@ -55,7 +55,7 @@
|
||||
</build>
|
||||
<properties>
|
||||
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
|
||||
<update.description>&4修复当保存数据时关服导致的领地数据丢失&c修复resreload命令...</update.description>
|
||||
<update.description>&4修复当保存数据时关服导致的领地数据丢失&c修复resreload命令&d清理部分无用代码 修复部分1.8保护失效......</update.description>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<repositories>
|
||||
|
||||
@@ -86,18 +86,14 @@ import cn.citycraft.Residence.vaultinterface.ResidenceVaultAdapter;
|
||||
*/
|
||||
public class ResidenceMain extends JavaPlugin {
|
||||
|
||||
public static float bukkitver;
|
||||
|
||||
public final static int saveVersion = 1;
|
||||
public final static String[] validLanguages = { "English", "Chinese" };
|
||||
public final static Pattern VER_REGEX = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)");
|
||||
protected static ResidenceMain instance;
|
||||
|
||||
public static ResidenceMain getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private ConfigManager cmanager;
|
||||
private boolean ver1_8;
|
||||
|
||||
protected DataBackup backup;
|
||||
protected ResidenceBlockListener blistener;
|
||||
protected ChatManager chatmanager;
|
||||
@@ -125,9 +121,12 @@ public class ResidenceMain extends JavaPlugin {
|
||||
protected TaskManager taskmanager;
|
||||
protected TransactionManager tmanager;
|
||||
protected boolean useWorldEdit;
|
||||
|
||||
protected WorldFlagManager wmanager;
|
||||
|
||||
public static ResidenceMain getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void csm(final String... msgs) {
|
||||
for (final String msg : msgs) {
|
||||
Bukkit.getConsoleSender().sendMessage("§6[§a领地插件§6]§r " + msg);
|
||||
@@ -251,7 +250,7 @@ public class ResidenceMain extends JavaPlugin {
|
||||
}
|
||||
|
||||
public boolean is1_8() {
|
||||
return bukkitver == 1.8;
|
||||
return ver1_8;
|
||||
}
|
||||
|
||||
public boolean isInit() {
|
||||
@@ -285,7 +284,7 @@ public class ResidenceMain extends JavaPlugin {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean loadYml() throws Exception {
|
||||
public synchronized boolean loadYml() throws Exception {
|
||||
final File saveFolder = new File(dataFolder, "Save");
|
||||
try {
|
||||
final File worldFolder = new File(saveFolder, "Worlds");
|
||||
@@ -370,10 +369,15 @@ public class ResidenceMain extends JavaPlugin {
|
||||
public void onEnable() {
|
||||
try {
|
||||
instance = this;
|
||||
init = false;
|
||||
FlagPermissions.init(this);
|
||||
this.getLogger().info("Bukkit 版本: " + this.getServer().getBukkitVersion());
|
||||
bukkitver = Float.parseFloat(this.getServer().getBukkitVersion().substring(0, 3));
|
||||
init = false;
|
||||
try {
|
||||
Class.forName("org.bukkit.event.player.PlayerInteractAtEntityEvent");
|
||||
ver1_8 = true;
|
||||
} catch (final Exception e) {
|
||||
ver1_8 = false;
|
||||
}
|
||||
deleteConfirm = new HashMap<String, String>();
|
||||
resadminToggle = new ArrayList<String>();
|
||||
dataFolder = this.getDataFolder();
|
||||
@@ -394,9 +398,7 @@ public class ResidenceMain extends JavaPlugin {
|
||||
gmanager = new PermissionManager(this);
|
||||
imanager = new WorldItemManager(this.getConfig());
|
||||
wmanager = new WorldFlagManager(this);
|
||||
|
||||
entitymanager = new EntityManager(this);
|
||||
|
||||
chatmanager = new ChatManager(this);
|
||||
rentmanager = new RentManager(this);
|
||||
for (final String lang : validLanguages) {
|
||||
@@ -530,7 +532,6 @@ public class ResidenceMain extends JavaPlugin {
|
||||
csm("§4初始化失败! 卸载插件! 请报告以下错误给作者,谢谢!");
|
||||
csm("§c错误: " + ex);
|
||||
ex.printStackTrace();
|
||||
init = false;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ResidencePlayerListener implements Listener {
|
||||
|
||||
if (leave != null && !leave.equals("")) {
|
||||
if (plugin.getConfigManager().useActionBar()) {
|
||||
ActionBar.send(player, (new StringBuilder()).append(ChatColor.YELLOW).append(insertMessages(player, ResOld.getName(), ResOld, leave)).toString());
|
||||
ActionBar.send(player, ChatColor.YELLOW + insertMessages(player, ResOld.getName(), ResOld, leave));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.YELLOW + this.insertMessages(player, ResOld.getName(), ResOld, leave));
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public class ResidencePlayerListener implements Listener {
|
||||
|
||||
if (enterMessage != null && !enterMessage.equals("") && !(ResOld != null && res == ResOld.getParent())) {
|
||||
if (plugin.getConfigManager().useActionBar()) {
|
||||
ActionBar.send(player, (new StringBuilder()).append(ChatColor.YELLOW).append(insertMessages(player, areaname, res, enterMessage)).toString());
|
||||
ActionBar.send(player, ChatColor.YELLOW + insertMessages(player, areaname, res, enterMessage));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.YELLOW + this.insertMessages(player, areaname, res, enterMessage));
|
||||
}
|
||||
|
||||
@@ -257,10 +257,6 @@ public class ConfigManager {
|
||||
throw new RuntimeException("领地配置文件载入错误...", e);
|
||||
}
|
||||
final ConfigurationSection node = config.getConfigurationSection("Global.GroupDefault");
|
||||
|
||||
if (!plugin.is1_8()) {
|
||||
actionBar = false;
|
||||
}
|
||||
if (node != null) {
|
||||
final Set<String> keys = node.getConfigurationSection(defaultGroup).getKeys(false);
|
||||
if (keys != null) {
|
||||
|
||||
Reference in New Issue
Block a user