@superischroma jas9dausjpdoijasijdiop@
This commit is contained in:
speedxx 2020-08-14 16:13:14 -04:00
parent 24a9d64ab7
commit d9c703e73e
25 changed files with 77 additions and 29 deletions

View file

@ -1,5 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>SPIGOT</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />

View file

@ -18,7 +18,8 @@ public class AddModSubcommand extends Common implements CommandExecutor
{
if (args.length == 1 || args.length > 3)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g addmod <guild <player> | player>"));
return true;
}
if (args.length == 3)

View file

@ -24,7 +24,8 @@ public class CreateRankSubcommand extends Common implements CommandExecutor
if (args.length < 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g createrank <name>"));
return true;
}
Player player = (Player)sender;

View file

@ -28,7 +28,8 @@ public class CreateSubcommand extends Common implements CommandExecutor
if (args.length < 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g create <name>"));
return true;
}
Player player = (Player)sender;

View file

@ -23,7 +23,8 @@ public class DeleteRankSubcommand extends Common implements CommandExecutor
if (args.length < 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g deleterank <rank>"));
return true;
}
Player player = (Player)sender;

View file

@ -20,7 +20,8 @@ public class DisbandSubcommand extends Common implements CommandExecutor
{
if (args.length > 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g disband [name]"));
return true;
}
if (args.length == 2)

View file

@ -6,12 +6,10 @@ import java.util.List;
import me.totalfreedom.tfguilds.Common;
import me.totalfreedom.tfguilds.guild.Guild;
import me.totalfreedom.tfguilds.util.GUtil;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
public class GuildCommand extends Common implements CommandExecutor, TabCompleter
{
@ -70,12 +68,13 @@ public class GuildCommand extends Common implements CommandExecutor, TabComplete
return new RosterSubcommand().onCommand(sender, command, label, args);
case "setdefaultrank":
return new SetDefaultRankSubcommand().onCommand(sender, command, label, args);
/*case "toggletags":
case "toggletags":
return new ToggleTagsSubcommand().onCommand(sender, command, label, args);
case "toggletag":
return new ToggleTagSubcommand().onCommand(sender, command, label, args);*/
return new ToggleTagSubcommand().onCommand(sender, command, label, args);
}
return false;
sender.sendMessage(tl(PREFIX + "Unknown command - Run /g help if you need help"));
return true;
}
return new HelpSubcommand().onCommand(sender, command, label, args);
}

View file

@ -14,6 +14,7 @@ public class HelpSubcommand extends Common implements CommandExecutor
sender.sendMessage(tl("%s% - %p%list"));
sender.sendMessage(tl("%s% - %p%help"));
sender.sendMessage(tl("%s% - %p%create <name>"));
sender.sendMessage(tl("%s% - %p%join <guild>"));
sender.sendMessage(tl("%s% - %p%disband [name]"));
sender.sendMessage(tl("%s% - %p%invite <player>"));
sender.sendMessage(tl("%s% - %p%addmod <guild <player> | player>"));
@ -34,6 +35,8 @@ public class HelpSubcommand extends Common implements CommandExecutor
sender.sendMessage(tl("%s% - %p%roster [guild | player]"));
sender.sendMessage(tl("%s% - %p%setstate <open | invite | closed>"));
sender.sendMessage(tl("%s% - %p%setdefaultrank <rank | none>"));
sender.sendMessage(tl("%s% - %p%toggletags"));
sender.sendMessage(tl("%s% - %p%toggletag"));
return true;
}
}

View file

