mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2024-12-22 07:55:03 +00:00
move method into bridge class
This commit is contained in:
parent
e0faa7ab50
commit
49e8ae387c
6 changed files with 30 additions and 26 deletions
23
TFGuilds.iml
23
TFGuilds.iml
|
@ -26,6 +26,12 @@
|
|||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-io:commons-io:2.7" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.commons:commons-lang3:3.11" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-codec:commons-codec:1.9" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.reflections:reflections:0.9.11" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: javassist:javassist:3.12.1.GA" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" />
|
||||
|
@ -33,20 +39,6 @@
|
|||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.3" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.totalfreedom:TotalFreedomMod:2020.9" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-io:commons-io:2.7" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.commons:commons-lang3:3.11" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-codec:commons-codec:1.9" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.TFPatches:TF-LibsDisguises:0cfa32159a" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.ow2.asm:asm:7.3.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.10" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.comphenix.protocol:ProtocolLib:4.5.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: cglib:cglib-nodep:3.2.5" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.comphenix.executors:BukkitExecutors:1.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.16.1-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.rayzr522:jsonmessage:1.0.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.reflections:reflections:0.9.11" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: javassist:javassist:3.12.1.GA" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.maven:maven-artifact:3.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.maven:maven-core:3.0" level="project" />
|
||||
|
@ -76,6 +68,7 @@
|
|||
<orderEntry type="library" scope="PROVIDED" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpclient:4.0.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpcore:4.0.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-codec:commons-codec:1.3" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-validator:commons-validator:1.3.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-digester:commons-digester:1.6" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
|
||||
|
@ -95,6 +88,7 @@
|
|||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.struts:struts-taglib:1.3.8" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.struts:struts-tiles:1.3.8" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.maven.doxia:doxia-integration-tools:1.6" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-io:commons-io:1.4" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.codehaus.plexus:plexus-container-default:1.0-alpha-9" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:3.8.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: classworlds:classworlds:1.1-alpha-2" level="project" />
|
||||
|
@ -113,5 +107,6 @@
|
|||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.12" level="project" />
|
||||
</component>
|
||||
</module>
|
8
pom.xml
8
pom.xml
|
@ -6,7 +6,7 @@
|
|||
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>TFGuilds</artifactId>
|
||||
<version>0.2.13</version>
|
||||
<version>0.2.14</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>TFGuilds</name>
|
||||
|
@ -86,5 +86,11 @@
|
|||
<version>2020.9</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.12</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -9,7 +9,7 @@ import org.bukkit.plugin.Plugin;
|
|||
|
||||
public class TFMBridge
|
||||
{
|
||||
private TFGuilds plugin;
|
||||
private final TFGuilds plugin;
|
||||
private TotalFreedomMod tfmPlugin;
|
||||
|
||||
public TFMBridge()
|
||||
|
@ -59,4 +59,9 @@ public class TFMBridge
|
|||
|
||||
return getTFM().sl.isStaff(sender);
|
||||
}
|
||||
|
||||
public boolean isVanished(Player player)
|
||||
{
|
||||
return getTFM().sl.isVanished(player.getName());
|
||||
}
|
||||
}
|
|
@ -33,7 +33,7 @@ public class InviteSubcommand extends Common implements CommandExecutor
|
|||
Player player = (Player)sender;
|
||||
Guild guild = Guild.getGuild(player);
|
||||
Player invitee = Bukkit.getPlayer(args[1]);
|
||||
if (invitee == null || GUtil.isVanished(invitee))
|
||||
if (invitee == null || plugin.bridge.isVanished(invitee))
|
||||
{
|
||||
sender.sendMessage(PNF);
|
||||
return true;
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.tfguilds.TFGuilds;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
|
@ -16,6 +16,7 @@ import org.bukkit.entity.Player;
|
|||
public class GUtil
|
||||
{
|
||||
private static final SimpleDateFormat STANDARD = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss");
|
||||
private static final TFGuilds plugin = TFGuilds.getPlugin();
|
||||
|
||||
public static String flatten(String s)
|
||||
{
|
||||
|
@ -47,23 +48,20 @@ public class GUtil
|
|||
}
|
||||
|
||||
public static List<String> BLACKLISTED_NAMES_AND_TAGS = Arrays.asList(
|
||||
"admin", "owner", "moderator", "developer", "console", "dev", "staff", "mod", "sra", "sta", "sa", "super admin", "telnet admin", "senior admin");
|
||||
"admin", "owner", "moderator", "developer", "console", "dev", "staff",
|
||||
"mod", "sra", "sta", "sa", "super admin", "telnet admin", "senior admin",
|
||||
"trial mod", "trial moderator", "trialmod", "trialmoderator");
|
||||
|
||||
public static List<String> getPlayerList()
|
||||
{
|
||||
List<String> players = new ArrayList<>();
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (!isVanished(player))
|
||||
if (!plugin.bridge.isVanished(player))
|
||||
{
|
||||
players.add(player.getName());
|
||||
}
|
||||
}
|
||||
return players;
|
||||
}
|
||||
|
||||
public static boolean isVanished(Player player)
|
||||
{
|
||||
return TotalFreedomMod.plugin().sl.isVanished(player.getName());
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ description: A guilds plugin for the TotalFreedom server.
|
|||
commands:
|
||||
guild:
|
||||
description: The main command of TFGuilds.
|
||||
usage: /<command> [list | help | create <name> | disband [name] | invite <player> | addmod <guild <player> | player> | removemod <guild <name> | name> | createrank <name> | setowner <guild <player> | player> | kick <guild <player> | player> | leave | setstate <guild <state> | state> | tp <player> | info [guild | player] | tag <set <tag> | clear> | join <guild> | chat [message] | roster [guild] | rename <name> | createrank <name> | deleterank <rank> | setrank <player> <rank | none> motd <set <motd> | clear> | home [set] | chat [message] | setdefaultrank <rank | none> | toggletags | toggletag]
|
||||
usage: /<command> <help>
|
||||
aliases: [g]
|
||||
guildchat:
|
||||
description: Talk in chat with your guild.
|
||||
|
|
Loading…
Reference in a new issue