mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-30 21:17:42 +01:00
Display error for incompatible WorldGuard versions
This commit is contained in:
parent
361dbfc3ce
commit
6eb138d333
@ -621,11 +621,17 @@ public class QuestFactory implements ConversationAbandonedListener {
|
|||||||
String text = ChatColor.DARK_GREEN + Lang.get("questRegionTitle") + "\n";
|
String text = ChatColor.DARK_GREEN + Lang.get("questRegionTitle") + "\n";
|
||||||
boolean any = false;
|
boolean any = false;
|
||||||
for (World world : plugin.getServer().getWorlds()) {
|
for (World world : plugin.getServer().getWorlds()) {
|
||||||
|
try {
|
||||||
RegionManager rm = plugin.getDependencies().getWorldGuard().getRegionManager(world);
|
RegionManager rm = plugin.getDependencies().getWorldGuard().getRegionManager(world);
|
||||||
for (String region : rm.getRegions().keySet()) {
|
for (String region : rm.getRegions().keySet()) {
|
||||||
any = true;
|
any = true;
|
||||||
text += ChatColor.GREEN + region + ", ";
|
text += ChatColor.GREEN + region + ", ";
|
||||||
}
|
}
|
||||||
|
} catch (NoSuchMethodError e) {
|
||||||
|
String version = plugin.getServer().getPluginManager().getPlugin("").getDescription().getVersion();
|
||||||
|
plugin.getLogger().severe("Quests does not currently support regions for WorldGuard " + version);
|
||||||
|
return ChatColor.RED + Lang.get("questWGNotInstalled");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (any) {
|
if (any) {
|
||||||
text = text.substring(0, text.length() - 2);
|
text = text.substring(0, text.length() - 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user