allow admins to clear guild tags

This commit is contained in:
speed 2020-11-21 20:52:18 -05:00
parent db036fb187
commit 42057c539f
4 changed files with 43 additions and 6 deletions

View file

@ -9,6 +9,24 @@
</value>
</option>
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
</JetCodeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="BRACE_STYLE" value="2" />
<option name="CLASS_BRACE_STYLE" value="2" />

View file

@ -19,7 +19,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.16.3-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.16.4-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" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />

View file

@ -6,7 +6,7 @@
<groupId>me.totalfreedom</groupId>
<artifactId>TFGuilds</artifactId>
<version>0.2.15</version>
<version>0.2.16</version>
<packaging>jar</packaging>
<name>TFGuilds</name>
@ -77,7 +77,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.3-R0.1-SNAPSHOT</version>
<version>1.16.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View file

@ -24,7 +24,7 @@ public class TagSubcommand extends Common implements CommandExecutor
if (args.length < 2)
{
sender.sendMessage(tl(PREFIX + "Proper usage: /g tag <set <tag> | clear>"));
sender.sendMessage(tl(PREFIX + "Proper usage: /g tag <set <tag> | clear [guild]>>"));
return true;
}
@ -73,15 +73,34 @@ public class TagSubcommand extends Common implements CommandExecutor
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].equalsIgnoreCase("clear"))
{
if (args.length >= 3)
{
if (!plugin.bridge.isAdmin(sender))
{
sender.sendMessage(NO_PERMS);
return true;
}
Guild g = Guild.getGuild(GUtil.flatten(StringUtils.join(args, " ", 2, args.length)));
if (g == null)
{
sender.sendMessage(ChatColor.RED + "That guild doesn't exist!");
return true;
}
g.setTag(null);
g.save();
sender.sendMessage(tl("%p%Cleared guild tag for " + g.getName() + "."));
return true;
}
guild.setTag(null);
guild.save();
sender.sendMessage(tl("%p%Your guild tag has been cleared."));
return true;
}
return true;
}