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