mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2024-12-22 07:55:03 +00:00
gonna do the thing i was supposed to do in another commit
This commit is contained in:
parent
6a801d6cd7
commit
b8a07c0281
9 changed files with 72 additions and 32 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,5 +2,6 @@
|
|||
/.idea/libraries
|
||||
/.idea/workspace.xml
|
||||
/.idea/modules.xml
|
||||
/.idea/uiDesigner.xml
|
||||
target/
|
||||
out/
|
35
.idea/jarRepositories.xml
Normal file
35
.idea/jarRepositories.xml
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jitpack.io" />
|
||||
<option name="name" value="jitpack.io" />
|
||||
<option name="url" value="https://jitpack.io" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="sonatype" />
|
||||
<option name="name" value="sonatype" />
|
||||
<option name="url" value="https://oss.sonatype.org/content/groups/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="spigotmc-repo" />
|
||||
<option name="name" value="spigotmc-repo" />
|
||||
<option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
|
@ -12,5 +12,5 @@
|
|||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="11" project-jdk-type="JavaSDK" />
|
||||
</project>
|
24
TFGuilds.iml
24
TFGuilds.iml
|
@ -23,18 +23,18 @@
|
|||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<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" name="Maven: com.google.guava:guava:21.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.16-R0.3" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
|
||||
<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" name="Maven: com.github.TFPatches:TotalFreedomMod:server-2ca57c9b39-1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.TFPatches:TF-LibsDisguises:0cfa32159a" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.ow2.asm:asm:7.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.comphenix.protocol:ProtocolLib:4.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: cglib:cglib-nodep:3.2.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.comphenix.executors:BukkitExecutors:1.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.spigotmc:spigot:1.16.1-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: me.rayzr522:jsonmessage:1.0.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.TFPatches:TotalFreedomMod:server-2ca57c9b39-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.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: 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" />
|
||||
</component>
|
||||
</module>
|
|
@ -138,10 +138,17 @@ public class GuildCommand extends Common implements CommandExecutor, TabComplete
|
|||
return Guild.getGuildList();
|
||||
}
|
||||
|
||||
case "kick":
|
||||
{
|
||||
if (guild.hasModerator(sender.getName()))
|
||||
{
|
||||
return guild.getOnlyMembers();
|
||||
}
|
||||
}
|
||||
|
||||
case "removemod":
|
||||
case "addmod":
|
||||
case "setowner":
|
||||
case "kick":
|
||||
{
|
||||
if (guild.getOwner().equals(sender.getName()))
|
||||
{
|
||||
|
|
|
@ -90,19 +90,13 @@ public class KickSubcommand extends Common implements CommandExecutor
|
|||
return true;
|
||||
}
|
||||
|
||||
if (guild.getOwner().equals(n.getName()))
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "No need to make yourself a moderator!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!guild.hasMember(n.getName()))
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "This player is not in your guild!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((guild.getOwner().equals(n.getName()) || guild.hasModerator(n.getName())) && !guild.getOwner().equals(player.getName()))
|
||||
if (guild.getOwner().equals(n.getName()) || guild.hasModerator(n.getName()) && !guild.getOwner().equals(player.getName()))
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "You cannot kick the owner/moderator(s) of a guild!");
|
||||
return true;
|
||||
|
|
|
@ -43,7 +43,7 @@ public class TagSubcommand extends Common implements CommandExecutor
|
|||
|
||||
if (args.length >= 3)
|
||||
{
|
||||
if (args[1].toLowerCase().equals("set"))
|
||||
if (args[1].equalsIgnoreCase("set"))
|
||||
{
|
||||
String tag = StringUtils.join(args, " ", 2, args.length);
|
||||
|
||||
|
@ -69,13 +69,13 @@ public class TagSubcommand extends Common implements CommandExecutor
|
|||
|
||||
guild.setTag(tag);
|
||||
guild.save();
|
||||
sender.sendMessage(tl("%p%Your guild tag has been changed to be \"" + GUtil.colorize(tag).replace("%rank%", ChatColor.GOLD +"Guild Owner") + "%p%\"."));
|
||||
sender.sendMessage(tl("%p%Your guild tag has been changed to be \"" + GUtil.colorize(tag).replace("%rank%", "Guild Owner") + "%p%\"."));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (args[1].toLowerCase().equals("clear"))
|
||||
if (args[1].equalsIgnoreCase("clear"))
|
||||
{
|
||||
guild.setTag(null);
|
||||
guild.save();
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.bukkit.entity.Player;
|
|||
|
||||
public class Guild
|
||||
{
|
||||
private static TFGuilds plugin = TFGuilds.getPlugin();
|
||||
private static final TFGuilds plugin = TFGuilds.getPlugin();
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
@ -35,10 +35,10 @@ public class Guild
|
|||
private String owner;
|
||||
|
||||
@Getter
|
||||
private List<String> moderators;
|
||||
private final List<String> moderators;
|
||||
|
||||
@Getter
|
||||
private List<String> members;
|
||||
private final List<String> members;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
@ -49,7 +49,7 @@ public class Guild
|
|||
private GuildState state;
|
||||
|
||||
@Getter
|
||||
private List<GuildRank> ranks;
|
||||
private final List<GuildRank> ranks;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
@ -248,13 +248,16 @@ public class Guild
|
|||
|
||||
public String getRoster()
|
||||
{
|
||||
String list = Common.PREFIX + "Guild Roster for " + name + "\n" +
|
||||
StringBuilder list = new StringBuilder(Common.PREFIX + "Guild Roster for " + name + "\n" +
|
||||
"%s%Owner%p% - " + owner + "\n" +
|
||||
"%s%Moderators%p% - " + StringUtils.join(moderators, ", ") + "\n";
|
||||
"%s%Moderators%p% - " + StringUtils.join(moderators, ", ") + "\n");
|
||||
|
||||
for (GuildRank rank : ranks)
|
||||
{
|
||||
list += "%s%" + rank.getName() + "%p% - " + StringUtils.join(rank.getMembers(), ", ") + "\n";
|
||||
list.append("%s%")
|
||||
.append(rank.getName()).append("%p% - ")
|
||||
.append(StringUtils.join(rank.getMembers(), ", "))
|
||||
.append("\n");
|
||||
}
|
||||
|
||||
return Common.tl(list +
|
||||
|
|
|
@ -7,7 +7,7 @@ description: A guilds plugin for the TotalFreedom server.
|
|||
commands:
|
||||
guild:
|
||||
description: The main command of TFGuilds.
|
||||
usage: /<command> [list [guild] | help | create <name> | disband [name] | invite <player> | addmod <guild <player> | player> | removemod <guild <name> | name> | createrole <name> | setowner <guild <player> | player> | kick <guild <player> | player> | leave | setstate <guild <state> | state> | tp <player> | info [guild] | tag <set <tag> | clear> | join <guild> | chat [message] | saveconfig | rename <name> | createrank <name> | deleterank <rank> | setrank <player> <rank | none> motd <set <motd> | clear> | home [set] | chat [message]]
|
||||
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]]
|
||||
aliases: [g]
|
||||
guildchat:
|
||||
description: Talk in chat with your guild.
|
||||
|
|
Loading…
Reference in a new issue