mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2024-12-22 16:05:00 +00:00
log this instead
This commit is contained in:
parent
f9cdf3779d
commit
852a7fdc61
8 changed files with 11 additions and 70 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.idea/
|
||||||
|
target/
|
||||||
|
out/
|
|
@ -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>
|
|
9
pom.xml
9
pom.xml
|
@ -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>
|
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -61,7 +61,7 @@ public class GuildTagCommand extends GBase implements CommandExecutor
|
||||||
{
|
{
|
||||||
return false;
|
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.");
|
sender.sendMessage(ChatColor.GRAY + "Removed your guild's tag.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class ChatManager implements Listener
|
||||||
return;
|
return;
|
||||||
if (!GUtil.hasTag(guild))
|
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());
|
e.setFormat(GUtil.color(GUtil.getTag(guild)) + " " + ChatColor.RESET + e.getFormat());
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue