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

View file

@ -2,7 +2,6 @@ package totalfreedom.tfguilds;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import totalfreedom.tfguilds.bridge.TFMBridge;
import totalfreedom.tfguilds.command.CreateGuildCommand; import totalfreedom.tfguilds.command.CreateGuildCommand;
import totalfreedom.tfguilds.command.GuildChatCommand; import totalfreedom.tfguilds.command.GuildChatCommand;
import totalfreedom.tfguilds.command.GuildTagCommand; import totalfreedom.tfguilds.command.GuildTagCommand;
@ -16,7 +15,6 @@ public final class TFGuilds extends JavaPlugin
public static TFGuilds plugin; public static TFGuilds plugin;
public Config config; public Config config;
public Config guilds; public Config guilds;
public TFMBridge tfmb;
@Override @Override
public void onEnable() public void onEnable()
@ -26,7 +24,6 @@ public final class TFGuilds extends JavaPlugin
enableListeners(); enableListeners();
config = new Config(plugin, "config.yml"); config = new Config(plugin, "config.yml");
guilds = new Config(plugin, "guilds.yml"); guilds = new Config(plugin, "guilds.yml");
tfmb = new TFMBridge();
GLog.info("Enabled"); 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

@ -96,12 +96,14 @@ public class GUtil
public static void guildChat(CommandSender sender, String message, String guildName) 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()) for (Player player : Bukkit.getOnlinePlayers())
{ {
if (isGuildMember(player, guildName)) if (isGuildMember(player, guildName))
{ {
player.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.BLUE + "GC" + ChatColor.DARK_GRAY + "] " + getTag(guildName) + " " + ChatColor.BLUE + sender player.sendMessage(sent);
.getName() + ChatColor.GRAY + ": " + ChatColor.AQUA + message);
} }
} }
} }