renamed config file and other yml files

This commit is contained in:
Alastair 2016-03-03 19:45:31 +00:00
parent 4617b398f3
commit a740de0ae9
12 changed files with 25 additions and 25 deletions

View File

@ -144,7 +144,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
Location pos1 = new Location(world, player.getMetadata("Pos1X").get(0).asInt(), player.getMetadata("Pos1Y").get(0).asInt(), player.getMetadata("Pos1Z").get(0).asInt());
Location pos2 = new Location(world, player.getMetadata("Pos2X").get(0).asInt(), player.getMetadata("Pos2Y").get(0).asInt(), player.getMetadata("Pos2Z").get(0).asInt());
ConfigAccessor desticonfig = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor desticonfig = new ConfigAccessor(plugin, "destinations.yml");
String destiPosX = desticonfig.getConfig().getString(destination + ".pos1.X");
if(!Portal.portalExists(portalName)){
@ -269,7 +269,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
}
}
else if(args[0].toLowerCase().equals("edit")) {
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "Portals.yml");
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
if(args.length > 1){
String posX = portalConfig.getConfig().getString(args[1] + ".pos1.X");
if(posX != null){
@ -300,7 +300,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
else if(args[0].toLowerCase().equals("rename")) {
// not finished yet /
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "Portals.yml");
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
if(args.length > 1){
Player player = (Player)sender;
if(player.hasMetadata("selectedPortal")){
@ -378,7 +378,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
}
}
else if(args[0].toLowerCase().equals("remove")) {
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "Portals.yml");
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
if(args.length > 1){
String posX = portalConfig.getConfig().getString(args[1] + ".pos1.X");
if(posX != null){
@ -419,7 +419,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
sender.sendMessage("\u00A7a[\u00A7eAdvancedPortals\u00A7a] Help page: http://bit.ly/portals-help!");
}
else if(args[0].toLowerCase().equals("show")){
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "Portals.yml");
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
Player player = (Player) sender;
if(args.length > 1){
String posX = portalConfig.getConfig().getString(args[1] + ".pos1.X");

View File

@ -62,10 +62,10 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
this.customPrefix = config.getConfig().getString("CustomPrefix");
}
ConfigAccessor portalConfig = new ConfigAccessor(this, "Portals.yml");
ConfigAccessor portalConfig = new ConfigAccessor(this, "portals.yml");
portalConfig.saveDefaultConfig();
ConfigAccessor destinationConfig = new ConfigAccessor(this, "Destinations.yml");
ConfigAccessor destinationConfig = new ConfigAccessor(this, "destinations.yml");
destinationConfig.saveDefaultConfig();
new Assets(this);

View File

@ -37,7 +37,7 @@ public class DestinationCommand implements CommandExecutor, TabCompleter {
if(args[0].toLowerCase().equals("create")){
if(sender.hasPermission("AdvancedPortals.create")){
if(args.length > 1){
ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
String posX = config.getConfig().getString(args[1].toLowerCase() + ".pos.X");
if(posX == null){
sender.sendMessage("§a[\u00A7eAdvancedPortals\u00A7a] You have created a new destination called \u00A7e" + args[1] + "!");
@ -57,7 +57,7 @@ public class DestinationCommand implements CommandExecutor, TabCompleter {
}
}
else if(args[0].toLowerCase().equals("remove")) {
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "destinations.yml");
if(args.length > 1){
String posX = portalConfig.getConfig().getString(args[1] + ".pos.X");
if(posX != null){
@ -75,7 +75,7 @@ public class DestinationCommand implements CommandExecutor, TabCompleter {
else if(args[0].toLowerCase().equals("goto") || args[0].toLowerCase().equals("warp")) {
if(args.length > 1){
//System.out.println(args[1]);
ConfigAccessor configDesti = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor configDesti = new ConfigAccessor(plugin, "destinations.yml");
if(configDesti.getConfig().getString(args[1] + ".world") != null){
Destination.warp(sender, args[1]);
if(PortalMessagesDisplay == 1){
@ -84,7 +84,7 @@ public class DestinationCommand implements CommandExecutor, TabCompleter {
sender.sendMessage("");
}
else if(PortalMessagesDisplay == 2){
ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
plugin.nmsAccess.sendActionBarMessage("{\"text\":\"\u00A7aYou have warped to \u00A7e" + args[1].replaceAll("_", " ") + "\u00A7a.\"}", (Player) sender);
/**plugin.nmsAccess.sendActionBarMessage("[{text:\"You have warped to \",color:green},{text:\"" + config.getConfig().getString(Portal.Portals[portalId].portalName + ".destination").replaceAll("_", " ")
+ "\",color:yellow},{\"text\":\".\",color:green}]", player);*/

View File

@ -115,7 +115,7 @@ public class Listeners implements Listener {
player.sendMessage("");
}
else if(PortalMessagesDisplay == 2 && warped){
ConfigAccessor config = new ConfigAccessor(plugin, "Portals.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "portals.yml");
plugin.nmsAccess.sendActionBarMessage("{\"text\":\"\u00A7aYou have been warped to \u00A7e" + portal.destiation.replaceAll("_", " ") + "\u00A7a.\"}", player);
/**plugin.nmsAccess.sendActionBarMessage("[{text:\"You have warped to \",color:green},{text:\"" + config.getConfig().getString(portal.portalName + ".destination").replaceAll("_", " ")
+ "\",color:yellow},{\"text\":\".\",color:green}]", player);*/

View File

@ -37,7 +37,7 @@ public class Selection {
@SuppressWarnings("deprecation")
public static void Show(final Player player, final AdvancedPortalsPlugin plugin, String portalName) {
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "Portals.yml");
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
int LowX = portalConfig.getConfig().getInt(portalName + ".pos2.X");
int LowY = portalConfig.getConfig().getInt(portalName + ".pos2.Y");

View File

@ -36,7 +36,7 @@ public class WarpCommand implements CommandExecutor, TabCompleter {
sender.sendMessage("");
}
else if(DestinationCommand.PortalMessagesDisplay == 2){
ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
plugin.nmsAccess.sendActionBarMessage("{\"text\":\"\u00A7aYou have warped to \u00A7e" + args[0].replaceAll("_", " ") + "\u00A7a.\"}", (Player) sender);
/**plugin.nmsAccess.sendActionBarMessage("[{text:\"You have warped to \",color:green},{text:\"" + config.getConfig().getString(Portal.Portals[portalId].portalName + ".destination").replaceAll("_", " ")
+ "\",color:yellow},{\"text\":\".\",color:green}]", player);*/

View File

@ -28,7 +28,7 @@ public class Destination {
// TODO add permissions for destinations.
public static void create(Location location, String name){
ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
config.getConfig().set(name.toLowerCase() + ".world", location.getWorld().getName());
@ -43,7 +43,7 @@ public class Destination {
}
public static void move(Location location, String name){
ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
config.getConfig().set(name.toLowerCase() + ".world", location.getWorld().getName());
@ -58,7 +58,7 @@ public class Destination {
}
public static void rename(String oldName, String newName){
ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
config.getConfig().set(newName.toLowerCase() + ".world", config.getConfig().getString(oldName + ".world"));
@ -75,7 +75,7 @@ public class Destination {
}
public static void remove(String name){
ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
config.getConfig().set(name.toLowerCase() + ".world", null);
@ -94,7 +94,7 @@ public class Destination {
}
public static boolean warp(Player player, String name, boolean senderror){
ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
if(config.getConfig().getString(name + ".world") != null){
Location loc = player.getLocation();
if(Bukkit.getWorld(config.getConfig().getString(name + ".world")) != null){
@ -187,7 +187,7 @@ public class Destination {
public static List<String> destiList(){
ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml");
LinkedList<String> destiList = new LinkedList<>();

View File

@ -27,7 +27,7 @@ public class Portal {
private static boolean ShowBungeeMessage;
public static ConfigAccessor portalData = new ConfigAccessor(plugin, "Portals.yml");
public static ConfigAccessor portalData = new ConfigAccessor(plugin, "portals.yml");
public Portal(AdvancedPortalsPlugin plugin) {
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
@ -47,7 +47,7 @@ public class Portal {
*/
public static void loadPortals(){
portalData = new ConfigAccessor(plugin, "Portals.yml");
portalData = new ConfigAccessor(plugin, "portals.yml");
Set<String> PortalSet = portalData.getConfig().getKeys(false);
if(PortalSet.size() > 0){
Portals = new AdvancedPortal[PortalSet.toArray().length];
@ -416,7 +416,7 @@ public class Portal {
}
plugin.getLogger().info(portal.portalName + ":" + portal.destiation);
if(portal.destiation != null){
ConfigAccessor configDesti = new ConfigAccessor(plugin, "Destinations.yml");
ConfigAccessor configDesti = new ConfigAccessor(plugin, "destinations.yml");
String permission = portal.getArg("permission");
if(permission == null || (permission != null && player.hasPermission(permission)) || player.isOp()){
if(configDesti.getConfig().getString(portal.destiation + ".world") != null){
@ -472,7 +472,7 @@ public class Portal {
// set it so it gets all data from one and puts it into another place
ConfigAccessor config = new ConfigAccessor(plugin, "Portals.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "portals.yml");
Set<String> keys = config.getConfig().getKeys(true);
for(String key: keys){
@ -500,7 +500,7 @@ public class Portal {
public static boolean addCommand(String portalName, String portalCommand) {
ConfigAccessor config = new ConfigAccessor(plugin, "Portals.yml");
ConfigAccessor config = new ConfigAccessor(plugin, "portals.yml");
if(portalExists(portalName)){
int commandLine = 0;
while(config.getConfig().getString(portalName + ".portalArgs.command." + ++commandLine) != null); //Loops increasing commandLine till 1 is null