From 852a7fdc61b520258a347099da13423e22add36c Mon Sep 17 00:00:00 2001 From: speedxx <43330808+speedxx@users.noreply.github.com> Date: Thu, 18 Jun 2020 16:56:26 -0400 Subject: [PATCH] log this instead --- .gitignore | 3 ++ ...aven__me_totalfreedom_totalfreedom_5_2.xml | 13 ------ pom.xml | 9 +--- .../java/totalfreedom/tfguilds/TFGuilds.java | 3 -- .../tfguilds/bridge/TFMBridge.java | 43 ------------------- .../tfguilds/command/GuildTagCommand.java | 2 +- .../tfguilds/listener/ChatManager.java | 2 +- .../totalfreedom/tfguilds/util/GUtil.java | 6 ++- 8 files changed, 11 insertions(+), 70 deletions(-) create mode 100644 .gitignore delete mode 100644 .idea/libraries/Maven__me_totalfreedom_totalfreedom_5_2.xml delete mode 100644 src/main/java/totalfreedom/tfguilds/bridge/TFMBridge.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..744003a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +target/ +out/ \ No newline at end of file diff --git a/.idea/libraries/Maven__me_totalfreedom_totalfreedom_5_2.xml b/.idea/libraries/Maven__me_totalfreedom_totalfreedom_5_2.xml deleted file mode 100644 index b66e09e..0000000 --- a/.idea/libraries/Maven__me_totalfreedom_totalfreedom_5_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7b78990..a64d61a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.tf TFGuilds - 0.0.3 + 0.0.7 jar TFGuilds @@ -78,10 +78,5 @@ 1.18.12 provided - - me.totalfreedom - totalfreedom - 5.2 - - + \ No newline at end of file diff --git a/src/main/java/totalfreedom/tfguilds/TFGuilds.java b/src/main/java/totalfreedom/tfguilds/TFGuilds.java index 6bc4923..37e7039 100644 --- a/src/main/java/totalfreedom/tfguilds/TFGuilds.java +++ b/src/main/java/totalfreedom/tfguilds/TFGuilds.java @@ -2,7 +2,6 @@ package totalfreedom.tfguilds; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; -import totalfreedom.tfguilds.bridge.TFMBridge; import totalfreedom.tfguilds.command.CreateGuildCommand; import totalfreedom.tfguilds.command.GuildChatCommand; import totalfreedom.tfguilds.command.GuildTagCommand; @@ -16,7 +15,6 @@ public final class TFGuilds extends JavaPlugin public static TFGuilds plugin; public Config config; public Config guilds; - public TFMBridge tfmb; @Override public void onEnable() @@ -26,7 +24,6 @@ public final class TFGuilds extends JavaPlugin enableListeners(); config = new Config(plugin, "config.yml"); guilds = new Config(plugin, "guilds.yml"); - tfmb = new TFMBridge(); GLog.info("Enabled"); } diff --git a/src/main/java/totalfreedom/tfguilds/bridge/TFMBridge.java b/src/main/java/totalfreedom/tfguilds/bridge/TFMBridge.java deleted file mode 100644 index 4f8ccef..0000000 --- a/src/main/java/totalfreedom/tfguilds/bridge/TFMBridge.java +++ /dev/null @@ -1,43 +0,0 @@ -package totalfreedom.tfguilds.bridge; - -import me.totalfreedom.totalfreedommod.TotalFreedomMod; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import totalfreedom.tfguilds.TFGuilds; - -public class TFMBridge -{ - private TFGuilds plugin; - private TotalFreedomMod tfmPlugin; - - public TFMBridge() - { - this.plugin = TFGuilds.plugin; - this.tfmPlugin = null; - } - - public TotalFreedomMod getTFM() - { - if (tfmPlugin == null) - { - try - { - final Plugin tfm = plugin.getServer().getPluginManager().getPlugin("TotalFreedomMod"); - if (tfm != null && tfm instanceof TotalFreedomMod) - { - tfmPlugin = (TotalFreedomMod) tfm; - } - } - catch (Exception ex) - { - ex.printStackTrace(); - } - } - return tfmPlugin; - } - - public boolean isAdmin(Player player) - { - return getTFM().al.isAdmin(player); - } -} \ No newline at end of file diff --git a/src/main/java/totalfreedom/tfguilds/command/GuildTagCommand.java b/src/main/java/totalfreedom/tfguilds/command/GuildTagCommand.java index a9f50fb..c979a93 100644 --- a/src/main/java/totalfreedom/tfguilds/command/GuildTagCommand.java +++ b/src/main/java/totalfreedom/tfguilds/command/GuildTagCommand.java @@ -61,7 +61,7 @@ public class GuildTagCommand extends GBase implements CommandExecutor { return false; } - GUtil.setTag(GUtil.color("&8[&7" + guild + "&8]&r"), guild); + GUtil.setTag(GUtil.color("&8[&7" + guild + "&8]&r "), guild); sender.sendMessage(ChatColor.GRAY + "Removed your guild's tag."); return true; } diff --git a/src/main/java/totalfreedom/tfguilds/listener/ChatManager.java b/src/main/java/totalfreedom/tfguilds/listener/ChatManager.java index 7145664..18f1d39 100644 --- a/src/main/java/totalfreedom/tfguilds/listener/ChatManager.java +++ b/src/main/java/totalfreedom/tfguilds/listener/ChatManager.java @@ -25,7 +25,7 @@ public class ChatManager implements Listener return; if (!GUtil.hasTag(guild)) { - GUtil.setTag(GUtil.color("&8[&7" + guild + "&8]&r"), guild); + GUtil.setTag(GUtil.color("&8[&7" + guild + "&8]&r "), guild); } e.setFormat(GUtil.color(GUtil.getTag(guild)) + " " + ChatColor.RESET + e.getFormat()); diff --git a/src/main/java/totalfreedom/tfguilds/util/GUtil.java b/src/main/java/totalfreedom/tfguilds/util/GUtil.java index 3d2258e..51c6e74 100644 --- a/src/main/java/totalfreedom/tfguilds/util/GUtil.java +++ b/src/main/java/totalfreedom/tfguilds/util/GUtil.java @@ -96,12 +96,14 @@ public class GUtil public static void guildChat(CommandSender sender, String message, String guildName) { + String sent = ChatColor.DARK_GRAY + "[" + ChatColor.BLUE + "GC" + ChatColor.DARK_GRAY + "] " + getTag(guildName) + ChatColor.BLUE + sender + .getName() + ChatColor.GRAY + ": " + ChatColor.AQUA + message; + GLog.info(sent); for (Player player : Bukkit.getOnlinePlayers()) { if (isGuildMember(player, guildName)) { - player.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.BLUE + "GC" + ChatColor.DARK_GRAY + "] " + getTag(guildName) + " " + ChatColor.BLUE + sender - .getName() + ChatColor.GRAY + ": " + ChatColor.AQUA + message); + player.sendMessage(sent); } } }