log this instead

This commit is contained in:
speedxx 2020-06-18 16:56:26 -04:00
parent f9cdf3779d
commit 852a7fdc61
8 changed files with 11 additions and 70 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
.idea/
target/
out/

View file

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: me.totalfreedom:totalfreedom:5.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/me/totalfreedom/totalfreedom/5.2/totalfreedom-5.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/me/totalfreedom/totalfreedom/5.2/totalfreedom-5.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/me/totalfreedom/totalfreedom/5.2/totalfreedom-5.2-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -6,7 +6,7 @@
<groupId>me.tf</groupId>
<artifactId>TFGuilds</artifactId>
<version>0.0.3</version>
<version>0.0.7</version>
<packaging>jar</packaging>
<name>TFGuilds</name>
@ -78,10 +78,5 @@
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.totalfreedom</groupId>
<artifactId>totalfreedom</artifactId>
<version>5.2</version>
</dependency>
</dependencies>
</project>
</project>

View file

@ -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");
}

View file

@ -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);
}
}

View file

@ -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;
}

View file

@ -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());

View file

@ -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);
}
}
}