@ -16,7 +16,8 @@ public class HomeSubcommand extends Common implements CommandExecutor
{
if (args.length > 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g home [set]"));
return true;
}
if (sender instanceof ConsoleCommandSender)

View file

@ -26,7 +26,8 @@ public class InviteSubcommand extends Common implements CommandExecutor
if (args.length != 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g invite <player>"));
return true;
}
Player player = (Player)sender;

View file

@ -25,7 +25,8 @@ public class JoinSubcommand extends Common implements CommandExecutor
if (args.length < 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g join <guild>"));
return true;
}
Player player = (Player)sender;

View file

@ -18,7 +18,8 @@ public class KickSubcommand extends Common implements CommandExecutor
{
if (args.length > 3)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g kick <guild <player> | player>"));
return true;
}
if (args.length == 3)

View file

@ -16,7 +16,8 @@ public class LeaveSubcommand extends Common implements CommandExecutor
{
if (args.length > 1)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g leave"));
return true;
}
if (sender instanceof ConsoleCommandSender)

View file

@ -18,7 +18,8 @@ public class MOTDSubcommand extends Common implements CommandExecutor
{
if (args.length == 1)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g motd <set <motd> | clear>"));
return true;
}
if (sender instanceof ConsoleCommandSender)

View file

@ -18,7 +18,8 @@ public class RemoveModSubcommand extends Common implements CommandExecutor
{
if (args.length == 1 || args.length > 3)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g removemod <guild <name> | name>>"));
return true;
}
if (args.length == 3)

View file

@ -21,7 +21,8 @@ public class RenameSubcommand extends Common implements CommandExecutor
{
if (args.length < 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g rename <name>"));
return true;
}
if (sender instanceof ConsoleCommandSender)

View file

@ -23,7 +23,8 @@ public class SetDefaultRankSubcommand extends Common implements CommandExecutor
if (args.length == 0)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g setdefaultrank <rank | none>"));
return true;
}
Player player = (Player)sender;

View file

@ -18,7 +18,8 @@ public class SetOwnerSubcommand extends Common implements CommandExecutor
{
if (args.length == 1 || args.length > 3)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g setowner <guild <player> | player>"));
return true;
}
if (args.length == 3)

View file

@ -19,7 +19,8 @@ public class SetRankSubcommand extends Common implements CommandExecutor
{
if (args.length == 1)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g setrank <player> <rank | none>"));
return true;
}
if (sender instanceof ConsoleCommandSender)

View file

@ -16,6 +16,12 @@ public class SetStateSubcommand extends Common implements CommandExecutor
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
if (args.length == 1)
{
sender.sendMessage(tl(PREFIX + "Proper usage: /g setstate <open | invite | closed>"));
return true;
}
if (args.length == 3)
{
if (!plugin.bridge.isAdmin(sender))

View file

@ -23,7 +23,8 @@ public class TPSubcommand extends Common implements CommandExecutor
if (args.length != 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g tp <player>"));
return true;
}
Player player = (Player)sender;

View file

@ -24,7 +24,8 @@ public class TagSubcommand extends Common implements CommandExecutor
if (args.length < 2)
{
return false;
sender.sendMessage(tl(PREFIX + "Proper usage: /g tag <set <tag> | clear>"));
return true;
}
Player player = (Player)sender;

View file

@ -1,4 +1,4 @@
/*package me.totalfreedom.tfguilds.command;
package me.totalfreedom.tfguilds.command;
import me.totalfreedom.tfguilds.Common;
import me.totalfreedom.tfguilds.guild.Guild;
@ -42,4 +42,4 @@ public class ToggleTagSubcommand extends Common implements CommandExecutor
sender.sendMessage(tl(PREFIX + "Enabled personal guild tag."));
return true;
}
}*/
}

View file

@ -1,4 +1,4 @@
/*package me.totalfreedom.tfguilds.command;
package me.totalfreedom.tfguilds.command;
import me.totalfreedom.tfguilds.Common;
import me.totalfreedom.tfguilds.config.ConfigEntry;
@ -33,4 +33,4 @@ public class ToggleTagsSubcommand extends Common implements CommandExecutor
}
return true;
}
}*/
}

View file

@ -67,7 +67,10 @@ public class ChatListener implements Listener
if (guild.hasTag())
{
e.setFormat(GUtil.colorize(guild.getTag().replace("%rank%", display)) + ChatColor.RESET + " " + e.getFormat());
if (guild.getTag() != null)
{
e.setFormat(GUtil.colorize(guild.getTag().replace("%rank%", display)) + ChatColor.RESET + " " + e.getFormat());
}
}
if (!ConfigEntry.GUILD_TAGS_ENABLED.getBoolean())
@ -76,9 +79,14 @@ public class ChatListener implements Listener
{
Guild g = Guild.getGuild(p);
if (guild.hasTag())
if (g.hasTag())
{
e.setFormat(e.getFormat().substring(g.getTag().length()));
if (g.getTag().contains(display))
{
e.setFormat(e.getFormat().substring(display.length()));
}
}
}
}
@ -93,6 +101,11 @@ public class ChatListener implements Listener
if (guild.hasTag())
{
e.setFormat(e.getFormat().substring(guild.getTag().length()));
if (guild.getTag().contains(display))
{
e.setFormat(e.getFormat().substring(display.length()));
}
}
}
}