From a740de0ae98850382b792b0671beedff47ad402c Mon Sep 17 00:00:00 2001 From: Alastair Date: Thu, 3 Mar 2016 19:45:31 +0000 Subject: [PATCH] renamed config file and other yml files --- src/Config.yml => Resources/config.yml | 0 src/Destinations.yml => Resources/destinations.yml | 0 {src => Resources}/plugin.yml | 0 src/Portals.yml => Resources/portals.yml | 0 .../advancedportals/AdvancedPortalsCommand.java | 10 +++++----- .../advancedportals/AdvancedPortalsPlugin.java | 4 ++-- .../sekwah/advancedportals/DestinationCommand.java | 8 ++++---- src/com/sekwah/advancedportals/Listeners.java | 2 +- src/com/sekwah/advancedportals/Selection.java | 2 +- src/com/sekwah/advancedportals/WarpCommand.java | 2 +- .../advancedportals/destinations/Destination.java | 12 ++++++------ src/com/sekwah/advancedportals/portals/Portal.java | 10 +++++----- 12 files changed, 25 insertions(+), 25 deletions(-) rename src/Config.yml => Resources/config.yml (100%) rename src/Destinations.yml => Resources/destinations.yml (100%) rename {src => Resources}/plugin.yml (100%) rename src/Portals.yml => Resources/portals.yml (100%) diff --git a/src/Config.yml b/Resources/config.yml similarity index 100% rename from src/Config.yml rename to Resources/config.yml diff --git a/src/Destinations.yml b/Resources/destinations.yml similarity index 100% rename from src/Destinations.yml rename to Resources/destinations.yml diff --git a/src/plugin.yml b/Resources/plugin.yml similarity index 100% rename from src/plugin.yml rename to Resources/plugin.yml diff --git a/src/Portals.yml b/Resources/portals.yml similarity index 100% rename from src/Portals.yml rename to Resources/portals.yml diff --git a/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java b/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java index 67e08f7..7e95c1f 100644 --- a/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java +++ b/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java @@ -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"); diff --git a/src/com/sekwah/advancedportals/AdvancedPortalsPlugin.java b/src/com/sekwah/advancedportals/AdvancedPortalsPlugin.java index 61394f8..d1be41d 100644 --- a/src/com/sekwah/advancedportals/AdvancedPortalsPlugin.java +++ b/src/com/sekwah/advancedportals/AdvancedPortalsPlugin.java @@ -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); diff --git a/src/com/sekwah/advancedportals/DestinationCommand.java b/src/com/sekwah/advancedportals/DestinationCommand.java index 6bb9946..7f43d5c 100644 --- a/src/com/sekwah/advancedportals/DestinationCommand.java +++ b/src/com/sekwah/advancedportals/DestinationCommand.java @@ -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);*/ diff --git a/src/com/sekwah/advancedportals/Listeners.java b/src/com/sekwah/advancedportals/Listeners.java index 06e335d..c9d2ee3 100644 --- a/src/com/sekwah/advancedportals/Listeners.java +++ b/src/com/sekwah/advancedportals/Listeners.java @@ -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);*/ diff --git a/src/com/sekwah/advancedportals/Selection.java b/src/com/sekwah/advancedportals/Selection.java index ae6c1c7..b6142a8 100644 --- a/src/com/sekwah/advancedportals/Selection.java +++ b/src/com/sekwah/advancedportals/Selection.java @@ -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"); diff --git a/src/com/sekwah/advancedportals/WarpCommand.java b/src/com/sekwah/advancedportals/WarpCommand.java index 9a570bb..2113772 100644 --- a/src/com/sekwah/advancedportals/WarpCommand.java +++ b/src/com/sekwah/advancedportals/WarpCommand.java @@ -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);*/ diff --git a/src/com/sekwah/advancedportals/destinations/Destination.java b/src/com/sekwah/advancedportals/destinations/Destination.java index 0bad891..1da4461 100644 --- a/src/com/sekwah/advancedportals/destinations/Destination.java +++ b/src/com/sekwah/advancedportals/destinations/Destination.java @@ -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 destiList(){ - ConfigAccessor config = new ConfigAccessor(plugin, "Destinations.yml"); + ConfigAccessor config = new ConfigAccessor(plugin, "destinations.yml"); LinkedList destiList = new LinkedList<>(); diff --git a/src/com/sekwah/advancedportals/portals/Portal.java b/src/com/sekwah/advancedportals/portals/Portal.java index 00d5b77..80efc0f 100644 --- a/src/com/sekwah/advancedportals/portals/Portal.java +++ b/src/com/sekwah/advancedportals/portals/Portal.java @@ -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 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 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