From 5d6daa0414aead24bfa9feab8717bf2b90ecea77 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Wed, 8 Jan 2020 15:15:36 -0600 Subject: [PATCH] Cleanups and corrections + Bug fixes + Fixed some string formatting issues --- .../com/zerohighdef/geoffrey/Commands/AddResidentCommand.java | 2 +- .../zerohighdef/geoffrey/Commands/DeleteResourceCommand.java | 2 +- .../com/zerohighdef/geoffrey/Commands/EditNameCommand.java | 4 ++-- .../com/zerohighdef/geoffrey/Commands/RegisterCommand.java | 2 +- .../zerohighdef/geoffrey/Commands/RemoveResidentCommand.java | 2 +- src/main/java/com/zerohighdef/geoffrey/GeoffreyMC.java | 1 + src/main/resources/config.yml | 3 +++ 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zerohighdef/geoffrey/Commands/AddResidentCommand.java b/src/main/java/com/zerohighdef/geoffrey/Commands/AddResidentCommand.java index ec27214..3b271d5 100644 --- a/src/main/java/com/zerohighdef/geoffrey/Commands/AddResidentCommand.java +++ b/src/main/java/com/zerohighdef/geoffrey/Commands/AddResidentCommand.java @@ -65,7 +65,7 @@ public class AddResidentCommand extends GeoffreyCommand { try { JsonElement json = parseJSON(s); - String msg = ChatColor.GREEN + newResidentName + "has been added to your town."; + String msg = ChatColor.GREEN + newResidentName + " has been added to your town."; commandSender.sendMessage(msg); } catch (GeoffreyCommandError e) { diff --git a/src/main/java/com/zerohighdef/geoffrey/Commands/DeleteResourceCommand.java b/src/main/java/com/zerohighdef/geoffrey/Commands/DeleteResourceCommand.java index 53aada9..bbf2acc 100644 --- a/src/main/java/com/zerohighdef/geoffrey/Commands/DeleteResourceCommand.java +++ b/src/main/java/com/zerohighdef/geoffrey/Commands/DeleteResourceCommand.java @@ -61,7 +61,7 @@ public class DeleteResourceCommand extends GeoffreyCommand { } else { - sender.sendMessage(ChatColor.RED + "Console can not remove reosurces!"); + sender.sendMessage(ChatColor.RED + "Console can not remove resources!"); } return true; diff --git a/src/main/java/com/zerohighdef/geoffrey/Commands/EditNameCommand.java b/src/main/java/com/zerohighdef/geoffrey/Commands/EditNameCommand.java index 67957ed..06de564 100644 --- a/src/main/java/com/zerohighdef/geoffrey/Commands/EditNameCommand.java +++ b/src/main/java/com/zerohighdef/geoffrey/Commands/EditNameCommand.java @@ -44,8 +44,8 @@ public class EditNameCommand extends GeoffreyCommand { Player player = ((Player) sender).getPlayer(); - String oldLocationName = parsedArgs.get(0); - String newLocationName = parsedArgs.get(1); + String newLocationName = parsedArgs.get(0); + String oldLocationName = parsedArgs.get(1); params.put("mc_uuid", player.getUniqueId().toString().replace("-", "")); params.put("new_name", oldLocationName); diff --git a/src/main/java/com/zerohighdef/geoffrey/Commands/RegisterCommand.java b/src/main/java/com/zerohighdef/geoffrey/Commands/RegisterCommand.java index 22f029e..beb9438 100644 --- a/src/main/java/com/zerohighdef/geoffrey/Commands/RegisterCommand.java +++ b/src/main/java/com/zerohighdef/geoffrey/Commands/RegisterCommand.java @@ -42,7 +42,7 @@ public class RegisterCommand extends GeoffreyCommand { CommandCallback(CommandSender sender) { super(sender); - errors.put("LocationLookUpError", "You have more than one location. Please specify a name."); + errors.put("PlayerInDBError", "You are already registered, stop being so goober-ish."); } @Override diff --git a/src/main/java/com/zerohighdef/geoffrey/Commands/RemoveResidentCommand.java b/src/main/java/com/zerohighdef/geoffrey/Commands/RemoveResidentCommand.java index e85194f..db2ba57 100644 --- a/src/main/java/com/zerohighdef/geoffrey/Commands/RemoveResidentCommand.java +++ b/src/main/java/com/zerohighdef/geoffrey/Commands/RemoveResidentCommand.java @@ -63,7 +63,7 @@ public class RemoveResidentCommand extends GeoffreyCommand { try { JsonElement json = parseJSON(s); - String msg = ChatColor.GREEN + residentName + "has been removed from your town."; + String msg = ChatColor.GREEN + residentName + " has been removed from your town."; commandSender.sendMessage(msg); } catch (GeoffreyCommandError e) { diff --git a/src/main/java/com/zerohighdef/geoffrey/GeoffreyMC.java b/src/main/java/com/zerohighdef/geoffrey/GeoffreyMC.java index 9361f1a..1b56dde 100644 --- a/src/main/java/com/zerohighdef/geoffrey/GeoffreyMC.java +++ b/src/main/java/com/zerohighdef/geoffrey/GeoffreyMC.java @@ -38,6 +38,7 @@ public final class GeoffreyMC extends JavaPlugin { this.getCommand("geoffrey_add_town").setExecutor(addLocationCommand); this.getCommand("geoffrey_add_farm").setExecutor(addLocationCommand); this.getCommand("geoffrey_add_attraction").setExecutor(addLocationCommand); + this.getCommand("geoffrey_add_market").setExecutor(addLocationCommand); RegisterCommand registerCommand = new RegisterCommand(this); this.getCommand("geoffrey_register").setExecutor(registerCommand); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 007b700..733df0c 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,5 +1,8 @@ # GeoffreyAPI Settings geoffrey_api: + # Geoffrey API Key key: '' + # Geoffrey API Base Url (e.g. test.zerohighdef.com/GeoffreyApp/api/) api_base_url: '' + # Geoffrey Base Url (e.g. test.zerohighdef.com) base_url: '' \ No newline at end of file